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);