mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-28 15:34:33 +00:00
oopsie
This commit is contained in:
parent
a32ca16d2b
commit
7bff9f260e
@ -198,9 +198,9 @@ __no_instrument_function void InitializeMemoryManagement(BootInfo *Info)
|
|||||||
trace("Applying new page table from address %p", KernelPageTable);
|
trace("Applying new page table from address %p", KernelPageTable);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
debug("Kernel:");
|
debug("Kernel:");
|
||||||
tracepagetable(KernelPageTable);
|
// tracepagetable(KernelPageTable);
|
||||||
debug("Userspace:");
|
debug("Userspace:");
|
||||||
tracepagetable(UserspaceKernelOnlyPageTable);
|
// tracepagetable(UserspaceKernelOnlyPageTable);
|
||||||
#endif
|
#endif
|
||||||
#if defined(__amd64__) || defined(__i386__)
|
#if defined(__amd64__) || defined(__i386__)
|
||||||
asmv("mov %0, %%cr3" ::"r"(KernelPageTable));
|
asmv("mov %0, %%cr3" ::"r"(KernelPageTable));
|
||||||
|
@ -50,9 +50,9 @@ namespace Memory
|
|||||||
}
|
}
|
||||||
|
|
||||||
PageMapIndexer Index = PageMapIndexer((uint64_t)VirtualAddress);
|
PageMapIndexer Index = PageMapIndexer((uint64_t)VirtualAddress);
|
||||||
|
|
||||||
PageMapLevel4 PML4 = this->Table->Entries[Index.PMLIndex];
|
PageMapLevel4 PML4 = this->Table->Entries[Index.PMLIndex];
|
||||||
PageDirectoryPointerTableEntryPtr *PDPTEPtr = nullptr;
|
PageDirectoryPointerTableEntryPtr *PDPTEPtr = nullptr;
|
||||||
|
|
||||||
if (!PML4.Present)
|
if (!PML4.Present)
|
||||||
{
|
{
|
||||||
PDPTEPtr = (PageDirectoryPointerTableEntryPtr *)KernelAllocator.RequestPage();
|
PDPTEPtr = (PageDirectoryPointerTableEntryPtr *)KernelAllocator.RequestPage();
|
||||||
@ -128,8 +128,8 @@ namespace Memory
|
|||||||
|
|
||||||
if (!this->Check(VirtualAddress, (PTFlag)Flags)) // quick workaround just to see where it fails
|
if (!this->Check(VirtualAddress, (PTFlag)Flags)) // quick workaround just to see where it fails
|
||||||
{
|
{
|
||||||
this->Check(VirtualAddress, (PTFlag)Flags);
|
// this->Check(VirtualAddress, (PTFlag)Flags);
|
||||||
warn("Failed to map %#lx - %#lx with flags: " BYTE_TO_BINARY_PATTERN, VirtualAddress, PhysicalAddress, BYTE_TO_BINARY(Flags));
|
// warn("Failed to map %#lx - %#lx with flags: " BYTE_TO_BINARY_PATTERN, VirtualAddress, PhysicalAddress, BYTE_TO_BINARY(Flags));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -169,7 +169,7 @@ namespace Memory
|
|||||||
bool Global : 1; // 8
|
bool Global : 1; // 8
|
||||||
uint8_t Available0 : 3; // 9-11
|
uint8_t Available0 : 3; // 9-11
|
||||||
uint64_t Address : 40; // 12-51
|
uint64_t Address : 40; // 12-51
|
||||||
uint32_t Available1 : 11; // 52-58
|
uint32_t Available1 : 7; // 52-58
|
||||||
bool ProtectionKey : 4; // 59-62
|
bool ProtectionKey : 4; // 59-62
|
||||||
bool ExecuteDisable : 1; // 63
|
bool ExecuteDisable : 1; // 63
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user