Map all physical memory into the higher half instead of using recursive mapping #23

Merged
apio merged 6 commits from map-physical-world into main 2023-02-27 11:59:51 +00:00
Showing only changes of commit 3ec54fafde - Show all commits

View File

@ -212,11 +212,16 @@ namespace MMU
auto& l2 = l2_entry(l3, virt);
if (!l2.present)
{
const u64 addr = TRY(MemoryManager::alloc_frame());
l2.present = true;
l2.set_address(addr);
memset(&page_table(l2), 0, ARCH_PAGE_SIZE);
if (use_huge_pages == UseHugePages::No)
{
const u64 addr = TRY(MemoryManager::alloc_frame());
l2.set_address(addr);
memset(&page_table(l2), 0, ARCH_PAGE_SIZE);
}
}
if (flags & Flags::ReadWrite) l2.read_write = true;
if (flags & Flags::User) l2.user = true;