From 056087596de64696f18f9b32f604b69280be079e Mon Sep 17 00:00:00 2001 From: Danny Holman Date: Fri, 21 Jun 2024 21:48:46 -0500 Subject: arch: i386: paging: do the recursive paging trick Map the page directory to the last page table. This allows the kernel to access every page table on the system from the address 0xFFC00000 plus an offset. Signed-off-by: Danny Holman --- arch/i386/include/kernel/vmem.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 arch/i386/include/kernel/vmem.h (limited to 'arch/i386/include/kernel/vmem.h') diff --git a/arch/i386/include/kernel/vmem.h b/arch/i386/include/kernel/vmem.h new file mode 100644 index 0000000..94aa32d --- /dev/null +++ b/arch/i386/include/kernel/vmem.h @@ -0,0 +1,17 @@ +#ifndef I386_VMEM_H +#define I386_VMEM_H + +extern uintptr_t _kernel_start; +extern uintptr_t _kernel_end; + +#define KSTART ((uintptr_t)&_kernel_start) +#define KEND ((uintptr_t)&_kernel_end - 0xC0000000) + +#define KHEAP_START (GET_VADDR(KEND) + 0x2000) +#define KHEAP_STOP 0xFF7FF000 + +#define PAGE_DIR_MAP 0xFFFFF000 +#define PAGE_TAB_MAP 0xFFC00000 +#define PAGE_TMP_MAP 0xFFBFF000 + +#endif -- cgit v1.2.3