summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordzwdz2021-09-12 16:42:59 +0200
committerdzwdz2021-09-12 16:42:59 +0200
commit98f36a825da9a186d2f0ba399b0830eff9c8d258 (patch)
tree6bde6b8a214acc842b77369c915d3b2da6e5d65f
parente5499c8dcbb29c405e551d39856b48b6aa3e91af (diff)
log cr2 on page faults
-rw-r--r--src/kernel/arch/i386/interrupts/isr.c8
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;