Kernel: Add command line option to boot without smp

This commit is contained in:
Bananymous 2024-07-21 17:40:57 +03:00
parent 77b5e6d44a
commit 86b6714777
1 changed files with 7 additions and 3 deletions

View File

@ -35,6 +35,7 @@ struct ParsedCommandLine
{ {
bool force_pic = false; bool force_pic = false;
bool disable_serial = false; bool disable_serial = false;
bool disable_smp = false;
BAN::StringView console = "tty0"_sv; BAN::StringView console = "tty0"_sv;
BAN::StringView root; BAN::StringView root;
}; };
@ -71,6 +72,8 @@ static void parse_command_line()
cmdline.force_pic = true; cmdline.force_pic = true;
else if (argument == "noserial") else if (argument == "noserial")
cmdline.disable_serial = true; cmdline.disable_serial = true;
else if (argument == "nosmp")
cmdline.disable_smp = true;
else if (argument.size() > 5 && argument.substring(0, 5) == "root=") else if (argument.size() > 5 && argument.substring(0, 5) == "root=")
cmdline.root = argument.substring(5); cmdline.root = argument.substring(5);
else if (argument.size() > 8 && argument.substring(0, 8) == "console=") else if (argument.size() > 8 && argument.substring(0, 8) == "console=")
@ -140,6 +143,7 @@ extern "C" void kernel_main(uint32_t boot_magic, uint32_t boot_info)
if (g_terminal_driver) if (g_terminal_driver)
dprintln("Framebuffer terminal initialized"); dprintln("Framebuffer terminal initialized");
if (!cmdline.disable_smp)
InterruptController::get().initialize_multiprocessor(); InterruptController::get().initialize_multiprocessor();
ProcFileSystem::initialize(); ProcFileSystem::initialize();