Patch 1 applies a small improvement to user experience, as suggested by Matt DeVillier. Then patch 2 makes the switch.
Paolo Bonzini (2): boot: delay exiting boot if menu key is ESC boot: switch default menu key to ESC
src/boot.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
If the menu key is ESC, do not restart boot unless 1.5 seconds have passed. Otherwise users (trained by years of repeatedly hitting keys to enter the BIOS) will end up hitting ESC multiple times and immediately booting the primary boot device.
Suggested-by: Matt DeVillier matt.devillier@gmail.com Signed-off-by: Paolo Bonzini pbonzini@redhat.com --- src/boot.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/boot.c b/src/boot.c index f23e9e1..3aab8d4 100644 --- a/src/boot.c +++ b/src/boot.c @@ -486,9 +486,15 @@ interactive_bootmenu(void) , strtcpy(desc, pos->description, ARRAY_SIZE(desc))); }
- // Get key press + // Get key press. If the menu key is ESC, do not restart boot unless + // 1.5 seconds have passed. Otherwise users (trained by years of + // repeatedly hitting keys to enter the BIOS) will end up hitting ESC + // multiple times and immediately booting the primary boot device. + int esc_accepted_time = irqtimer_calc(menukey == 1 ? 1500 : 0); for (;;) { scan_code = get_keystroke(1000); + if (scan_code == 1 && !irqtimer_check(esc_accepted_time)) + continue; if (scan_code >= 1 && scan_code <= maxmenu+1) break; }
On 3/12/2015 9:49 AM, Paolo Bonzini wrote:
If the menu key is ESC, do not restart boot unless 1.5 seconds have passed. Otherwise users (trained by years of repeatedly hitting keys to enter the BIOS) will end up hitting ESC multiple times and immediately booting the primary boot device.
Suggested-by: Matt DeVillier matt.devillier@gmail.com Signed-off-by: Paolo Bonzini pbonzini@redhat.com
src/boot.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/boot.c b/src/boot.c index f23e9e1..3aab8d4 100644 --- a/src/boot.c +++ b/src/boot.c @@ -486,9 +486,15 @@ interactive_bootmenu(void) , strtcpy(desc, pos->description, ARRAY_SIZE(desc))); }
- // Get key press
- // Get key press. If the menu key is ESC, do not restart boot unless
- // 1.5 seconds have passed. Otherwise users (trained by years of
- // repeatedly hitting keys to enter the BIOS) will end up hitting ESC
- // multiple times and immediately booting the primary boot device.
- int esc_accepted_time = irqtimer_calc(menukey == 1 ? 1500 : 0); for (;;) { scan_code = get_keystroke(1000);
if (scan_code == 1 && !irqtimer_check(esc_accepted_time))
}continue; if (scan_code >= 1 && scan_code <= maxmenu+1) break;
Is there are reason to keep the use of ESC to exit the boot menu at all? Is that a feature that users use/expect? 1.5s may sound like a lot of time, but with many using a TV as the display these days, it can take longer than that to even init/sync the screen.
On 12/03/2015 16:58, Matt DeVillier wrote:
Is there are reason to keep the use of ESC to exit the boot menu at all?
It's a fairly obvious user interface. If you don't know what to choose, press ESC.
Is that a feature that users use/expect? 1.5s may sound like a lot of time, but with many using a TV as the display these days, it can take longer than that to even init/sync the screen.
If that is a problem, people can still apply something like your patch. But I don't think it's the common case.
Paolo
On 03/12/2015 12:20 PM, Paolo Bonzini wrote:
On 12/03/2015 16:58, Matt DeVillier wrote:
Is there are reason to keep the use of ESC to exit the boot menu at all?
It's a fairly obvious user interface. If you don't know what to choose, press ESC.
Is that a feature that users use/expect? 1.5s may sound like a lot of time, but with many using a TV as the display these days, it can take longer than that to even init/sync the screen.
If that is a problem, people can still apply something like your patch. But I don't think it's the common case.
Paolo
SeaBIOS mailing list SeaBIOS@seabios.org http://www.seabios.org/mailman/listinfo/seabios
Any chance SeaBIOS could emit a short chirp when it receives the ESC to boot menu request? That would solve the "hammering blindly at the keys" problem while the video is initialising, at least on systems with a PC speaker/buzzer still installed.
On some platforms, F12 may be hard to access; for example, on OS X machines F9-F12 have been intercepted by the OS for a long time, and on newer OS X releases function keys are basically gone for good.
Which keys are and are not available depends on the client, not on the server, but only function keys are usually trapped by terminals. Hence, using ESC for the boot menu avoids the problems associated with F12.
Suggested-by: Kevin O'Connor kevin@koconnor.net Signed-off-by: Paolo Bonzini pbonzini@redhat.com --- src/boot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/boot.c b/src/boot.c index 3aab8d4..d6b1fb7 100644 --- a/src/boot.c +++ b/src/boot.c @@ -459,8 +459,8 @@ interactive_bootmenu(void) ;
char *bootmsg = romfile_loadfile("etc/boot-menu-message", NULL); - int menukey = romfile_loadint("etc/boot-menu-key", 0x86); - printf("%s", bootmsg ?: "\nPress F12 for boot menu.\n\n"); + int menukey = romfile_loadint("etc/boot-menu-key", 1); + printf("%s", bootmsg ?: "\nPress ESC for boot menu.\n\n"); free(bootmsg);
u32 menutime = romfile_loadint("etc/boot-menu-wait", DEFAULT_BOOTMENU_WAIT);
On Thu, Mar 12, 2015 at 03:49:02PM +0100, Paolo Bonzini wrote:
On some platforms, F12 may be hard to access; for example, on OS X machines F9-F12 have been intercepted by the OS for a long time, and on newer OS X releases function keys are basically gone for good.
Which keys are and are not available depends on the client, not on the server, but only function keys are usually trapped by terminals. Hence, using ESC for the boot menu avoids the problems associated with F12.
Suggested-by: Kevin O'Connor kevin@koconnor.net Signed-off-by: Paolo Bonzini pbonzini@redhat.com
Thanks. The file docs/Runtime_config.md needs to be updated as well.
Otherwise, this patch and the other one looks good to me.
-Kevin