From 504621355695df3202a67ba73f12d50e322b9a32 Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Sat, 27 Feb 2021 10:19:02 -0700 Subject: [PATCH] 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. --- Kernel/init.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Kernel/init.cpp b/Kernel/init.cpp index 800493a877..18923f48da 100644 --- a/Kernel/init.cpp +++ b/Kernel/init.cpp @@ -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");