fix: last page of the pt is now usable

This commit is contained in:
Starnakin 2024-11-26 14:17:04 +01:00
parent 773f55466e
commit 9944f79b2e

View File

@ -17,7 +17,7 @@ static int16_t find_next_block(size_t nb_pages, uint16_t *pd_index_ptr,
} }
*page_table_ptr = *page_table_ptr =
(uint32_t *)GET_PAGE_ADDR(0, *pd_index_ptr + PT_START); (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; uint16_t j;
for (j = 0; (*page_table_ptr)[i + j] >> 12 == i + j && for (j = 0; (*page_table_ptr)[i + j] >> 12 == i + j &&
j < nb_pages; j < nb_pages;