diff options
author | Anton Kling <anton@kling.gg> | 2024-03-20 18:08:57 +0100 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2024-03-20 19:08:18 +0100 |
commit | a950021011e41b7d4fd285dde278cf9b06f89574 (patch) | |
tree | 1d88d00ac2f31d8d7c47dc84a954caea68c0b5f2 /kernel/init | |
parent | 553b43d2e563dcff74d4c86904fa3737e96d7365 (diff) |
MMU: Fixed massive problem in assumption of RAM layout
This caused certain addreses which where not RAM memory to be assigned
to virtual addresses incorrectly. This caused a significant slowdown
when running it with KVM due to constantly having to exit the VM if the
OS writes to memory that is not RAM.
This fix increased the performance of KVM significantly and improved TCG
performance.
Diffstat (limited to 'kernel/init')
-rw-r--r-- | kernel/init/kernel.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/init/kernel.c b/kernel/init/kernel.c index ef7cdae..180aaa8 100644 --- a/kernel/init/kernel.c +++ b/kernel/init/kernel.c @@ -43,7 +43,6 @@ uintptr_t data_end; void kernel_main(u32 kernel_end, unsigned long magic, unsigned long addr, u32 inital_stack) { - (void)kernel_end; data_end = 0xc0400000; inital_esp = inital_stack; @@ -55,7 +54,8 @@ void kernel_main(u32 kernel_end, unsigned long magic, unsigned long addr, u32 mem_kb = mb->mem_lower; u32 mem_mb = (mb->mem_upper - 1000) / 1000; u64 memsize_kb = mem_mb * 1000 + mem_kb; - paging_init(memsize_kb); + + paging_init(memsize_kb, mb); klog("Paging Initalized", LOG_SUCCESS); mb = mmu_map_frames((multiboot_info_t *)addr, sizeof(multiboot_info_t)); |