Kernel: Kernel::Panic() will now always print to serial output
This commit is contained in:
parent
73abc3b2ee
commit
e307db47eb
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue