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 &&