summaryrefslogtreecommitdiff
path: root/arch/i386/include/kernel/vmem.h
diff options
context:
space:
mode:
authorDanny Holman <dholman@gymli.org>2024-06-21 21:48:46 -0500
committerDanny Holman <dholman@gymli.org>2024-06-21 21:50:55 -0500
commit056087596de64696f18f9b32f604b69280be079e (patch)
tree4ebdbe12197736d69898ff7437ff9e6af97940ed /arch/i386/include/kernel/vmem.h
parentf1a0f10f54e17803f7d7095a61117aec52fafbf0 (diff)
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 <dholman@gymli.org>
Diffstat (limited to 'arch/i386/include/kernel/vmem.h')
-rw-r--r--arch/i386/include/kernel/vmem.h17
1 files changed, 17 insertions, 0 deletions
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