mirror of https://github.com/FDOS/kernel.git
commit
2835dfe920
175
kernel/config.c
175
kernel/config.c
|
@ -155,6 +155,14 @@ COUNT UmbState BSS_INIT(0);
|
||||||
STATIC BYTE szLine[256] BSS_INIT({0});
|
STATIC BYTE szLine[256] BSS_INIT({0});
|
||||||
STATIC BYTE szBuf[256] BSS_INIT({0});
|
STATIC BYTE szBuf[256] BSS_INIT({0});
|
||||||
|
|
||||||
|
#define MAX_CHAINS 5
|
||||||
|
struct CfgFile {
|
||||||
|
COUNT nFileDesc;
|
||||||
|
COUNT nCfgLine;
|
||||||
|
} cfgFile[MAX_CHAINS];
|
||||||
|
COUNT nCurChain = 0;
|
||||||
|
COUNT nFileDesc;
|
||||||
|
|
||||||
BYTE singleStep BSS_INIT(FALSE); /* F8 processing */
|
BYTE singleStep BSS_INIT(FALSE); /* F8 processing */
|
||||||
BYTE SkipAllConfig BSS_INIT(FALSE); /* F5 processing */
|
BYTE SkipAllConfig BSS_INIT(FALSE); /* F5 processing */
|
||||||
BYTE askThisSingleCommand BSS_INIT(FALSE); /* ?device= device?= */
|
BYTE askThisSingleCommand BSS_INIT(FALSE); /* ?device= device?= */
|
||||||
|
@ -188,6 +196,7 @@ STATIC VOID InitPgm(BYTE * pLine);
|
||||||
STATIC VOID InitPgmHigh(BYTE * pLine);
|
STATIC VOID InitPgmHigh(BYTE * pLine);
|
||||||
STATIC VOID CmdInstall(BYTE * pLine);
|
STATIC VOID CmdInstall(BYTE * pLine);
|
||||||
STATIC VOID CmdInstallHigh(BYTE * pLine);
|
STATIC VOID CmdInstallHigh(BYTE * pLine);
|
||||||
|
STATIC VOID CmdChain(BYTE * pLine);
|
||||||
STATIC VOID CmdSet(BYTE * pLine);
|
STATIC VOID CmdSet(BYTE * pLine);
|
||||||
|
|
||||||
|
|
||||||
|
@ -294,8 +303,9 @@ STATIC struct table commands[] = {
|
||||||
{"DEVICEHIGH", 2, DeviceHigh},
|
{"DEVICEHIGH", 2, DeviceHigh},
|
||||||
{"INSTALL", 2, CmdInstall},
|
{"INSTALL", 2, CmdInstall},
|
||||||
{"INSTALLHIGH", 2, CmdInstallHigh},
|
{"INSTALLHIGH", 2, CmdInstallHigh},
|
||||||
|
{"CHAIN", 2, CmdChain},
|
||||||
{"SET", 2, CmdSet},
|
{"SET", 2, CmdSet},
|
||||||
|
|
||||||
/* default action */
|
/* default action */
|
||||||
{"", -1, CfgFailure}
|
{"", -1, CfgFailure}
|
||||||
};
|
};
|
||||||
|
@ -417,14 +427,14 @@ void PostConfig(void)
|
||||||
/* We could just have loaded FDXMS or HIMEM */
|
/* We could just have loaded FDXMS or HIMEM */
|
||||||
if (HMAState == HMA_REQ && MoveKernelToHMA())
|
if (HMAState == HMA_REQ && MoveKernelToHMA())
|
||||||
HMAState = HMA_DONE;
|
HMAState = HMA_DONE;
|
||||||
|
|
||||||
if (Config.cfgDosDataUmb)
|
if (Config.cfgDosDataUmb)
|
||||||
{
|
{
|
||||||
Config.cfgFilesHigh = TRUE;
|
Config.cfgFilesHigh = TRUE;
|
||||||
Config.cfgLastdriveHigh = TRUE;
|
Config.cfgLastdriveHigh = TRUE;
|
||||||
Config.cfgStacksHigh = TRUE;
|
Config.cfgStacksHigh = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* compute lastdrive ... */
|
/* compute lastdrive ... */
|
||||||
LoL->lastdrive = Config.cfgLastdrive;
|
LoL->lastdrive = Config.cfgLastdrive;
|
||||||
if (LoL->lastdrive < LoL->nblkdev)
|
if (LoL->lastdrive < LoL->nblkdev)
|
||||||
|
@ -540,13 +550,13 @@ STATIC void umb_init(void)
|
||||||
mumcb_init(LoL->uppermem_root, umb_seg - LoL->uppermem_root - 1);
|
mumcb_init(LoL->uppermem_root, umb_seg - LoL->uppermem_root - 1);
|
||||||
|
|
||||||
/* setup the real mcb for the devicehigh block */
|
/* setup the real mcb for the devicehigh block */
|
||||||
mcb_init(umb_seg, umb_size - 2, MCB_NORMAL);
|
mcb_init(umb_seg, umb_size - 2, MCB_NORMAL);
|
||||||
|
|
||||||
umb_base_seg = umb_max = umb_start = umb_seg;
|
umb_base_seg = umb_max = umb_start = umb_seg;
|
||||||
UMB_top = umb_size;
|
UMB_top = umb_size;
|
||||||
|
|
||||||
/* there can be more UMBs !
|
/* there can be more UMBs !
|
||||||
this happens, if memory mapped devces are in between
|
this happens, if memory mapped devces are in between
|
||||||
like UMB memory c800..c8ff, d8ff..efff with device at d000..d7ff
|
like UMB memory c800..c8ff, d8ff..efff with device at d000..d7ff
|
||||||
However some of the xxxHIGH commands still only work with
|
However some of the xxxHIGH commands still only work with
|
||||||
the first UMB.
|
the first UMB.
|
||||||
|
@ -635,18 +645,18 @@ BYTE FAR * ProcessMemdiskLine(BYTE FAR *cLine)
|
||||||
{
|
{
|
||||||
BYTE FAR *ptr;
|
BYTE FAR *ptr;
|
||||||
BYTE FAR *sLine = cLine;
|
BYTE FAR *sLine = cLine;
|
||||||
|
|
||||||
/* skip everything until end of line or starting { */
|
/* skip everything until end of line or starting { */
|
||||||
for (; *cLine && (*cLine != '{'); ++cLine)
|
for (; *cLine && (*cLine != '{'); ++cLine)
|
||||||
;
|
;
|
||||||
sLine = cLine;
|
sLine = cLine;
|
||||||
|
|
||||||
for (ptr = cLine; *cLine; ptr = cLine)
|
for (ptr = cLine; *cLine; ptr = cLine)
|
||||||
{
|
{
|
||||||
/* skip everything until end of line or starting { */
|
/* skip everything until end of line or starting { */
|
||||||
for (++cLine; *cLine && (*cLine != '{'); ++cLine)
|
for (++cLine; *cLine && (*cLine != '{'); ++cLine)
|
||||||
;
|
;
|
||||||
|
|
||||||
/* calc offset from previous { to next { or eol and replace previous { with offset */
|
/* calc offset from previous { to next { or eol and replace previous { with offset */
|
||||||
*ptr = (BYTE)(cLine - ptr);
|
*ptr = (BYTE)(cLine - ptr);
|
||||||
}
|
}
|
||||||
|
@ -666,11 +676,11 @@ BYTE FAR * GetNextMemdiskLine(BYTE FAR *cLine, BYTE *pLine)
|
||||||
{
|
{
|
||||||
STATIC struct memdiskopt memdiskopts[] = {
|
STATIC struct memdiskopt memdiskopts[] = {
|
||||||
{"initrd", 6}, {"BOOT_IMAGE", 10},
|
{"initrd", 6}, {"BOOT_IMAGE", 10},
|
||||||
{"floppy", 6}, {"harddisk", 8}, {"iso", 3},
|
{"floppy", 6}, {"harddisk", 8}, {"iso", 3},
|
||||||
{"nopass", 6}, {"nopassany", 9},
|
{"nopass", 6}, {"nopassany", 9},
|
||||||
{"edd", 3}, {"noedd", 5}
|
{"edd", 3}, {"noedd", 5}
|
||||||
/*
|
/*
|
||||||
{"c", 1}, {"h", 1}, {"s", 1},
|
{"c", 1}, {"h", 1}, {"s", 1},
|
||||||
{"raw", 3}, {"bigraw", 6}, {"int", 3}, {"safeint", 7}
|
{"raw", 3}, {"bigraw", 6}, {"int", 3}, {"safeint", 7}
|
||||||
*/
|
*/
|
||||||
};
|
};
|
||||||
|
@ -679,7 +689,7 @@ BYTE FAR * GetNextMemdiskLine(BYTE FAR *cLine, BYTE *pLine)
|
||||||
BYTE FAR * mf = NULL; /* where last line split by memdisk option */
|
BYTE FAR * mf = NULL; /* where last line split by memdisk option */
|
||||||
BYTE FAR *ptr = cLine; /* start of current cfg line, where { was */
|
BYTE FAR *ptr = cLine; /* start of current cfg line, where { was */
|
||||||
BYTE FAR *sLine = cLine;
|
BYTE FAR *sLine = cLine;
|
||||||
|
|
||||||
/* exit early if already at end of command line */
|
/* exit early if already at end of command line */
|
||||||
if (!*cLine) return cLine;
|
if (!*cLine) return cLine;
|
||||||
|
|
||||||
|
@ -687,11 +697,11 @@ BYTE FAR * GetNextMemdiskLine(BYTE FAR *cLine, BYTE *pLine)
|
||||||
cLine += *cLine;
|
cLine += *cLine;
|
||||||
|
|
||||||
/* restore original character we overwrite with offset, for next iteration of cfg file */
|
/* restore original character we overwrite with offset, for next iteration of cfg file */
|
||||||
*ptr = '{';
|
*ptr = '{';
|
||||||
|
|
||||||
/* ASSERT ptr points to start of line { and cLine points to start of next line { (or eol)*/
|
/* ASSERT ptr points to start of line { and cLine points to start of next line { (or eol)*/
|
||||||
|
|
||||||
/* copy chars to pLine buffer until } or start of next line */
|
/* copy chars to pLine buffer until } or start of next line */
|
||||||
for (++ptr; (*ptr != '}') && (ptr < cLine); ++ptr)
|
for (++ptr; (*ptr != '}') && (ptr < cLine); ++ptr)
|
||||||
{
|
{
|
||||||
/* if not in last {} then simply copy chars up to } (or next {) */
|
/* if not in last {} then simply copy chars up to } (or next {) */
|
||||||
|
@ -704,7 +714,7 @@ BYTE FAR * GetNextMemdiskLine(BYTE FAR *cLine, BYTE *pLine)
|
||||||
for (i = 0; i < 9; ++i)
|
for (i = 0; i < 9; ++i)
|
||||||
{
|
{
|
||||||
/* compare with option */
|
/* compare with option */
|
||||||
if (fmemcmp(ptr, memdiskopts[i].name, memdiskopts[i].size) == 0)
|
if (fmemcmp(ptr, memdiskopts[i].name, memdiskopts[i].size) == 0)
|
||||||
{
|
{
|
||||||
BYTE c = *(ptr + memdiskopts[i].size);
|
BYTE c = *(ptr + memdiskopts[i].size);
|
||||||
/* ensure character after is end of line, =, or whitespace */
|
/* ensure character after is end of line, =, or whitespace */
|
||||||
|
@ -712,10 +722,10 @@ BYTE FAR * GetNextMemdiskLine(BYTE FAR *cLine, BYTE *pLine)
|
||||||
{
|
{
|
||||||
/* flag this line split */
|
/* flag this line split */
|
||||||
mf = ptr;
|
mf = ptr;
|
||||||
|
|
||||||
/* matched option so point past it */
|
/* matched option so point past it */
|
||||||
ptr += memdiskopts[i].size;
|
ptr += memdiskopts[i].size;
|
||||||
|
|
||||||
/* allow extra whitespace between option and = by skipping it */
|
/* allow extra whitespace between option and = by skipping it */
|
||||||
while (iswh(*ptr))
|
while (iswh(*ptr))
|
||||||
++ptr;
|
++ptr;
|
||||||
|
@ -726,22 +736,22 @@ BYTE FAR * GetNextMemdiskLine(BYTE FAR *cLine, BYTE *pLine)
|
||||||
/* allow extra whitespace between = and value by skipping it */
|
/* allow extra whitespace between = and value by skipping it */
|
||||||
while (iswh(*ptr))
|
while (iswh(*ptr))
|
||||||
++ptr;
|
++ptr;
|
||||||
|
|
||||||
/* skip past all characters after = */
|
/* skip past all characters after = */
|
||||||
for (; (*ptr != '}') && (ptr < cLine) && !iswh(*ptr); ++ptr)
|
for (; (*ptr != '}') && (ptr < cLine) && !iswh(*ptr); ++ptr)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
break; /* memdisk option found, no need to keep check rest in list */
|
break; /* memdisk option found, no need to keep check rest in list */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ptr < cLine)
|
if (ptr < cLine)
|
||||||
{
|
{
|
||||||
ws = iswh(*ptr);
|
ws = iswh(*ptr);
|
||||||
|
|
||||||
/* allow replacing X=Y prior to memdisk options with X=Z after */
|
/* allow replacing X=Y prior to memdisk options with X=Z after */
|
||||||
/* on 1st pass if find a match we overwrite it with spaces */
|
/* on 1st pass if find a match we overwrite it with spaces */
|
||||||
if (mf && (*ptr == '='))
|
if (mf && (*ptr == '='))
|
||||||
|
@ -753,19 +763,19 @@ BYTE FAR * GetNextMemdiskLine(BYTE FAR *cLine, BYTE *pLine)
|
||||||
for (; (*old != '=') && (old < mf); ++old)
|
for (; (*old != '=') && (old < mf); ++old)
|
||||||
;
|
;
|
||||||
/* ASSERT ptr points to = after memdisk option and old points to = before memdisk option or mf */
|
/* ASSERT ptr points to = after memdisk option and old points to = before memdisk option or mf */
|
||||||
|
|
||||||
/* compare backwards to see if same option */
|
/* compare backwards to see if same option */
|
||||||
for (new = ptr; (old >= sLine) && ((*old & 0xCD) == (*new & 0xCD)); --old, --new)
|
for (new = ptr; (old >= sLine) && ((*old & 0xCD) == (*new & 0xCD)); --old, --new)
|
||||||
{
|
{
|
||||||
if (iswh(*old) || iswh(*new)) break;
|
if (iswh(*old) || iswh(*new)) break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if match found then overwrite, otherwise skip past the = */
|
/* if match found then overwrite, otherwise skip past the = */
|
||||||
if (((old <= sLine) || iswh(*old)) && iswh(*new))
|
if (((old <= sLine) || iswh(*old)) && iswh(*new))
|
||||||
{
|
{
|
||||||
/* match found so overwrite with spaces */
|
/* match found so overwrite with spaces */
|
||||||
for(++old; !iswh(*old) && (old < mf); ++old)
|
for(++old; !iswh(*old) && (old < mf); ++old)
|
||||||
*old = ' ';
|
*old = ' ';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -774,7 +784,7 @@ BYTE FAR * GetNextMemdiskLine(BYTE FAR *cLine, BYTE *pLine)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
copy_char:
|
copy_char:
|
||||||
*pLine = *ptr;
|
*pLine = *ptr;
|
||||||
++pLine;
|
++pLine;
|
||||||
|
@ -782,7 +792,7 @@ copy_char:
|
||||||
}
|
}
|
||||||
*pLine = 0;
|
*pLine = 0;
|
||||||
|
|
||||||
/* return location to begin next scan from */
|
/* return location to begin next scan from */
|
||||||
return cLine;
|
return cLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -791,10 +801,9 @@ copy_char:
|
||||||
|
|
||||||
VOID DoConfig(int nPass)
|
VOID DoConfig(int nPass)
|
||||||
{
|
{
|
||||||
COUNT nFileDesc;
|
|
||||||
BYTE *pLine;
|
BYTE *pLine;
|
||||||
BOOL bEof = FALSE;
|
BOOL bEof = FALSE;
|
||||||
|
|
||||||
#ifdef MEMDISK_ARGS
|
#ifdef MEMDISK_ARGS
|
||||||
/* check if MEMDISK used for LoL->BootDrive, if so check for special appended arguments */
|
/* check if MEMDISK used for LoL->BootDrive, if so check for special appended arguments */
|
||||||
struct memdiskinfo FAR *mdsk = NULL;
|
struct memdiskinfo FAR *mdsk = NULL;
|
||||||
|
@ -804,7 +813,7 @@ VOID DoConfig(int nPass)
|
||||||
{
|
{
|
||||||
UBYTE drv = (LoL->BootDrive < 3)?0x0:0x80; /* 1=A,2=B,3=C */
|
UBYTE drv = (LoL->BootDrive < 3)?0x0:0x80; /* 1=A,2=B,3=C */
|
||||||
mdsk = query_memdisk(drv);
|
mdsk = query_memdisk(drv);
|
||||||
if (mdsk != NULL)
|
if (mdsk != NULL)
|
||||||
{
|
{
|
||||||
cLine = ProcessMemdiskLine(mdsk->cmdline);
|
cLine = ProcessMemdiskLine(mdsk->cmdline);
|
||||||
}
|
}
|
||||||
|
@ -876,7 +885,7 @@ VOID DoConfig(int nPass)
|
||||||
if (!bEof)
|
if (!bEof)
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* read in a single line, \n or ^Z terminated */
|
/* read in a single line, \n or ^Z terminated */
|
||||||
|
|
||||||
for (pLine = szLine;;)
|
for (pLine = szLine;;)
|
||||||
|
@ -913,6 +922,15 @@ VOID DoConfig(int nPass)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (bEof && nCurChain) {
|
||||||
|
struct CfgFile *cfg = &cfgFile[--nCurChain];
|
||||||
|
close(nFileDesc);
|
||||||
|
bEof = FALSE;
|
||||||
|
nFileDesc = cfg->nFileDesc;
|
||||||
|
nCfgLine = cfg->nCfgLine;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
DebugPrintf(("CONFIG=[%s]\n", szLine));
|
DebugPrintf(("CONFIG=[%s]\n", szLine));
|
||||||
|
|
||||||
/* Skip leading white space and get verb. */
|
/* Skip leading white space and get verb. */
|
||||||
|
@ -928,9 +946,9 @@ VOID DoConfig(int nPass)
|
||||||
/* should config command be executed on this pass? */
|
/* should config command be executed on this pass? */
|
||||||
if (pEntry->pass >= 0 && pEntry->pass != nPass)
|
if (pEntry->pass >= 0 && pEntry->pass != nPass)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* pass 0 always executed (rem Menu prompt switches) */
|
/* pass 0 always executed (rem Menu prompt switches) */
|
||||||
if (nPass == 0)
|
if (nPass == 0)
|
||||||
{
|
{
|
||||||
pEntry->func(pLine);
|
pEntry->func(pLine);
|
||||||
continue;
|
continue;
|
||||||
|
@ -957,7 +975,7 @@ VOID DoConfig(int nPass)
|
||||||
/* YES. DO IT */
|
/* YES. DO IT */
|
||||||
pEntry->func(pLine);
|
pEntry->func(pLine);
|
||||||
}
|
}
|
||||||
close(nFileDesc);
|
close(nFileDesc);
|
||||||
|
|
||||||
if (nPass == 0)
|
if (nPass == 0)
|
||||||
{
|
{
|
||||||
|
@ -974,14 +992,14 @@ STATIC struct table * LookUp(struct table *p, BYTE * token)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
get BIOS key with timeout:
|
get BIOS key with timeout:
|
||||||
|
|
||||||
timeout < 0: no timeout
|
timeout < 0: no timeout
|
||||||
timeout = 0: poll only once
|
timeout = 0: poll only once
|
||||||
timeout > 0: timeout in seconds
|
timeout > 0: timeout in seconds
|
||||||
|
|
||||||
return
|
return
|
||||||
0xffff : no key hit
|
0xffff : no key hit
|
||||||
|
|
||||||
0xHH.. : scancode in upper half
|
0xHH.. : scancode in upper half
|
||||||
0x..LL : asciicode in lower half
|
0x..LL : asciicode in lower half
|
||||||
*/
|
*/
|
||||||
|
@ -1025,6 +1043,7 @@ UWORD GetBiosKey(int timeout)
|
||||||
STATIC BOOL SkipLine(char *pLine)
|
STATIC BOOL SkipLine(char *pLine)
|
||||||
{
|
{
|
||||||
short key;
|
short key;
|
||||||
|
COUNT i;
|
||||||
|
|
||||||
if (InitKernelConfig.SkipConfigSeconds >= 0)
|
if (InitKernelConfig.SkipConfigSeconds >= 0)
|
||||||
{
|
{
|
||||||
|
@ -1033,7 +1052,7 @@ STATIC BOOL SkipLine(char *pLine)
|
||||||
printf("Press F8 to trace or F5 to skip CONFIG.SYS/AUTOEXEC.BAT");
|
printf("Press F8 to trace or F5 to skip CONFIG.SYS/AUTOEXEC.BAT");
|
||||||
|
|
||||||
key = GetBiosKey(InitKernelConfig.SkipConfigSeconds); /* wait 2 seconds */
|
key = GetBiosKey(InitKernelConfig.SkipConfigSeconds); /* wait 2 seconds */
|
||||||
|
|
||||||
InitKernelConfig.SkipConfigSeconds = -1;
|
InitKernelConfig.SkipConfigSeconds = -1;
|
||||||
|
|
||||||
if (key == 0x3f00) /* F5 */
|
if (key == 0x3f00) /* F5 */
|
||||||
|
@ -1067,6 +1086,8 @@ STATIC BOOL SkipLine(char *pLine)
|
||||||
if (!askThisSingleCommand && !singleStep)
|
if (!askThisSingleCommand && !singleStep)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
for (i = 0; i < nCurChain; i++)
|
||||||
|
printf(" ");
|
||||||
printf("%s[Y,N]?", pLine);
|
printf("%s[Y,N]?", pLine);
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
|
@ -1411,7 +1432,7 @@ STATIC VOID Fcbs(BYTE * pLine)
|
||||||
Config.cfgProtFcbs = Config.cfgFcbs;
|
Config.cfgProtFcbs = Config.cfgFcbs;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Keyboard buffer relocation: KEYBUF=start[,end]
|
Keyboard buffer relocation: KEYBUF=start[,end]
|
||||||
Select a new location for the keyboard buffer at 0x40:xx,
|
Select a new location for the keyboard buffer at 0x40:xx,
|
||||||
for example 0x40:0xac-0xff, but 0x50:5-0xff ("basica" only?)
|
for example 0x40:0xac-0xff, but 0x50:5-0xff ("basica" only?)
|
||||||
|
@ -1581,7 +1602,7 @@ err:printf("%s has invalid format\n", filename);
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
fmemcpy((BYTE FAR *)(table[hdr[i].id].p) + 2, subf_data.buffer,
|
fmemcpy((BYTE FAR *)(table[hdr[i].id].p) + 2, subf_data.buffer,
|
||||||
/* skip length ^*/ subf_data.length);
|
/* skip length ^*/ subf_data.length);
|
||||||
}
|
}
|
||||||
|
@ -1619,12 +1640,12 @@ STATIC VOID Country(BYTE * pLine)
|
||||||
GetStringArg(++pLine, szBuf);
|
GetStringArg(++pLine, szBuf);
|
||||||
filename = szBuf;
|
filename = szBuf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LoadCountryInfo(filename, ctryCode, codePage))
|
if (LoadCountryInfo(filename, ctryCode, codePage))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
CfgFailure(pLine);
|
CfgFailure(pLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1752,7 +1773,7 @@ STATIC BOOL LoadDevice(BYTE * pLine, char FAR *top, COUNT mode)
|
||||||
if (base == start)
|
if (base == start)
|
||||||
base++;
|
base++;
|
||||||
base++;
|
base++;
|
||||||
|
|
||||||
/* Get the device driver name */
|
/* Get the device driver name */
|
||||||
GetStringArg(pLine, szBuf);
|
GetStringArg(pLine, szBuf);
|
||||||
|
|
||||||
|
@ -1817,7 +1838,7 @@ STATIC VOID CfgFailure(BYTE * pLine)
|
||||||
{
|
{
|
||||||
if (ErrorAlreadyPrinted[nCfgLine/8] & (1 << (nCfgLine%8)))
|
if (ErrorAlreadyPrinted[nCfgLine/8] & (1 << (nCfgLine%8)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ErrorAlreadyPrinted[nCfgLine/8] |= (1 << (nCfgLine%8));
|
ErrorAlreadyPrinted[nCfgLine/8] |= (1 << (nCfgLine%8));
|
||||||
}
|
}
|
||||||
printf("CONFIG.SYS error in line %d\n", nCfgLine);
|
printf("CONFIG.SYS error in line %d\n", nCfgLine);
|
||||||
|
@ -1827,7 +1848,7 @@ STATIC VOID CfgFailure(BYTE * pLine)
|
||||||
printf("^\n");
|
printf("^\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
struct submcb
|
struct submcb
|
||||||
{
|
{
|
||||||
char type;
|
char type;
|
||||||
unsigned short start;
|
unsigned short start;
|
||||||
|
@ -1960,16 +1981,16 @@ STATIC BYTE * scan(BYTE * s, BYTE * d)
|
||||||
unsigned numbers = 0;
|
unsigned numbers = 0;
|
||||||
for ( ; isnum(*s); s++)
|
for ( ; isnum(*s); s++)
|
||||||
numbers |= 1 << (*s -'0');
|
numbers |= 1 << (*s -'0');
|
||||||
|
|
||||||
if (*s == '?')
|
if (*s == '?')
|
||||||
{
|
{
|
||||||
MenuLine = numbers;
|
MenuLine = numbers;
|
||||||
Menus |= numbers;
|
Menus |= numbers;
|
||||||
s = skipwh(s+1);
|
s = skipwh(s+1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* !dos=high,umb ?? */
|
/* !dos=high,umb ?? */
|
||||||
if (*s == '!')
|
if (*s == '!')
|
||||||
{
|
{
|
||||||
|
@ -2063,7 +2084,7 @@ STATIC char strcaseequal(const char * d, const char * s)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
moved from BLOCKIO.C here.
|
moved from BLOCKIO.C here.
|
||||||
that saves some relocation problems
|
that saves some relocation problems
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC void config_init_buffers(int wantedbuffers)
|
STATIC void config_init_buffers(int wantedbuffers)
|
||||||
|
@ -2143,7 +2164,7 @@ STATIC void config_init_buffers(int wantedbuffers)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Undocumented feature: ANYDOS
|
Undocumented feature: ANYDOS
|
||||||
will report to MSDOS programs just the version number
|
will report to MSDOS programs just the version number
|
||||||
they expect. be careful with it!
|
they expect. be careful with it!
|
||||||
*/
|
*/
|
||||||
|
@ -2171,8 +2192,8 @@ STATIC VOID CfgIgnore(BYTE * pLine)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
'MENU'ing stuff
|
'MENU'ing stuff
|
||||||
although it's worse then MSDOS's , its better then nothing
|
although it's worse then MSDOS's , its better then nothing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC void ClearScreen(unsigned char attr);
|
STATIC void ClearScreen(unsigned char attr);
|
||||||
|
@ -2340,14 +2361,14 @@ STATIC VOID CfgMenuDefault(BYTE * pLine)
|
||||||
COUNT num = 0;
|
COUNT num = 0;
|
||||||
|
|
||||||
pLine = skipwh(pLine);
|
pLine = skipwh(pLine);
|
||||||
|
|
||||||
if ('=' != *pLine)
|
if ('=' != *pLine)
|
||||||
{
|
{
|
||||||
CfgFailure(pLine);
|
CfgFailure(pLine);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pLine = skipwh(pLine + 1);
|
pLine = skipwh(pLine + 1);
|
||||||
|
|
||||||
/* Format: STACKS = stacks [, stackSize] */
|
/* Format: STACKS = stacks [, stackSize] */
|
||||||
pLine = GetNumArg(pLine, &num);
|
pLine = GetNumArg(pLine, &num);
|
||||||
MenuSelected = num;
|
MenuSelected = num;
|
||||||
|
@ -2543,7 +2564,7 @@ STATIC int LoadCountryInfoHardCoded(COUNT ctryCode)
|
||||||
|
|
||||||
|
|
||||||
/* ****************************************************************
|
/* ****************************************************************
|
||||||
** implementation of INSTALL=NANSI.COM /P /X /BLA
|
** implementation of INSTALL=NANSI.COM /P /X /BLA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int numInstallCmds BSS_INIT(0);
|
int numInstallCmds BSS_INIT(0);
|
||||||
|
@ -2563,7 +2584,7 @@ STATIC VOID _CmdInstall(BYTE * pLine,int mode)
|
||||||
struct instCmds *cmd;
|
struct instCmds *cmd;
|
||||||
|
|
||||||
InstallPrintf(("Installcmd %d:%s\n",numInstallCmds,pLine));
|
InstallPrintf(("Installcmd %d:%s\n",numInstallCmds,pLine));
|
||||||
|
|
||||||
if (numInstallCmds > LENGTH(InstallCommands))
|
if (numInstallCmds > LENGTH(InstallCommands))
|
||||||
{
|
{
|
||||||
printf("Too many Install commands given (%d max)\n",LENGTH(InstallCommands));
|
printf("Too many Install commands given (%d max)\n",LENGTH(InstallCommands));
|
||||||
|
@ -2584,15 +2605,35 @@ STATIC VOID CmdInstallHigh(BYTE * pLine)
|
||||||
{
|
{
|
||||||
_CmdInstall(pLine,0x80); /* load high, if possible */
|
_CmdInstall(pLine,0x80); /* load high, if possible */
|
||||||
}
|
}
|
||||||
|
STATIC VOID CmdChain(BYTE * pLine)
|
||||||
|
{
|
||||||
|
struct CfgFile *cfg;
|
||||||
|
int fd;
|
||||||
|
|
||||||
|
InstallPrintf(("CHAIN: %s\n", pLine));
|
||||||
|
if (nCurChain >= MAX_CHAINS) {
|
||||||
|
CfgFailure(pLine);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ((fd = open(pLine, 0)) < 0) {
|
||||||
|
CfgFailure(pLine);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
cfg = &cfgFile[nCurChain++];
|
||||||
|
cfg->nFileDesc = nFileDesc;
|
||||||
|
cfg->nCfgLine = nCfgLine;
|
||||||
|
nFileDesc = fd;
|
||||||
|
nCfgLine = 0;
|
||||||
|
}
|
||||||
|
|
||||||
STATIC VOID InstallExec(struct instCmds *icmd)
|
STATIC VOID InstallExec(struct instCmds *icmd)
|
||||||
{
|
{
|
||||||
BYTE filename[128], *args, *d, *cmd = icmd->buffer;
|
BYTE filename[128], *args, *d, *cmd = icmd->buffer;
|
||||||
exec_blk exb;
|
exec_blk exb;
|
||||||
|
|
||||||
InstallPrintf(("installing %s\n",cmd));
|
InstallPrintf(("installing %s\n",cmd));
|
||||||
|
|
||||||
cmd=skipwh(cmd);
|
cmd=skipwh(cmd);
|
||||||
|
|
||||||
for (args = cmd, d = filename; ;args++,d++)
|
for (args = cmd, d = filename; ;args++,d++)
|
||||||
{
|
{
|
||||||
|
@ -2618,12 +2659,12 @@ STATIC VOID InstallExec(struct instCmds *icmd)
|
||||||
{
|
{
|
||||||
CfgFailure(cmd);
|
CfgFailure(cmd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC void free(seg segment)
|
STATIC void free(seg segment)
|
||||||
{
|
{
|
||||||
iregs r;
|
iregs r;
|
||||||
|
|
||||||
r.a.b.h = 0x49; /* free memory */
|
r.a.b.h = 0x49; /* free memory */
|
||||||
r.es = segment;
|
r.es = segment;
|
||||||
init_call_intr(0x21, &r);
|
init_call_intr(0x21, &r);
|
||||||
|
@ -2642,15 +2683,15 @@ STATIC void set_strategy(unsigned char strat)
|
||||||
VOID DoInstall(void)
|
VOID DoInstall(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
unsigned short installMemory;
|
unsigned short installMemory;
|
||||||
struct instCmds *cmd;
|
struct instCmds *cmd;
|
||||||
|
|
||||||
if (numInstallCmds == 0)
|
if (numInstallCmds == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
InstallPrintf(("Installing commands now\n"));
|
InstallPrintf(("Installing commands now\n"));
|
||||||
|
|
||||||
/* grab memory for this install code
|
/* grab memory for this install code
|
||||||
we KNOW, that we are executing somewhere at top of memory
|
we KNOW, that we are executing somewhere at top of memory
|
||||||
we need to protect the INIT_CODE from other programs
|
we need to protect the INIT_CODE from other programs
|
||||||
that will be executing soon
|
that will be executing soon
|
||||||
|
@ -2673,7 +2714,7 @@ VOID DoInstall(void)
|
||||||
}
|
}
|
||||||
set_strategy(FIRST_FIT);
|
set_strategy(FIRST_FIT);
|
||||||
free(installMemory);
|
free(installMemory);
|
||||||
|
|
||||||
InstallPrintf(("Done with installing commands\n"));
|
InstallPrintf(("Done with installing commands\n"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue