From c05a87c7ff22bf755bbd919b7c117662eaac9c53 Mon Sep 17 00:00:00 2001 From: apio Date: Wed, 1 Feb 2023 22:58:31 +0100 Subject: [PATCH] kernel: Reenable the text console on panic --- kernel/src/Log.cpp | 3 +++ 1 file changed, 3 insertions(+) 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;