:: commit 48053fd206dac61d38e5dde85dfd1f8d5849916c

mintsuki <mintsuki@protonmail.com> — 2023-02-16 02:54

parents: e909489635

misc: Fix bug on trunk where returns to menu from panic would crash

diff --git a/common/entry.s3.c b/common/entry.s3.c
index 842c4034..a4a0bb27 100644
--- a/common/entry.s3.c
+++ b/common/entry.s3.c
@@ -130,5 +130,7 @@ noreturn void stage3_common(void) {
     init_io_apics();
 #endif
 
+    term_notready();
+
     menu(true);
 }
diff --git a/common/lib/panic.s2.c b/common/lib/panic.s2.c
index 901e968b..23634504 100644
--- a/common/lib/panic.s2.c
+++ b/common/lib/panic.s2.c
@@ -54,6 +54,9 @@ noreturn void panic(bool allow_menu, const char *fmt, ...) {
 
         getchar();
 
+        // This fixes a crash
+        term_notready();
+
         menu(false);
 /*
         fb_clear(&fbinfo);
diff --git a/common/linker_bios.ld.in b/common/linker_bios.ld.in
index d62871b3..882be123 100644
--- a/common/linker_bios.ld.in
+++ b/common/linker_bios.ld.in
@@ -43,6 +43,7 @@ SECTIONS
         term_write = .;
         term_backend = .;
         term_fallback = .;
+        term_notready = .;
         terms = .;
         terms_i = .;
         stage3_addr = .;
diff --git a/common/menu.c b/common/menu.c
index c8bd5bc8..f4040d45 100644
--- a/common/menu.c
+++ b/common/menu.c
@@ -625,10 +625,6 @@ noreturn void _menu(bool first_run) {
 #endif
     }
 
-    if (!first_run) {
-        term_fallback();
-    }
-
     if (bad_config == false) {
 #if defined (UEFI)
         if (init_config_disk(boot_volume)) {
tab: 248 wrap: offon