fix: memory: use 1024 instead of 4096 when use 32bit ptr
This commit is contained in:
parent
a9bfb49bb8
commit
cbcff77a4a
@ -57,7 +57,7 @@ void *alloc_pages(size_t size)
|
||||
current_page_table[i] =
|
||||
((uint32_t)frame & PAGE_MASK) | INIT_FLAGS;
|
||||
}
|
||||
return (void *)(((current_pd_index * 1024) + index) * PAGE_SIZE);
|
||||
return (void *)(((current_pd_index * 1024) + index) * 1024);
|
||||
}
|
||||
|
||||
int free_pages(void *page_ptr, size_t size)
|
||||
|
@ -12,7 +12,7 @@ int16_t create_page_table(uint16_t pd_index)
|
||||
if (!frame)
|
||||
return -1;
|
||||
page_directory[pd_index] = ((uint32_t)frame & PAGE_MASK) | 0x03;
|
||||
uint32_t *page_table = (uint32_t *)((PT_START + pd_index) * PAGE_SIZE);
|
||||
uint32_t *page_table = (uint32_t *)((PT_START + pd_index) * 1024);
|
||||
init_page_table(page_table, 0);
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user