x86_64/MMU: Copy from the mapped kernel directory instead of the physical version

This commit is contained in:
apio 2023-02-27 12:30:52 +01:00
parent 78cea0a47e
commit 9da5204079
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -288,7 +288,8 @@ namespace MMU
constexpr auto HALF_PAGE = ARCH_PAGE_SIZE / 2; constexpr auto HALF_PAGE = ARCH_PAGE_SIZE / 2;
// Copy the upper part of the page directory (higher half) // Copy the upper part of the page directory (higher half)
memcpy(offset_ptr(directory, HALF_PAGE), offset_ptr(g_kernel_directory, HALF_PAGE), HALF_PAGE); memcpy(offset_ptr(directory, HALF_PAGE), offset_ptr((PageDirectory*)g_kernel_directory_virt, HALF_PAGE),
HALF_PAGE);
kdbgln("MMU init page directory (ring3): virt %p, phys %#.16lx", directory, directory_phys); kdbgln("MMU init page directory (ring3): virt %p, phys %#.16lx", directory, directory_phys);