1
0
Fork 0
mirror of https://github.com/tailix/kernel.git synced 2024-10-30 12:03:52 -04:00

Display exception information and hang

This commit is contained in:
Braiden Vasco 2017-11-05 16:19:46 +00:00
parent ce8a1f9f65
commit f8ab00c358

View file

@ -3,38 +3,38 @@
#include "logger.h" #include "logger.h"
static const char *const messages[] = { static const char *const messages[] = {
"Unhandled protected-mode exception: 0x0", "0 #DE - Divide Error Exception",
"Unhandled protected-mode exception: 0x1", "1 #DB - Debug Exception",
"Unhandled protected-mode exception: 0x2", "2 NMI - Non-maskable interrupt",
"Unhandled protected-mode exception: 0x3", "3 #BP - Breakpoint Exception",
"Unhandled protected-mode exception: 0x4", "4 #OF - Overflow Exception",
"Unhandled protected-mode exception: 0x5", "5 #BR - BOUND Range Exceeded Exception",
"Unhandled protected-mode exception: 0x6", "6 #UD - Invalid Opcode Exception",
"Unhandled protected-mode exception: 0x7", "7 #NM - Device Not Available Exception",
"Unhandled protected-mode exception: 0x8", "8 #DF - Double Fault Exception",
"Unhandled protected-mode exception: 0x9", "9 Reserved - Coprocessor Segment Overrun",
"Unhandled protected-mode exception: 0xA", "10 #TS - Invalid TSS Exception",
"Unhandled protected-mode exception: 0xB", "11 #NP - Segment Not Present",
"Unhandled protected-mode exception: 0xC", "12 #SS - Stack Fault Exception",
"Unhandled protected-mode exception: 0xD", "13 #GP - General Protection Exception",
"Unhandled protected-mode exception: 0xE", "14 #PF - Page-Fault Exception",
"Unhandled protected-mode exception: 0xF", "15 Reserved",
"Unhandled protected-mode exception: 0x10", "16 #MF - x87 FPU Floating-Point Error",
"Unhandled protected-mode exception: 0x11", "17 #AC - Alignment Check Exception",
"Unhandled protected-mode exception: 0x12", "18 #MC - Machine-Check Exception",
"Unhandled protected-mode exception: 0x13", "19 #XF - SIMD Floating-Point Exception",
"Unhandled protected-mode exception: 0x14", "20 Reserved",
"Unhandled protected-mode exception: 0x15", "21 Reserved",
"Unhandled protected-mode exception: 0x16", "22 Reserved",
"Unhandled protected-mode exception: 0x17", "23 Reserved",
"Unhandled protected-mode exception: 0x18", "24 Reserved",
"Unhandled protected-mode exception: 0x19", "25 Reserved",
"Unhandled protected-mode exception: 0x1A", "26 Reserved",
"Unhandled protected-mode exception: 0x1B", "27 Reserved",
"Unhandled protected-mode exception: 0x1C", "28 Reserved",
"Unhandled protected-mode exception: 0x1D", "29 Reserved",
"Unhandled protected-mode exception: 0x1E", "30 Reserved",
"Unhandled protected-mode exception: 0x1F", "31 Reserved"
}; };
void exception_handler(struct IsrRegisters regs) void exception_handler(struct IsrRegisters regs)
@ -46,5 +46,9 @@ void exception_handler(struct IsrRegisters regs)
return; return;
} }
logger_warn(messages[regs.int_no]); logger_fail("Unhandled protected-mode exception:");
logger_fail(messages[regs.int_no]);
asm volatile("cli");
while (1) {}
} }