fix: change the pte to use a bitmask operation (still crashes but later)

This commit is contained in:
2024-10-18 15:38:36 +02:00
parent 7128f2640a
commit 55037b75fa
4 changed files with 9 additions and 8 deletions

View File

@ -43,11 +43,11 @@ void *alloc_pages(size_t size)
PAGE_SIZE);
return NULL;
}
assert(page_table1[i] >> 12 == i);
page_table1[i] = (uint32_t)frame << 12 | INIT_FLAGS;
/* assert(page_table1[i] >> 12 == i); */
page_table1[i] = ((uint32_t)frame & PAGE_MASK) | INIT_FLAGS;
}
PRINT_PTR(page_table1[index]);
return (void *)(page_table1[index] >> 12);
return (void *)(index * PAGE_SIZE);
}
int free_pages(void *page_ptr, size_t size)