panic: Initialise a terminal backend if term is not ready
This commit is contained in:
parent
f46ed6d984
commit
057715b60c
|
@ -7,6 +7,7 @@
|
|||
#include <lib/blib.h>
|
||||
#include <lib/readline.h>
|
||||
#include <lib/gterm.h>
|
||||
#include <lib/term.h>
|
||||
#include <mm/pmm.h>
|
||||
|
||||
__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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue