when updating MCB to add UMB chain, redetermine top of memory again in case changed (e.g. device driver relocated EBDA) to avoid corrupt MCB chain. Revert checking for switches only on pass==0, causes error due to portion of command line not skipped when reevaluated on next pass. Allow undocumented -1 for /E: switches option for use calculated EBDA size when moving.

This commit is contained in:
KJD 2013-07-17 22:58:44 -04:00
parent 087a0fee4e
commit 4b08676a48
1 changed files with 3 additions and 2 deletions

View File

@ -530,6 +530,8 @@ STATIC void umb_init(void)
UmbState = 1;
/* reset root */
/* Note: since device drivers can change what is considered top of memory (e.g. move XBDA) we must requery */
ram_top = init_oem();
LoL->uppermem_root = ram_top * 64 - 1;
/* create link mcb (below) */
@ -1351,12 +1353,11 @@ STATIC VOID CfgSwitches(BYTE * pLine)
InitKernelConfig.SkipConfigSeconds = 0;
break;
case 'E': /* /E[[:]nnnn] Set the desired EBDA amount to move in bytes */
if (commands[0].pass == 0)
{ /* Note that if there is no EBDA, this will have no effect */
int n = 0;
if (*++pLine == ':')
pLine++; /* skip optional separator */
if (!isnum(*pLine))
if (!(isnum(*pLine) || (*pLine == '-')))
{
pLine--;
break;