From a42af7e9732ad9848397e48e56eed6f931903cb8 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Sat, 3 Jun 2023 18:53:36 +0300 Subject: [PATCH] Kernel: boot.S is back to 2 MiB pages bochs doesn't seem to support 1 GiB pages --- kernel/arch/x86_64/boot.S | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/kernel/arch/x86_64/boot.S b/kernel/arch/x86_64/boot.S index 6026dc1b..ed519982 100644 --- a/kernel/arch/x86_64/boot.S +++ b/kernel/arch/x86_64/boot.S @@ -58,7 +58,7 @@ boot_pml4: .endr .quad V2P(boot_pdpt_hi) + (PG_READ_WRITE | PG_PRESENT) boot_pdpt_lo: - .quad 0x00000000 + (PG_PAGE_SIZE | PG_READ_WRITE | PG_PRESENT) + .quad V2P(boot_pd) + (PG_READ_WRITE | PG_PRESENT) .rept 511 .quad 0 .endr @@ -66,8 +66,14 @@ boot_pdpt_hi: .rept 510 .quad 0 .endr - .quad 0x00000000 + (PG_PAGE_SIZE | PG_READ_WRITE | PG_PRESENT) + .quad V2P(boot_pd) + (PG_READ_WRITE | PG_PRESENT) .quad 0 +boot_pd: + .set i, 0 + .rept 512 + .quad i + (PG_PAGE_SIZE | PG_READ_WRITE | PG_PRESENT) + .set i, i + 0x200000 + .endr boot_gdt: .quad 0x0000000000000000 # null descriptor