From c22a4301ed0341477295d7ae481b1223d2428eaa Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 25 Dec 2019 11:34:07 +0100 Subject: [PATCH] Kernel: Interpret "reserved bit violation" page faults correctly We don't actually react to these in any meaningful way other than crashing, but let's at least print the correct information. :^) --- Kernel/Arch/i386/CPU.cpp | 3 ++- Kernel/Arch/i386/CPU.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Kernel/Arch/i386/CPU.cpp b/Kernel/Arch/i386/CPU.cpp index 8d7daee5d7..1d713b584d 100644 --- a/Kernel/Arch/i386/CPU.cpp +++ b/Kernel/Arch/i386/CPU.cpp @@ -279,10 +279,11 @@ void page_fault_handler(RegisterDump regs) return; } - kprintf("\033[31;1m%s(%u:%u) Unrecoverable page fault, %s%s address %p\033[0m\n", + kprintf("\033[31;1m%s(%u:%u) Unrecoverable page fault, %s%s%s address %p\033[0m\n", current->process().name().characters(), current->pid(), current->tid(), + regs.exception_code & PageFaultFlags::ReservedBitViolation ? "reserved bit violation / " : "", regs.exception_code & PageFaultFlags::InstructionFetch ? "instruction fetch / " : "", regs.exception_code & PageFaultFlags::Write ? "write to" : "read from", fault_address); diff --git a/Kernel/Arch/i386/CPU.h b/Kernel/Arch/i386/CPU.h index 0f592e9037..d946a783f0 100644 --- a/Kernel/Arch/i386/CPU.h +++ b/Kernel/Arch/i386/CPU.h @@ -348,7 +348,8 @@ struct PageFaultFlags { Write = 0x02, UserMode = 0x04, SupervisorMode = 0x00, - InstructionFetch = 0x08, + ReservedBitViolation = 0x08, + InstructionFetch = 0x10, }; };