fix: change the pte to use a bitmask operation (still crashes but later)
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user