mirror of
https://github.com/FDOS/kernel.git
synced 2025-07-03 03:54:31 +02:00
init_device corrections/cleanups (mainly by Arkady)
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@679 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
parent
44c5a93bdb
commit
6cd84b06d1
@ -227,7 +227,7 @@ STATIC void init_kernel(void)
|
|||||||
/* we can read config.sys later. */
|
/* we can read config.sys later. */
|
||||||
LoL->lastdrive = Config.cfgLastdrive;
|
LoL->lastdrive = Config.cfgLastdrive;
|
||||||
|
|
||||||
/* init_device((struct dhdr FAR *)&blk_dev, NULL, NULL, ram_top); */
|
/* init_device((struct dhdr FAR *)&blk_dev, NULL, 0, ram_top); */
|
||||||
blk_dev.dh_name[0] = dsk_init();
|
blk_dev.dh_name[0] = dsk_init();
|
||||||
|
|
||||||
PreConfig();
|
PreConfig();
|
||||||
@ -501,24 +501,31 @@ BOOL init_device(struct dhdr FAR * dhp, char *cmdLine, COUNT mode,
|
|||||||
char FAR *r_top)
|
char FAR *r_top)
|
||||||
{
|
{
|
||||||
request rq;
|
request rq;
|
||||||
int i;
|
|
||||||
char name[8];
|
char name[8];
|
||||||
char *p, *q;
|
|
||||||
|
|
||||||
for (p = q = cmdLine; *p && *p != ' ' && *p != '\t'; p++)
|
if (cmdLine) {
|
||||||
{
|
char *p, *q, ch;
|
||||||
if (*p == '\\' || *p == '/' || *p == ':')
|
int i;
|
||||||
q = p + 1;
|
|
||||||
|
p = q = cmdLine;
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
ch = *p;
|
||||||
|
if (ch == '\0' || ch == ' ' || ch == '\t')
|
||||||
|
break;
|
||||||
|
p++;
|
||||||
|
if (ch == '\\' || ch == '/' || ch == ':')
|
||||||
|
q = p; /* remember position after path */
|
||||||
|
}
|
||||||
|
for (i = 0; i < 8; i++) {
|
||||||
|
ch = '\0';
|
||||||
|
if (p != q && *q != '.')
|
||||||
|
ch = *q++;
|
||||||
|
/* copy name, without extension */
|
||||||
|
name[i] = ch;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for (i = 0; i < 8; i++) {
|
|
||||||
char ch = *q;
|
|
||||||
if (ch != '\0')
|
|
||||||
q++;
|
|
||||||
if (ch == '.')
|
|
||||||
ch = 0;
|
|
||||||
name[i] = ch;
|
|
||||||
}
|
|
||||||
|
|
||||||
rq.r_unit = 0;
|
rq.r_unit = 0;
|
||||||
rq.r_status = 0;
|
rq.r_status = 0;
|
||||||
rq.r_command = C_INIT;
|
rq.r_command = C_INIT;
|
||||||
@ -566,7 +573,7 @@ STATIC void InitIO(void)
|
|||||||
/* Initialize driver chain */
|
/* Initialize driver chain */
|
||||||
setvec(0x29, int29_handler); /* Requires Fast Con Driver */
|
setvec(0x29, int29_handler); /* Requires Fast Con Driver */
|
||||||
do {
|
do {
|
||||||
init_device(device, NULL, NULL, lpTop);
|
init_device(device, NULL, 0, lpTop);
|
||||||
device = device->dh_next;
|
device = device->dh_next;
|
||||||
}
|
}
|
||||||
while (FP_OFF(device) != 0xffff);
|
while (FP_OFF(device) != 0xffff);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user