fix: start frame allocator after kernel code

This commit is contained in:
2024-11-20 01:51:07 +01:00
parent b7dd7761d5
commit 3bc05604db
4 changed files with 57 additions and 32 deletions

View File

@ -30,7 +30,8 @@ void *alloc_frame(void)
int free_frame(void *frame_ptr)
{
struct frame_zone *it = head;
while (it && (frame_ptr < it->addr || frame_ptr >= it->addr + it->len))
while (it && (frame_ptr < it->addr ||
frame_ptr >= it->addr + it->total_frames * PAGE_SIZE))
it = it->next;
uint32_t index = ((frame_ptr - it->addr) / PAGE_SIZE);