Permalink
Browse files

when updating MCB to add UMB chain, redetermine top of memory again i…

…n 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.
  • Loading branch information...
1 parent 087a0fe commit 4b08676a48c2d0127298013c4f2a42115b3eeee6 @PerditionC committed Jul 18, 2013
Showing with 3 additions and 2 deletions.
  1. +3 −2 kernel/config.c
View
@@ -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;

0 comments on commit 4b08676

Please sign in to comment.