From 7f1884213accb072f78205d2d1614c7e586c4497 Mon Sep 17 00:00:00 2001 From: apio Date: Mon, 27 Feb 2023 13:27:21 +0100 Subject: [PATCH] InitRD: Use MMU::translate_physical_address instead of allocating VM This one is a perfect candidate, since we're just mapping a fixed continuous range of physical memory to virtual memory. --- kernel/src/InitRD.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/kernel/src/InitRD.cpp b/kernel/src/InitRD.cpp index 1fc592df..a661b817 100644 --- a/kernel/src/InitRD.cpp +++ b/kernel/src/InitRD.cpp @@ -1,18 +1,13 @@ #include "InitRD.h" #include "arch/MMU.h" #include "boot/bootboot.h" -#include "memory/MemoryManager.h" -#include TarStream g_initrd; extern const BOOTBOOT bootboot; void InitRD::initialize() { - u64 virtual_initrd_address = - MemoryManager::get_kernel_mapping_for_frames( - bootboot.initrd_ptr, get_blocks_from_size(bootboot.initrd_size, ARCH_PAGE_SIZE), MMU::NoExecute) - .expect_value("Unable to map the initial ramdisk into virtual memory"); + u64 virtual_initrd_address = MMU::translate_physical_address(bootboot.initrd_ptr); g_initrd.initialize((void*)virtual_initrd_address, bootboot.initrd_size); }