diff options
author | Gunnar Beutner <gbeutner@serenityos.org> | 2021-07-19 18:24:15 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-07-20 15:12:19 +0200 |
commit | be795d5812fe901f3444cab58285eb6fc72c8ca4 (patch) | |
tree | caf0b27f00cc307e7148bd1544bffe9ab00f1e80 /Kernel/init.cpp | |
parent | dd42093b932161bf4d6f98f1e25093049824d6b2 (diff) | |
download | serenity-be795d5812fe901f3444cab58285eb6fc72c8ca4.zip |
Prekernel: Use physical addresses for some of the BootInfo parameters
The kernel would just turn those virtual addresses into physical
addresses later on, so let's just use physical addresses right from the
start.
Diffstat (limited to 'Kernel/init.cpp')
-rw-r--r-- | Kernel/init.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/Kernel/init.cpp b/Kernel/init.cpp index cf07343a35..cc6a93b3ec 100644 --- a/Kernel/init.cpp +++ b/Kernel/init.cpp @@ -107,16 +107,16 @@ static Processor s_bsp_processor; // global but let's keep it "private" // init_stage2() function. Initialization continues there. extern "C" { -u8 const* start_of_prekernel_image; -u8 const* end_of_prekernel_image; +PhysicalAddress start_of_prekernel_image; +PhysicalAddress end_of_prekernel_image; __attribute__((section(".boot_bss"))) FlatPtr kernel_base; #if ARCH(X86_64) -FlatPtr boot_pml4t; +PhysicalAddress boot_pml4t; #endif -FlatPtr boot_pdpt; -FlatPtr boot_pd0; -FlatPtr boot_pd_kernel; -FlatPtr boot_pd_kernel_pt1023; +PhysicalAddress boot_pdpt; +PhysicalAddress boot_pd0; +PhysicalAddress boot_pd_kernel; +PageTableEntry* boot_pd_kernel_pt1023; const char* kernel_cmdline; } @@ -124,20 +124,20 @@ extern "C" [[noreturn]] UNMAP_AFTER_INIT void init(BootInfo const& boot_info) { g_in_early_boot = true; - multiboot_info_ptr = boot_info.multiboot_info_ptr; - start_of_prekernel_image = boot_info.start_of_prekernel_image; - end_of_prekernel_image = boot_info.end_of_prekernel_image; + multiboot_info_ptr = (multiboot_info_t*)boot_info.multiboot_info_ptr; + start_of_prekernel_image = PhysicalAddress { boot_info.start_of_prekernel_image }; + end_of_prekernel_image = PhysicalAddress { boot_info.end_of_prekernel_image }; kernel_base = boot_info.kernel_base; #if ARCH(X86_64) gdt64ptr = boot_info.gdt64ptr; code64_sel = boot_info.code64_sel; - boot_pml4t = boot_info.boot_pml4t; + boot_pml4t = PhysicalAddress { boot_info.boot_pml4t }; #endif - boot_pdpt = boot_info.boot_pdpt; - boot_pd0 = boot_info.boot_pd0; - boot_pd_kernel = boot_info.boot_pd_kernel; - boot_pd_kernel_pt1023 = boot_info.boot_pd_kernel_pt1023; - kernel_cmdline = boot_info.kernel_cmdline; + boot_pdpt = PhysicalAddress { boot_info.boot_pdpt }; + boot_pd0 = PhysicalAddress { boot_info.boot_pd0 }; + boot_pd_kernel = PhysicalAddress { boot_info.boot_pd_kernel }; + boot_pd_kernel_pt1023 = (PageTableEntry*)boot_info.boot_pd_kernel_pt1023; + kernel_cmdline = (char const*)boot_info.kernel_cmdline; setup_serial_debug(); |