:: commit d0124c5bedf0e475bccf09394342e44e3a5a40a3

iillis <170103872+iillis@users.noreply.github.com> — 2024-06-07 21:31

parents: 6ae857bc4c

Setting different error message for boot failure when booting from menu or booting from the editor

diff --git a/common/lib/panic.s2.c b/common/lib/panic.s2.c
index 403d7dfe..77d32038 100644
--- a/common/lib/panic.s2.c
+++ b/common/lib/panic.s2.c
@@ -52,7 +52,12 @@ noreturn void panic(bool allow_menu, const char *fmt, ...) {
       efi_boot_services_exited == false &&
 #endif
       allow_menu == true) {
-        print("Press a key to return to menu.");
+        if (booting_from_editor == true) {
+            print("Press a key to return to editor.");
+        }
+        else {
+            print("Press a key to return to menu.");
+        }
 
         getchar();
 
diff --git a/common/linker_bios.ld.in b/common/linker_bios.ld.in
index 1a557d29..71489f1e 100644
--- a/common/linker_bios.ld.in
+++ b/common/linker_bios.ld.in
@@ -36,6 +36,7 @@ SECTIONS
         full_map = .;
         getchar = .;
         menu = .;
+        booting_from_editor = .;
         flanterm_write = .;
         term_backend = .;
         term_fallback = .;
diff --git a/common/menu.c b/common/menu.c
index 3c9a8d86..c54f4a0c 100644
--- a/common/menu.c
+++ b/common/menu.c
@@ -38,7 +38,7 @@ EFI_GUID limine_efi_vendor_guid =
 
 static char *menu_branding = NULL;
 static char *menu_branding_colour = NULL;
-static no_unwind bool booting_from_editor = false;
+no_unwind bool booting_from_editor = false;
 static no_unwind char saved_orig_entry[EDITOR_MAX_BUFFER_SIZE];
 static no_unwind char saved_title[64];
 
diff --git a/common/menu.h b/common/menu.h
index 2e215531..38f48f6f 100644
--- a/common/menu.h
+++ b/common/menu.h
@@ -15,4 +15,6 @@ noreturn void boot(char *config);
 
 char *config_entry_editor(const char *title, const char *orig_entry);
 
+extern bool booting_from_editor;
+
 #endif
tab: 248 wrap: offon