diff options
author | Danny Holman <dholman@gymli.org> | 2024-05-29 13:06:12 -0500 |
---|---|---|
committer | Danny Holman <dholman@gymli.org> | 2024-05-29 13:06:12 -0500 |
commit | b6817990b469b901bf4c269bec6813043ed38c61 (patch) | |
tree | 8af4b09a1d810f33efd35a2cac35195f587c61f2 /arch/i386/kernel | |
parent | fb7895bc23ce4359a3574103ae4a7864669e5a95 (diff) |
arch: i386: paging: make a temp map in init_page_table
Make a temporary mapping for a alloc'd page in init_page_table. This
ensures that the mapping is firmly inside the page table set aside for
page accounting structures.
Signed-off-by: Danny Holman <dholman@gymli.org>
Diffstat (limited to 'arch/i386/kernel')
-rw-r--r-- | arch/i386/kernel/paging.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/i386/kernel/paging.c b/arch/i386/kernel/paging.c index ddab223..96ad2ce 100644 --- a/arch/i386/kernel/paging.c +++ b/arch/i386/kernel/paging.c @@ -24,9 +24,10 @@ uintptr_t* init_page_table(void) { if ((uintptr_t)ret == PFA_ALLOC_ERR) return NULL; - map_page(NULL, (uintptr_t)ret, (uintptr_t)ret+0x20000000, PD_PRES | PD_RW); - memset((char*)ret, 0, PAGE_SIZE); - unmap_page(NULL, (uintptr_t)ret); + uintptr_t *temp_map = (uintptr_t*)0xD0001000; + map_page(NULL, (uintptr_t)ret, (uintptr_t)temp_map, PD_PRES | PD_RW); + memset((char*)temp_map, 0, PAGE_SIZE); + unmap_page(NULL, (uintptr_t)temp_map); return ret; } |