Implement basic "eoi_jmp_post" code to post step.
authorKevin O'Connor <kevin@koconnor.net>
Sat, 1 Mar 2008 19:02:41 +0000 (14:02 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Sat, 1 Mar 2008 19:02:41 +0000 (14:02 -0500)
src/biosvar.h
src/post.c

index 0dd603b9279f504e4207a1a3336304a8288a8aa6..a5afe54ed852a19c2ded77267502acce1c4371d3 100644 (file)
@@ -52,8 +52,11 @@ struct bios_data_area_s {
     u8 floppy_return_status[7];
     u8 other1[0x7];
     // 40:50
-    u8 other2[0x1c];
-    // 40:6c
+    u8 other2[0x10];
+    // 40:60
+    u8 other3[0x7];
+    u32 jump_cs_ip;
+    u8 dummy;
     u32 timer_counter;
     // 40:70
     u8 timer_rollover;
index ce7c9fbf464077c8384e69304d1589fddf815c9b..e566e83bb31e8ed97f726b5a8ff1cdb3d606d5cc 100644 (file)
@@ -548,6 +548,19 @@ init_dma()
     outb(0x00, PORT_DMA2_MASK_REG);
 }
 
+static void
+eoi_jmp_post()
+{
+    // XXX - this is supposed to jump without changing any memory -
+    // but the stack has been altered by the time the code gets here.
+    eoi_both_pics();
+    struct bregs br;
+    memset(&br, 0, sizeof(br));
+    br.cs = bda->jump_cs_ip >> 16;
+    br.ip = bda->jump_cs_ip;
+    call16(&br);
+}
+
 static void
 check_restart_status()
 {
@@ -559,11 +572,8 @@ check_restart_status()
         // Normal post
         return;
 
-    // XXX
-#if 0
     if (status == 0x05)
         eoi_jmp_post();
-#endif
 
     BX_PANIC("Unimplemented shutdown status: %02x\n",(Bit8u)status);
 }