Kernel: Kernel::Panic() will now always print to serial output

This commit is contained in:
Bananymous 2023-01-16 15:44:27 +02:00
parent 73abc3b2ee
commit e307db47eb
1 changed files with 2 additions and 5 deletions

View File

@ -13,17 +13,14 @@ namespace Kernel
__attribute__((__noreturn__)) __attribute__((__noreturn__))
static void PanicImpl(const char* file, int line, const char* message, Args... args) static void PanicImpl(const char* file, int line, const char* message, Args... args)
{ {
derrorln("Kernel panic at {}:{}", file, line);
derrorln(message, args...);
if (TTY::IsInitialized()) if (TTY::IsInitialized())
{ {
kprint("\e[31mKernel panic at {}:{}\n", file, line); kprint("\e[31mKernel panic at {}:{}\n", file, line);
kprint(message, args...); kprint(message, args...);
kprint("\e[m\n"); kprint("\e[m\n");
} }
else
{
derrorln("Kernel panic at {}:{}", file, line);
derrorln(message, args...);
}
asm volatile("cli; hlt"); asm volatile("cli; hlt");
__builtin_unreachable(); __builtin_unreachable();
} }