From da84f1713c2f84260d81ed4ede39ba2665d4ac97 Mon Sep 17 00:00:00 2001 From: apio Date: Mon, 10 Oct 2022 18:45:49 +0200 Subject: [PATCH] InitRD: Use get_blocks_from_size() --- kernel/src/init/InitRD.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/src/init/InitRD.cpp b/kernel/src/init/InitRD.cpp index ee921098..f6c804bc 100644 --- a/kernel/src/init/InitRD.cpp +++ b/kernel/src/init/InitRD.cpp @@ -114,8 +114,8 @@ void InitRD::for_each(void (*callback)(File& f)) void InitRD::init() { - initrd_base = - MemoryManager::get_unaligned_mappings((void*)bootboot.initrd_ptr, bootboot.initrd_size / PAGE_SIZE + 1); + initrd_base = MemoryManager::get_unaligned_mappings( + (void*)bootboot.initrd_ptr, Utilities::get_blocks_from_size(PAGE_SIZE, bootboot.initrd_size)); kdbgln("physical base at %lx, size %lx, mapped to %p", bootboot.initrd_ptr, bootboot.initrd_size, initrd_base); initrd_initialized = true; } \ No newline at end of file