Init HaltCpuWhileIdle to 0 before installing int handlers.

Removed HaltCpuWhileIdle handling from GetBiosKey because it is
only used *before* IDLEHALT is processed anyway - in the config
sys menu *and* in CheckContinueBootFromHarddisk. Adding s.th.
like "switches /i" would be a way to enable it a bit earlier.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1346 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
Eric Auer 2007-08-17 19:33:24 +00:00
parent ab53a50c49
commit f7320f6452
2 changed files with 7 additions and 4 deletions

View File

@ -615,7 +615,8 @@ VOID DoConfig(int nPass)
COUNT nFileDesc;
BYTE *pLine;
BOOL bEof;
if (nPass==0)
HaltCpuWhileIdle = 0; /* init to "no HLT while idle" */
/* Check to see if we have a config.sys file. If not, just */
/* exit since we don't force the user to have one. */
@ -758,16 +759,17 @@ UWORD GetBiosKey(int timeout)
{
r.a.x = 0x0100; /* are there keys available ? */
init_call_intr(0x16, &r);
if (!(r.flags & FLG_ZERO))
if (!(r.flags & FLG_ZERO)) {
r.a.x = 0x0000;
init_call_intr(0x16, &r); /* there is a key, so better fetch it! */
return r.a.x;
if (HaltCpuWhileIdle!=0) DosIdle_hlt(); /* not _int */
}
} while ((unsigned)(GetBiosTime() - startTime) < timeout * 18u);
return 0xffff;
}
/* blocking wait (timeout < 0): fetch it */
do {
if (HaltCpuWhileIdle!=0) DosIdle_hlt(); /* not _int */
r.a.x = 0x0100;
init_call_intr(0x16, &r);
} while (r.flags & FLG_ZERO);

View File

@ -259,6 +259,7 @@ STATIC void setup_int_vectors(void)
plvec->isv = getvec(plvec->intno);
for (i = 0x23; i <= 0x3f; i++)
setvec(i, empty_handler);
HaltCpuWhileIdle = 0;
for (pvec = vectors; pvec < vectors + (sizeof vectors/sizeof *pvec); pvec++)
setvec(pvec->intno, (intvec)MK_FP(FP_SEG(empty_handler), pvec->handleroff));
pokeb(0, 0x30 * 4, 0xea);