From 8203b36092625347cc028d7b6236340ecb004f64 Mon Sep 17 00:00:00 2001 From: Starnakin Date: Tue, 26 Nov 2024 14:16:24 +0100 Subject: [PATCH] fix: remove imcomplete page --- src/memory/memory.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/memory/memory.c b/src/memory/memory.c index db8c3bd..fef2605 100644 --- a/src/memory/memory.c +++ b/src/memory/memory.c @@ -90,7 +90,8 @@ static void add_frame_node(multiboot_memory_map_t *mmmt) */ if (KERNEL_START <= start_addr && KERNEL_END > start_addr && KERNEL_END <= end_addr) { - len = len - (KERNEL_END - start_addr); + len = ROUND_CEIL(len - (KERNEL_END - start_addr), PAGE_SIZE) - + PAGE_SIZE; // cringe but ROUND_FLOOR is un poquito crampte start_addr = ROUND_CEIL(KERNEL_END, PAGE_SIZE); } end_addr = ROUND_CEIL(start_addr + len, PAGE_SIZE);