Kernel: Add self-test boot mode, an alias for text mode

Add a special boot mode for running tests, rather than using the system
as a general purpose OS. We'll use this in SystemServer to specify
only services needed to run tests and exit.
This commit is contained in:
Andrew Kaster 2021-02-27 10:19:02 -07:00 committed by Andreas Kling
parent ca8319f800
commit 5046213556
Notes: sideshowbarker 2024-07-18 21:51:11 +09:00

View file

@ -247,7 +247,9 @@ void init_stage2(void*)
PCI::initialize();
bool text_mode = kernel_command_line().lookup("boot_mode").value_or("graphical") == "text";
auto boot_mode = kernel_command_line().lookup("boot_mode").value_or("graphical");
// FIXME: Richer boot mode options would be nice instead of adding more strcmp here
bool text_mode = boot_mode == "text" || boot_mode == "self-test";
if (text_mode) {
dbgln("Text mode enabled");