From f7320f64522622fd3a62ba81d0c970296cfec6d6 Mon Sep 17 00:00:00 2001 From: Eric Auer Date: Fri, 17 Aug 2007 19:33:24 +0000 Subject: [PATCH] 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 --- kernel/config.c | 10 ++++++---- kernel/main.c | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/kernel/config.c b/kernel/config.c index 19bc6ff..9d76d5e 100644 --- a/kernel/config.c +++ b/kernel/config.c @@ -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); diff --git a/kernel/main.c b/kernel/main.c index 8364d74..07b3b70 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -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);