Fix booting logic on failure.
authorKevin O'Connor <kevin@koconnor.net>
Sun, 9 Mar 2008 17:46:13 +0000 (13:46 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Sun, 9 Mar 2008 17:46:13 +0000 (13:46 -0400)
Make sure we properly try next device on failures.

src/boot.c

index 76a501fbdee4aaae03843072357886261393bef4..b1fa050f86d4efb2f5afc6b7ab549a35f14bf511 100644 (file)
@@ -174,10 +174,17 @@ try_boot(u16 seq_nr)
     cr.dl = bootdrv;
     cr.ax = 0xaa55;
     call16(&cr);
+}
+
+static void
+do_boot(u16 seq_nr)
+{
+    try_boot(seq_nr);
 
     // Boot failed: invoke the boot recovery function
-    memset(&cr, 0, sizeof(cr));
-    call16_int(0x18, &cr);
+    struct bregs br;
+    memset(&br, 0, sizeof(br));
+    call16_int(0x18, &br);
 }
 
 // Boot Failure recovery: try the next device.
@@ -186,7 +193,7 @@ handle_18()
 {
     debug_enter(NULL);
     u16 seq = GET_IPL(sequence) + 1;
-    try_boot(seq);
+    do_boot(seq);
 }
 
 // INT 19h Boot Load Service Entry Point
@@ -194,7 +201,7 @@ void VISIBLE16
 handle_19()
 {
     debug_enter(NULL);
-    try_boot(0);
+    do_boot(0);
 }
 
 // Called from 32bit code - start boot process