From f7df7167f0c54bd8da79dbf2d48bda5d7491fd32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matteo=20Gm=C3=BCr?= Date: Sun, 6 Oct 2024 08:45:04 +0000 Subject: Remove high memory kernel and needless prints --- arch/x86_64/src/boot/boot.s | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 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 7b4e193..0c21c66 100644 --- a/arch/x86_64/src/boot/boot.s +++ b/arch/x86_64/src/boot/boot.s @@ -17,8 +17,8 @@ * * We need: * - A single PML 4 (since we will only use 4-level paging) - * - 2 PML 3s (since we need to map high (-2GiB) and low (1+MiB) memory) - * - 2 PML 2s (since we need to map high (-2GiB) and low (1+MiB) memory) + * - 2 PML 3s (since we need to map low (1+MiB) memory) + * - 2 PML 2s (since we need to map low (1+MiB) memory) */ .global page_map_level_4 @@ -26,13 +26,9 @@ page_map_level_4: .skip 512 * 8 .global page_map_level_3_low page_map_level_3_low: .skip 512 * 8 -.global page_map_level_3_high -page_map_level_3_high: .skip 512 * 8 .global page_map_level_2_low page_map_level_2_low: .skip 512 * 8 -.global page_map_level_2_high -page_map_level_2_high: .skip 512 * 8 /** * Reserve some space for the Multiboot 2 information pointer. @@ -306,10 +302,7 @@ enable_sse: * * We map all physical memory we were loaded in plus one additional page. The * mapping is done in terms of huge pages (2 MiB per page) to save on required - * page map entries. Note that we also map memory both in the low and high - * virtual address ranges, giving us two ways of accessing it. We need to do - * this, because the bootstrapping code lives in low memory, while the rest of - * the kernel will reside on the high end. + * page map entries. */ prepare_page_maps: /* Add an entry to the PML4, pointing to the low PML3 */ @@ -317,21 +310,11 @@ prepare_page_maps: or $0x3, %eax mov %eax, (page_map_level_4 + ((0x0000000000100000 >> 39) & 0x1ff) * 8) - /* Add an entry to the PML4, pointing to the high PML3 */ - mov $page_map_level_3_high, %eax - or $0x3, %eax - mov %eax, (page_map_level_4 + ((0xffffffff80100000 >> 39) & 0x1ff) * 8) - /* Add an entry to the low PML3, pointing to the low PML2 */ mov $page_map_level_2_low, %eax or $0x3, %eax mov %eax, (page_map_level_3_low + ((0x0000000000100000 >> 30) & 0x1ff) * 8) - /* Add an entry to the high PML3, pointing to the high PML2 */ - mov $page_map_level_2_high, %eax - or $0x3, %eax - mov %eax, (page_map_level_3_high + ((0xffffffff80100000 >> 30) & 0x1ff) * 8) - xor %ecx, %ecx mov $_end_linear, %esi @@ -343,7 +326,6 @@ prepare_page_maps: mul %ecx or $((1 << 0) | (1 << 1) | (1 << 7)), %eax mov %eax, page_map_level_2_low(,%ecx,8) - mov %eax, page_map_level_2_high(,%ecx,8) inc %ecx cmp %esi, %ecx -- cgit v1.2.3