diff options
author | dzwdz | 2021-10-09 11:53:38 +0000 |
---|---|---|
committer | dzwdz | 2021-10-09 11:53:38 +0000 |
commit | d9463f6e977ce686ac7a55f22b0b25b0ce67b025 (patch) | |
tree | 768fbb673945dba63dc8c5e02f8a4238da4148d7 /src/kernel/arch/i386/interrupts/isr.c | |
parent | faed927869451cf4070abba91b5a9cf9e32c9a6c (diff) | |
parent | acf41ff6fee44dd24f9383d96fecd992dcb072e2 (diff) |
Merge branch 'main' of github.com:dzwdz/camellia
Diffstat (limited to 'src/kernel/arch/i386/interrupts/isr.c')
-rw-r--r-- | src/kernel/arch/i386/interrupts/isr.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/kernel/arch/i386/interrupts/isr.c b/src/kernel/arch/i386/interrupts/isr.c index dacecba..9d8bb6c 100644 --- a/src/kernel/arch/i386/interrupts/isr.c +++ b/src/kernel/arch/i386/interrupts/isr.c @@ -1,29 +1,24 @@ #include <kernel/arch/i386/interrupts/isr.h> #include <kernel/arch/io.h> #include <kernel/panic.h> +#include <kernel/proc.h> #include <stdbool.h> #include <stdint.h> -#define log_n_panic(x) {tty_const(x); panic_unimplemented();} // TODO kill the current process instead of panicking - bool isr_test_interrupt_called = false; void isr_stage3(int interrupt) { switch (interrupt) { - case 0x08: log_n_panic("#DF"); // double fault - case 0x0D: log_n_panic("#GP"); // general protection fault - case 0x0E: { // page fault - int cr2; - tty_const("#PF at "); - asm ("mov %%cr2, %0;" : "=r"(cr2) ::); - _tty_var(cr2); - panic_unimplemented(); - } - + case 0x08: // double fault + tty_const("#DF"); + panic_invalid_state(); case 0x34: isr_test_interrupt_called = true; return; - default: log_n_panic("unknown interrupt"); + default: + // TODO check if the exception was in the kernel + process_kill(process_current, interrupt); + process_switch_any(); } } |