From b6817990b469b901bf4c269bec6813043ed38c61 Mon Sep 17 00:00:00 2001 From: Danny Holman Date: Wed, 29 May 2024 13:06:12 -0500 Subject: 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 --- arch/i386/kernel/paging.c | 7 ++++--- 1 file 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; } -- cgit v1.2.3