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