rombios: pause for a keypress after a failed boot
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 6 Jul 2010 15:49:59 +0000 (16:49 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 6 Jul 2010 15:49:59 +0000 (16:49 +0100)
rombios: inform the user and pause for a keypress after a failed boot
rather than powering off immediately.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
tools/firmware/rombios/rombios.c

index 26a952f649f24e92a9554b29b32d9c56aa9143bf..1c05d99e75567f843c7ffa16ddf44877fa1c8fcd 100644 (file)
@@ -8243,7 +8243,27 @@ Bit16u seq_nr;
     write_word(ebda_seg, IPL_BOOTFIRST_OFFSET, 0xFFFF);
     /* Reset boot sequence */
     write_word(ebda_seg, IPL_SEQUENCE_OFFSET, 0xFFFF);
-  } else if (bootdev == 0) BX_PANIC("No bootable device.\n");
+  } else if (bootdev == 0) {
+    printf("\nNo bootable device.\n");
+    printf("Reboot or press any key to retry.");
+    write_word(ebda_seg, IPL_SEQUENCE_OFFSET, 0xFFFF);
+ASM_START
+    sti
+ASM_END
+    {
+      Bit8u sc, ac;
+      while(!dequeue_key(&sc, &ac, 1)) {
+ASM_START
+        hlt
+ASM_END
+      }
+    }
+ASM_START
+    cli
+ASM_END
+    printf("\n\n");
+    return;
+  }
 
   /* Translate from CMOS runes to an IPL table offset by subtracting 1 */
   bootdev -= 1;