From c1e7edabc1dfbe387546297720fc495837d38d33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matteo=20Gm=C3=BCr?= Date: Sun, 1 Dec 2024 09:46:37 +0000 Subject: Fix guard page and ensure it crashes even if guard page is skipped altogether --- arch/x86_64/src/boot/boot.s | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'arch/x86_64/src/boot') diff --git a/arch/x86_64/src/boot/boot.s b/arch/x86_64/src/boot/boot.s index c1b3203..8d27ea1 100644 --- a/arch/x86_64/src/boot/boot.s +++ b/arch/x86_64/src/boot/boot.s @@ -7,6 +7,16 @@ * Uninitialized data for the bootstrapping process. */ .section .boot_bss, "aw", @nobits + +/** + * Reserve some space for the Multiboot 2 information pointer. + */ +.global multiboot_information_pointer +multiboot_information_pointer: .skip 4 + +/** + * Align page maps to 4 KiB or the assembler code, will cause crashes when attempting to enable paging. + */ .align 4096 /** @@ -30,12 +40,6 @@ page_map_level_3: .skip 512 * 8 .global page_map_level_2 page_map_level_2: .skip 512 * 8 -/** - * Reserve some space for the Multiboot 2 information pointer. - */ -.global multiboot_information_pointer -multiboot_information_pointer: .skip 4 - /** * Stack space for the bootstrapping process. * -- cgit v1.2.3