From 659ba24f12fb4e87e594275f855ef0aae5c35519 Mon Sep 17 00:00:00 2001 From: Starnakin Date: Fri, 25 Oct 2024 16:19:25 +0200 Subject: [PATCH] fix: memory: current_page_table addr --- src/memory/page.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/memory/page.c b/src/memory/page.c index 265c9c9..0fac9c8 100644 --- a/src/memory/page.c +++ b/src/memory/page.c @@ -13,14 +13,13 @@ static uint16_t current_pd_index; static int16_t find_next_block(size_t nb_pages) { - for (uint16_t pd_index = 0; pd_index < 768; pd_index++) { + for (uint16_t pd_index = 1; pd_index < 768; pd_index++) { if (page_directory[pd_index] == 0x02) { if (create_page_table(pd_index) < 0) return -2; } current_pd_index = pd_index; - current_page_table = - (uint32_t *)((PT_START + pd_index) * PAGE_SIZE); + current_page_table = (uint32_t *)((PT_START + pd_index) * 1024); for (uint16_t i = 0; i + nb_pages < PT_SIZE; i++) { uint16_t j; for (j = 0; current_page_table[i + j] >> 12 == i + j &&