From 9ab598af4984c0590358123af630e0e65e310b72 Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Fri, 28 Apr 2023 17:27:24 +0200 Subject: Revert "Kernel/x86: Bake the Prekernel and the Kernel into one image" Some hardware/software configurations crash KVM as soon as we try to start Serenity. The exact cause is currently unknown, so just fully revert it for now. This reverts commit 897c4e5145474d55b247a4a3b5e6bf5420279e2f. --- Kernel/Arch/init.cpp | 13 +++++++------ Kernel/Arch/x86_64/linker.ld | 5 +++-- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'Kernel/Arch') diff --git a/Kernel/Arch/init.cpp b/Kernel/Arch/init.cpp index 6b2d785af1..8f7cf5381b 100644 --- a/Kernel/Arch/init.cpp +++ b/Kernel/Arch/init.cpp @@ -84,6 +84,9 @@ extern "C" u8 end_of_safemem_atomic_text[]; extern "C" u8 end_of_kernel_image[]; +multiboot_module_entry_t multiboot_copy_boot_modules_array[16]; +size_t multiboot_copy_boot_modules_count; + READONLY_AFTER_INIT bool g_in_early_boot; namespace Kernel { @@ -134,10 +137,8 @@ READONLY_AFTER_INIT char const* kernel_cmdline; READONLY_AFTER_INIT u32 multiboot_flags; READONLY_AFTER_INIT multiboot_memory_map_t* multiboot_memory_map; READONLY_AFTER_INIT size_t multiboot_memory_map_count; +READONLY_AFTER_INIT multiboot_module_entry_t* multiboot_modules; READONLY_AFTER_INIT size_t multiboot_modules_count; -READONLY_AFTER_INIT PhysicalAddress multiboot_module_ramdisk_physical_start; -READONLY_AFTER_INIT PhysicalAddress multiboot_module_ramdisk_physical_end; -READONLY_AFTER_INIT PhysicalAddress multiboot_module_ramdisk_physical_string_addr; READONLY_AFTER_INIT PhysicalAddress multiboot_framebuffer_addr; READONLY_AFTER_INIT u32 multiboot_framebuffer_pitch; READONLY_AFTER_INIT u32 multiboot_framebuffer_width; @@ -169,10 +170,8 @@ extern "C" [[noreturn]] UNMAP_AFTER_INIT void init([[maybe_unused]] BootInfo con multiboot_flags = boot_info.multiboot_flags; multiboot_memory_map = (multiboot_memory_map_t*)boot_info.multiboot_memory_map; multiboot_memory_map_count = boot_info.multiboot_memory_map_count; + multiboot_modules = (multiboot_module_entry_t*)boot_info.multiboot_modules; multiboot_modules_count = boot_info.multiboot_modules_count; - multiboot_module_ramdisk_physical_start = PhysicalAddress { boot_info.multiboot_module_ramdisk_physical_start }; - multiboot_module_ramdisk_physical_end = PhysicalAddress { boot_info.multiboot_module_ramdisk_physical_end }; - multiboot_module_ramdisk_physical_string_addr = PhysicalAddress { boot_info.multiboot_module_ramdisk_physical_string_addr }; multiboot_framebuffer_addr = PhysicalAddress { boot_info.multiboot_framebuffer_addr }; multiboot_framebuffer_pitch = boot_info.multiboot_framebuffer_pitch; multiboot_framebuffer_width = boot_info.multiboot_framebuffer_width; @@ -201,6 +200,8 @@ extern "C" [[noreturn]] UNMAP_AFTER_INIT void init([[maybe_unused]] BootInfo con // We need to copy the command line before kmalloc is initialized, // as it may overwrite parts of multiboot! CommandLine::early_initialize(kernel_cmdline); + memcpy(multiboot_copy_boot_modules_array, multiboot_modules, multiboot_modules_count * sizeof(multiboot_module_entry_t)); + multiboot_copy_boot_modules_count = multiboot_modules_count; new (&bsp_processor()) Processor(); bsp_processor().early_initialize(0); diff --git a/Kernel/Arch/x86_64/linker.ld b/Kernel/Arch/x86_64/linker.ld index e9b7a870f1..e11648fe13 100644 --- a/Kernel/Arch/x86_64/linker.ld +++ b/Kernel/Arch/x86_64/linker.ld @@ -69,8 +69,6 @@ SECTIONS start_of_kernel_data = .; *(.data*) end_of_kernel_data = .; - . = ALIGN(4K); - *(.heap) } :data .ro_after_init ALIGN(4K) : AT(ADDR(.ro_after_init)) @@ -87,6 +85,9 @@ SECTIONS *(COMMON) *(.bss*) end_of_kernel_bss = .; + + . = ALIGN(4K); + *(.heap) } :bss .dynamic ALIGN(4K) : AT (ADDR(.dynamic)) -- cgit v1.2.3