diff options
author | dzwdz | 2021-09-12 16:42:59 +0200 |
---|---|---|
committer | dzwdz | 2021-09-12 16:42:59 +0200 |
commit | 98f36a825da9a186d2f0ba399b0830eff9c8d258 (patch) | |
tree | 6bde6b8a214acc842b77369c915d3b2da6e5d65f | |
parent | e5499c8dcbb29c405e551d39856b48b6aa3e91af (diff) |
log cr2 on page faults
-rw-r--r-- | src/kernel/arch/i386/interrupts/isr.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/kernel/arch/i386/interrupts/isr.c b/src/kernel/arch/i386/interrupts/isr.c index 96d053e..86f697f 100644 --- a/src/kernel/arch/i386/interrupts/isr.c +++ b/src/kernel/arch/i386/interrupts/isr.c @@ -12,7 +12,13 @@ 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: log_n_panic("#PF"); // page fault + case 0x0E: { // page fault + int cr2; + tty_const("#PF at "); + asm ("mov %%cr2, %0;" : "=r"(cr2) ::); + _tty_var(cr2); + panic(); + } case 0x34: isr_test_interrupt_called = true; |