X-Git-Url: http://git.dujemihanovic.xyz/%7B%7B?a=blobdiff_plain;f=kernel%2Farch%2Fx86%2Firq%2Fsample_handler.c;h=5b0e2d470217a767c0b02ddc295d4586e7e6fb84;hb=17c25e48e72b5578fe7cdc916fd1b6f26a6df3cd;hp=0ba022287400813058340d07504939dcc347e508;hpb=e8c050c11b7f05ec562888d6a8129ab841d163fb;p=nameless-os.git diff --git a/kernel/arch/x86/irq/sample_handler.c b/kernel/arch/x86/irq/sample_handler.c index 0ba0222..5b0e2d4 100644 --- a/kernel/arch/x86/irq/sample_handler.c +++ b/kernel/arch/x86/irq/sample_handler.c @@ -3,6 +3,7 @@ #include #include #include +#include typedef uint32_t uword_t; @@ -36,7 +37,7 @@ void pf_handler(struct fault_frame *frame) int address; struct pf_errcode errcode = frame->error_code; asm ("mov %%cr2, %0": "=a" (address)); - kprint("A page fault occurred!\n", VGA_COLOR_DARK_RED); + kprint("A page fault occurred!\n", VGA_COLOR_BRIGHT_RED); kprint("Faulting address: ", 0); kprintd(address); kprint("\n", 0); @@ -51,18 +52,12 @@ void pf_handler(struct fault_frame *frame) if (errcode.id) { kprint("Fault occurred while fetching instruction\n", 0); } - asm("cli"); -halt: - asm("hlt"); - goto halt; + PANIC("page fault"); } __attribute__((interrupt)) void double_fault(struct abort_frame *frame) { - *(volatile uint32_t *) (0xb8000) = 0xcf28cf3a; -halt: - asm volatile ("cli; hlt"); - goto halt; + PANIC("double fault"); }