diff --git a/stage23/lib/panic.s2.c b/stage23/lib/panic.s2.c index 1094b99e..d444523d 100644 --- a/stage23/lib/panic.s2.c +++ b/stage23/lib/panic.s2.c @@ -7,6 +7,7 @@ #include #include #include +#include #include __attribute__((noreturn)) void panic(const char *fmt, ...) { @@ -14,6 +15,14 @@ __attribute__((noreturn)) void panic(const char *fmt, ...) { va_start(args, fmt); + if (term_backend == NOT_READY) { +#if bios == 1 + term_textmode(); +#elif uefi == 1 + term_vbe(0, 0); +#endif + } + print("\033[31mPANIC\033[37;1m\033[0m: "); vprint(fmt, args);