Refactor memory allocation implementation and add KernelReserve flag to memory mappings

This commit is contained in:
EnderIce2
2024-03-19 03:57:30 +02:00
parent 1bd58a309f
commit b35045e7ca
9 changed files with 610 additions and 562 deletions

View File

@ -424,13 +424,14 @@ nsa void DisplayDetailsScreen(CPU::ExceptionFrame *Frame)
{
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);
ExPrint("Can't display page %#lx\n", Frame->cr2);
else
{
Memory::PageTableEntry *pte = vmm.GetPTE((void *)Frame->cr2);
ExPrint("Page %#lx: P:%d W:%d U:%d G:%d CoW:%d NX:%d\n",
ExPrint("Page %#lx: P:%d W:%d U:%d G:%d CoW:%d KRsv:%d NX:%d\n",
ALIGN_DOWN(Frame->cr2, 0x1000), pte->Present, pte->ReadWrite,
pte->UserSupervisor, pte->Global, pte->CopyOnWrite, pte->ExecuteDisable);
pte->UserSupervisor, pte->Global, pte->CopyOnWrite,
pte->KernelReserve, pte->ExecuteDisable);
}
}