mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-28 15:34:33 +00:00
Add more page fault details
This commit is contained in:
parent
1c723e9710
commit
0270192eec
@ -417,10 +417,23 @@ nsa void DisplayDetailsScreen(CPU::ExceptionFrame *Frame)
|
|||||||
case CPU::x86::PageFault:
|
case CPU::x86::PageFault:
|
||||||
{
|
{
|
||||||
CPU::x64::PageFaultErrorCode pfCode = {.raw = (uint32_t)Frame->ErrorCode};
|
CPU::x64::PageFaultErrorCode pfCode = {.raw = (uint32_t)Frame->ErrorCode};
|
||||||
ExPrint("P:%d W:%d U:%d R:%d I:%d PK:%d SS:%d SGX:%d\n",
|
ExPrint("PFEC: P:%d W:%d U:%d R:%d I:%d PK:%d SS:%d SGX:%d\n",
|
||||||
pfCode.P, pfCode.W, pfCode.U, pfCode.R,
|
pfCode.P, pfCode.W, pfCode.U, pfCode.R,
|
||||||
pfCode.I, pfCode.PK, pfCode.SS, pfCode.SGX);
|
pfCode.I, pfCode.PK, pfCode.SS, pfCode.SGX);
|
||||||
|
|
||||||
|
{
|
||||||
|
Memory::Virtual vmm((Memory::PageTable *)Frame->cr3);
|
||||||
|
if (vmm.GetMapType((void *)Frame->cr2) != Memory::Virtual::FourKiB)
|
||||||
|
ExPrint("Can't display page at address %#lx\n", Frame->cr2);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Memory::PageTableEntry *pte = vmm.GetPTE((void *)Frame->cr2);
|
||||||
|
ExPrint("Page %#lx: P:%d W:%d U:%d G:%d NX:%d\n",
|
||||||
|
ALIGN_DOWN(Frame->cr2, 0x1000), pte->Present, pte->ReadWrite,
|
||||||
|
pte->UserSupervisor, pte->Global, pte->ExecuteDisable);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ExPrint("%s", x86PageFaultDescriptions[Frame->ErrorCode & 0b111]);
|
ExPrint("%s", x86PageFaultDescriptions[Frame->ErrorCode & 0b111]);
|
||||||
if (Frame->ErrorCode & 0x8)
|
if (Frame->ErrorCode & 0x8)
|
||||||
ExPrint("%s", x86PageFaultDescriptions[8]);
|
ExPrint("%s", x86PageFaultDescriptions[8]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user