mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 02:13:56 +09:00
Kernel: Copy command line to a safe place
This avoids kmalloc overwriting it because it may be within the kmalloc or eternal pool.
This commit is contained in:
parent
5a98e329d1
commit
41c005cb14
Notes:
sideshowbarker
2024-07-19 03:19:45 +09:00
Author: https://github.com/tomuta
Commit: 41c005cb14
Pull-request: https://github.com/SerenityOS/serenity/pull/3248
3 changed files with 22 additions and 4 deletions
|
@ -113,6 +113,10 @@ extern "C" [[noreturn]] void init()
|
|||
{
|
||||
setup_serial_debug();
|
||||
|
||||
// We need to copy the command line before kmalloc is initialized,
|
||||
// as it may overwrite parts of multiboot!
|
||||
CommandLine::early_initialize(reinterpret_cast<const char*>(low_physical_to_virtual(multiboot_info_ptr->cmdline)));
|
||||
|
||||
s_bsp_processor.early_initialize(0);
|
||||
|
||||
// Invoke the constructors needed for the kernel heap
|
||||
|
@ -123,7 +127,7 @@ extern "C" [[noreturn]] void init()
|
|||
|
||||
s_bsp_processor.initialize(0);
|
||||
|
||||
CommandLine::initialize(reinterpret_cast<const char*>(low_physical_to_virtual(multiboot_info_ptr->cmdline)));
|
||||
CommandLine::initialize();
|
||||
MemoryManager::initialize(0);
|
||||
|
||||
// Invoke all static global constructors in the kernel.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue