diff options
Diffstat (limited to 'src/kernel/arch/amd64/interrupts')
-rw-r--r-- | src/kernel/arch/amd64/interrupts/isr.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/kernel/arch/amd64/interrupts/isr.c b/src/kernel/arch/amd64/interrupts/isr.c index b55bc8b..4df8e57 100644 --- a/src/kernel/arch/amd64/interrupts/isr.c +++ b/src/kernel/arch/amd64/interrupts/isr.c @@ -14,17 +14,17 @@ bool isr_test_interrupt_called = false; void isr_stage3(int interrupt, uint64_t *stackframe) { if (interrupt == 0xe) stackframe++; kprintf("interrupt %x, rip = k/%08x, cs 0x%x\n", interrupt, stackframe[0], stackframe[1]); + if (interrupt == 0xe) { + uint64_t addr = 0x69; + asm("mov %%cr2, %0" : "=r"(addr)); + kprintf("error code 0x%x, addr 0x%x\n", stackframe[-1], addr); + } + switch (interrupt) { case 0x08: // double fault kprintf("#DF"); panic_invalid_state(); - case 0xe: - uint64_t addr = 0x69; - asm("mov %%cr2, %0" : "=r"(addr)); - kprintf("error code 0x%x, addr 0x%x\n", stackframe[-1], addr); - panic_unimplemented(); - case 0x34: asm("nop" ::: "memory"); isr_test_interrupt_called = true; @@ -41,8 +41,12 @@ void isr_stage3(int interrupt, uint64_t *stackframe) { return; default: - // TODO check if the exception was in the kernel - process_kill(process_current, interrupt); - process_switch_any(); + if (stackframe[1] & 0x3 == 0) { + kprintf("bye o7\n"); + cpu_halt(); + } else { + process_kill(process_current, interrupt); + process_switch_any(); + } } } |