aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author开恒 <kaihuan.pkh@alibaba-inc.com>2019-07-12 17:26:52 +0800
committerPaolo Bonzini <bonzini@gnu.org>2019-07-12 15:57:36 +0200
commitab6d7ee29d95ecee28190644f8d001b08d480b34 (patch)
treeb14b2fab499b5312669081a8c65048d1919de408
parent295dd902155035151caae3e4db3f41c8deebba34 (diff)
downloadqboot-ab6d7ee29d95ecee28190644f8d001b08d480b34.zip
qboot-ab6d7ee29d95ecee28190644f8d001b08d480b34.tar.gz
qboot-ab6d7ee29d95ecee28190644f8d001b08d480b34.tar.bz2
bug fix for setup_idt
the setup_idt() has not configured default ISR for all interrupt. CPU lookup IVT and set 0x0:0x0 (cs:ip) as interrupt handler entry when received an unexpected interrupt which not setup ISR via set_realmode_int in setup_idt(). howerver, the 0x0:0x0 point to IVT-self and executing it caused invalid opcode exception, which the interrupt vector is 6, and the handler bios_intfake not fixing this problem, this makes CPU run into a infinite loop.
-rw-r--r--main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main.c b/main.c
index 699cc1a..8ac2a68 100644
--- a/main.c
+++ b/main.c
@@ -19,7 +19,7 @@ static void set_realmode_int(int vec, void *p)
static void setup_idt(void)
{
int i;
- for (i = 0; i < 0x1f; i++)
+ for (i = 0; i < 0x100; i++)
set_realmode_int(i, bios_intfake);
for (i = 8; i < 16; i++)
set_realmode_int(i, bios_irq);