[SeaBIOS] [PATCH] Support custom boot menu prompt and custom boot menu key.

Kevin O'Connor kevin at koconnor.net
Fri Aug 2 20:18:03 CEST 2013


Allow configuration of the boot menu prompt and boot menu key (via the
romfile interface).  Some machines don't have an F12 key, so make this
configurable.

Signed-off-by: Kevin O'Connor <kevin at koconnor.net>
---
 src/boot.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/boot.c b/src/boot.c
index d421a65..7bcb4b6 100644
--- a/src/boot.c
+++ b/src/boot.c
@@ -413,14 +413,16 @@ interactive_bootmenu(void)
     while (get_keystroke(0) >= 0)
         ;
 
-    printf("\nPress F12 for boot menu.\n\n");
+    char *bootmsg = romfile_loadfile("etc/boot-menu-message", NULL);
+    int menukey = romfile_loadint("etc/boot-menu-key", 0x86);
+    printf(bootmsg ?: "\nPress F12 for boot menu.\n\n");
+    free(bootmsg);
 
     u32 menutime = romfile_loadint("etc/boot-menu-wait", DEFAULT_BOOTMENU_WAIT);
     enable_bootsplash();
     int scan_code = get_keystroke(menutime);
     disable_bootsplash();
-    if (scan_code != 0x86)
-        /* not F12 */
+    if (scan_code != menukey)
         return;
 
     while (get_keystroke(0) >= 0)
-- 
1.7.11.7




More information about the SeaBIOS mailing list