Allow ctrl+alt+delete to work when no boot device found.
authorKevin O'Connor <kevin@koconnor.net>
Sun, 15 Feb 2009 18:45:48 +0000 (13:45 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Sun, 15 Feb 2009 18:45:48 +0000 (13:45 -0500)
Don't panic (that turns off irqs), instead spin with irqs enabled.

src/boot.c
src/util.c
src/util.h

index 80e74ca4aa5c6898b70ae911b50999393e7abbbe..404b043cd189ef6313988494f0e495720b5037dd 100644 (file)
@@ -363,8 +363,12 @@ do_boot(u16 seq_nr)
     bootdev >>= 4 * seq_nr;
     bootdev &= 0xf;
 
-    if (bootdev == 0)
-        panic("No bootable device.\n");
+    if (bootdev == 0) {
+        printf("No bootable device.\n");
+        // Loop with irqs enabled - this allows ctrl+alt+delete to work.
+        for (;;)
+            usleep(1000000);
+    }
 
     /* Translate bootdev to an IPL table offset by subtracting 1 */
     bootdev -= 1;
index 7eec39d846594d009613b20acb4446473e4390bd..2c543a4220abad3d2db87a9476e8729cd78b0fe8 100644 (file)
@@ -178,7 +178,7 @@ strtcpy(char *dest, const char *src, size_t len)
 }
 
 // Wait for 'usec' microseconds with irqs enabled.
-static void
+void
 usleep(u32 usec)
 {
     struct bregs br;
index 82560fc3cae9c344db9f28bcffbbd173d4c75041..0c90f498529560f31187c4d1100ad837b22f9c21 100644 (file)
@@ -84,6 +84,7 @@ inline void __call16_int(struct bregs *callregs, u16 offset);
         __call16_int((callregs), (u32)&irq_trampoline_ ##nr );  \
     } while (0)
 inline void call16_simpint(int nr, u32 *eax, u32 *flags);
+void usleep(u32 usec);
 int get_keystroke(int msec);
 
 // output.c