diff --git a/kernel/src/Log.cpp b/kernel/src/Log.cpp index 992d9db1..d28a5e2d 100644 --- a/kernel/src/Log.cpp +++ b/kernel/src/Log.cpp @@ -10,6 +10,7 @@ static bool g_debug_enabled = true; static bool g_serial_enabled = true; static bool g_text_console_enabled = false; +static bool g_text_console_initialized = false; static constexpr u32 BLACK = 0xff000000; static constexpr u32 WHITE = 0xffffffff; @@ -109,6 +110,7 @@ void setup_log(bool enable_debug, bool enable_serial, bool enable_text_console) g_debug_enabled = enable_debug; g_serial_enabled = enable_serial; g_text_console_enabled = enable_text_console; + if (enable_text_console) g_text_console_initialized = true; } bool log_debug_enabled() @@ -131,6 +133,7 @@ static bool g_check_already_failed = false; [[noreturn]] bool __check_failed(SourceLocation location, const char* expr) { CPU::disable_interrupts(); + if (g_text_console_initialized) g_text_console_enabled = true; if (!g_check_already_failed) { // Avoid endlessly failing when trying to report a failed check. g_check_already_failed = true;