grow on demand heap
[lunaix-os.git] / lunaix-os / kernel / asm / x86 / interrupts.c
index 7ed34273d0e2d6abbae1e19ed54b7531d499d816..925c13de340acb108f72b337d27016afbaa11e98 100644 (file)
@@ -3,14 +3,13 @@
 #include <libc/stdio.h>
 
 void panic (const char* msg, isr_param* param) {
-    tty_set_theme(VGA_COLOR_BLACK, VGA_COLOR_LIGHT_RED);
+    tty_set_theme(VGA_COLOR_WHITE, VGA_COLOR_RED);
     tty_clear_line(10);
     tty_clear_line(11);
     tty_clear_line(12);
     tty_set_cpos(0, 11);
-    printf(" INT %u: [0x%x: 0x%x] %s", param->vector, param->cs, param->eip, msg);
-    __spin:
-        goto __spin;
+    printf(" INT %u: (%x) [0x%x: 0x%x] %s", param->vector, param->err_code, param->cs, param->eip, msg);
+    while(1);
 }
 
 void 
@@ -23,6 +22,9 @@ interrupt_handler(isr_param* param) {
         case FAULT_GENERAL_PROTECTION:
             panic("General Protection", param);
             break;  // never reach
+        case FAULT_PAGE_FAULT:
+            panic("Page Fault", param);
+            break;  // never reach
         default:
             panic("Unknown Interrupt", param);
             break;  // never reach