efi: Ensure panics are (hopefully) always visible
This commit is contained in:
parent
886523359c
commit
50b524838a
@ -29,14 +29,22 @@ noreturn void panic(bool allow_menu, const char *fmt, ...) {
|
||||
|
||||
is_nested = true;
|
||||
|
||||
if (
|
||||
#if defined (BIOS)
|
||||
stage3_loaded == true &&
|
||||
#endif
|
||||
term_backend == NOT_READY) {
|
||||
if (stage3_loaded == true && term_backend == NOT_READY) {
|
||||
early_term = true;
|
||||
term_vbe(NULL, 0, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined (UEFI)
|
||||
if (term_backend == NOT_READY) {
|
||||
if (term_enabled_once) {
|
||||
term_vbe(NULL, 0, 0);
|
||||
} else {
|
||||
term_fallback();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
nested:
|
||||
if (term_backend == NOT_READY) {
|
||||
|
@ -109,6 +109,8 @@ void term_vbe(char *config, size_t width, size_t height) {
|
||||
term_context_restore = gterm_context_restore;
|
||||
term_full_refresh = gterm_full_refresh;
|
||||
|
||||
term_enabled_once = true;
|
||||
|
||||
term_backend = VBE;
|
||||
}
|
||||
|
||||
@ -220,6 +222,8 @@ void term_textmode(void) {
|
||||
term_context_restore = text_context_restore;
|
||||
term_full_refresh = text_full_refresh;
|
||||
|
||||
term_enabled_once = true;
|
||||
|
||||
term_backend = TEXTMODE;
|
||||
}
|
||||
#endif
|
||||
|
@ -50,6 +50,7 @@ extern int term_backend;
|
||||
extern size_t term_rows, term_cols;
|
||||
extern bool term_runtime;
|
||||
extern bool early_term;
|
||||
extern bool term_enabled_once;
|
||||
|
||||
void term_fallback(void);
|
||||
|
||||
|
@ -11,6 +11,7 @@ no_unwind int current_video_mode = -1;
|
||||
int term_backend = NOT_READY;
|
||||
size_t term_rows, term_cols;
|
||||
bool term_runtime = false;
|
||||
bool term_enabled_once = false;
|
||||
|
||||
void (*raw_putchar)(uint8_t c);
|
||||
void (*clear)(bool move);
|
||||
|
Loading…
Reference in New Issue
Block a user