aboutsummaryrefslogtreecommitdiff
path: root/slof
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2016-05-25 13:00:26 +0200
committerAlexey Kardashevskiy <aik@ozlabs.ru>2016-06-01 17:51:20 +1000
commit705b46012bfb3d7615f5839916f3dbdc42b1b550 (patch)
treea897ab3c9faba498820d26f07741b1c5b2af33eb /slof
parente78980bd0c81d30792b81cc403042586abb1fe79 (diff)
downloadSLOF-705b46012bfb3d7615f5839916f3dbdc42b1b550.zip
SLOF-705b46012bfb3d7615f5839916f3dbdc42b1b550.tar.gz
SLOF-705b46012bfb3d7615f5839916f3dbdc42b1b550.tar.bz2
Improve F12 key handling in boot menu
When hitting F12 during boot multiple times (to make sure that you get to the boot menu), it is sometimes impossible to select a menu entry from the boot list - you always get the output "Invalid choice!" and are dropped to the SLOF prompt. The "boot-start" function already has some code at the beginning to flush the keyboard input to get rid of multiple F12 keys. But if you accidentially press F12 again after that code has been executed, the code that checks the input for the selected boot menu entry can not handle it and gets confused. Fix this issue by flushing the keyboard input queue as late as possible (i.e. after printing the boot menu items, since that could also take a short while when the list is long and when using slow VGA text output), and by ignoring all key sequences that start with an ESC (like the F12 key ESC sequence) in the main keyboard input loop there. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Diffstat (limited to 'slof')
-rw-r--r--slof/fs/start-up.fs21
1 files changed, 15 insertions, 6 deletions
diff --git a/slof/fs/start-up.fs b/slof/fs/start-up.fs
index fb88f76..dc5d1ed 100644
--- a/slof/fs/start-up.fs
+++ b/slof/fs/start-up.fs
@@ -91,18 +91,27 @@ TRUE VALUE use-load-watchdog?
;
: boot-start
- \ Remove multiple F12 key presses if any
- BEGIN key? WHILE
- key drop
- REPEAT
-
decimal
BEGIN parse-word dup WHILE
my-boot-dev (u.) s" . " $cat type 2dup type ." : " de-alias type cr
my-boot-dev 1 + to my-boot-dev
REPEAT 2drop 0 0 load-list 2!
- cr BEGIN KEY dup emit
+ \ Clear pending keys (to remove multiple F12 key presses for example)
+ BEGIN key? WHILE
+ key drop
+ REPEAT
+
+ cr
+ BEGIN
+ KEY
+ dup 1b = IF \ ESC sequence ... could be yet another F12 key press
+ BEGIN key? WHILE
+ key drop
+ REPEAT
+ ELSE
+ dup emit
+ THEN
dup isdigit IF
dup 30 - to digit-val
boot-dev-no a * digit-val + to boot-dev-no