summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Holman <dholman@gymli.org>2024-05-29 13:06:12 -0500
committerDanny Holman <dholman@gymli.org>2024-05-29 13:06:12 -0500
commitb6817990b469b901bf4c269bec6813043ed38c61 (patch)
tree8af4b09a1d810f33efd35a2cac35195f587c61f2
parentfb7895bc23ce4359a3574103ae4a7864669e5a95 (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>
-rw-r--r--arch/i386/kernel/paging.c7
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;
}