update comments, swap order to ensure ram_top adjusted by actual size of ebda moved, not just calculated size

This commit is contained in:
KJD 2013-07-14 19:35:54 -04:00
parent 806ea112d4
commit 087a0fee4e

View File

@ -251,8 +251,8 @@ struct table {
}; };
STATIC struct table commands[] = { STATIC struct table commands[] = {
/* first = switches! this one is special since it is asked for but /* first = switches! this one is special; some options will
also checked before F5/F8 */ always be ran, others depends on F5/F8 and ? processing */
{"SWITCHES", 0, CfgSwitches}, {"SWITCHES", 0, CfgSwitches},
/* rem is never executed by locking out pass */ /* rem is never executed by locking out pass */
@ -388,9 +388,9 @@ void PreConfig2(void)
if (Config.ebda2move) if (Config.ebda2move)
{ {
ebda_size = ebdasize(); ebda_size = ebdasize();
ram_top += ebda_size / 1024;
if (ebda_size > Config.ebda2move) if (ebda_size > Config.ebda2move)
ebda_size = Config.ebda2move; ebda_size = Config.ebda2move;
ram_top += ebda_size / 1024;
} }
/* We expect ram_top as Kbytes, so convert to paragraphs */ /* We expect ram_top as Kbytes, so convert to paragraphs */
@ -404,8 +404,8 @@ void PreConfig2(void)
if (ebda_size) /* move the Extended BIOS Data Area from top of RAM here */ if (ebda_size) /* move the Extended BIOS Data Area from top of RAM here */
movebda(ebda_size, FP_SEG(KernelAlloc(ebda_size, 'I', 0))); movebda(ebda_size, FP_SEG(KernelAlloc(ebda_size, 'I', 0)));
if (UmbState == 2) // if (UmbState == 2)
umb_init(); // umb_init();
} }
/* Do third pass initialization. */ /* Do third pass initialization. */
@ -923,17 +923,19 @@ VOID DoConfig(int nPass)
pEntry = LookUp(commands, szBuf); pEntry = LookUp(commands, szBuf);
/* should config command be executed on this pass? */
if (pEntry->pass >= 0 && pEntry->pass != nPass) if (pEntry->pass >= 0 && pEntry->pass != nPass)
continue; continue;
if (nPass == 0) /* pass 0 always executed (rem Menu prompt switches) */ /* pass 0 always executed (rem Menu prompt switches) */
if (nPass == 0)
{ {
pEntry->func(pLine); pEntry->func(pLine);
continue; continue;
} }
else else
{ {
if (SkipLine(pLineStart)) /* F5/F8 processing */ if (SkipLine(pLineStart)) /* F5/F8/?/! processing */
continue; continue;
} }
@ -1349,6 +1351,7 @@ STATIC VOID CfgSwitches(BYTE * pLine)
InitKernelConfig.SkipConfigSeconds = 0; InitKernelConfig.SkipConfigSeconds = 0;
break; break;
case 'E': /* /E[[:]nnnn] Set the desired EBDA amount to move in bytes */ 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 */ { /* Note that if there is no EBDA, this will have no effect */
int n = 0; int n = 0;
if (*++pLine == ':') if (*++pLine == ':')
@ -1818,6 +1821,7 @@ void FAR * KernelAllocPara(size_t nPara, char type, char *name, int mode)
seg base, start; seg base, start;
struct submcb FAR *p; struct submcb FAR *p;
/* if no umb available force low allocation */
if (UmbState != 1) if (UmbState != 1)
mode = 0; mode = 0;