From 9944f79b2e3fa0cd2d8d3c410223a932df1f066a Mon Sep 17 00:00:00 2001 From: Starnakin Date: Tue, 26 Nov 2024 14:17:04 +0100 Subject: [PATCH] fix: last page of the pt is now usable --- src/memory/page.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/memory/page.c b/src/memory/page.c index c8c32d2..5acdb47 100644 --- a/src/memory/page.c +++ b/src/memory/page.c @@ -17,7 +17,7 @@ static int16_t find_next_block(size_t nb_pages, uint16_t *pd_index_ptr, } *page_table_ptr = (uint32_t *)GET_PAGE_ADDR(0, *pd_index_ptr + PT_START); - for (uint16_t i = 0; i + nb_pages < PT_SIZE; i++) { + for (uint16_t i = 0; i + nb_pages - 1 < PT_SIZE; i++) { uint16_t j; for (j = 0; (*page_table_ptr)[i + j] >> 12 == i + j && j < nb_pages;