diff --git a/repos/base-hw/src/core/spec/x86_64/kernel/crt0.s b/repos/base-hw/src/core/spec/x86_64/kernel/crt0.s index 79c322049..e96176fe6 100644 --- a/repos/base-hw/src/core/spec/x86_64/kernel/crt0.s +++ b/repos/base-hw/src/core/spec/x86_64/kernel/crt0.s @@ -12,6 +12,8 @@ * under the terms of the GNU General Public License version 2. */ +.include "macros.s" + .section ".text.crt0" /* magic multi-boot header to make GRUB happy */ @@ -69,3 +71,29 @@ .p2align 8 .space 32 * 1024 _stack_high: + +.data + + /**************************************** + ** Initial pagetables ** + ** Identity mapping from 2MiB to 4MiB ** + ****************************************/ + + /* PML4 */ + .p2align MIN_PAGE_SIZE_LOG2 + _kernel_pml4: + .quad _kernel_pdp + 0xf + .fill 511, 8, 0x0 + + /* PDP */ + .p2align MIN_PAGE_SIZE_LOG2 + _kernel_pdp: + .quad _kernel_pd + 0xf + .fill 511, 8, 0x0 + + /* PD */ + .p2align MIN_PAGE_SIZE_LOG2 + _kernel_pd: + .quad 0 + .quad 0x20018f + .fill 510, 8, 0x0