1 \ *****************************************************************************
2 \ * Copyright (c) 2004, 2008 IBM Corporation
3 \ * All rights reserved.
4 \ * This program and the accompanying materials
5 \ * are made available under the terms of the BSD License
6 \ * which accompanies this distribution, and is available at
7 \ * http://www.opensource.org/licenses/bsd-license.php
10 \ * IBM Corporation - initial implementation
11 \ ****************************************************************************/
14 s" Executing following boot-command: "
15 boot-command $cat nvramlog-write-string-cr
16 s" boot-command" evaluate \ get boot command
17 ['] evaluate catch ?dup IF \ and execute it
18 ." boot attempt returned: "
19 abort"-str @ count type cr
20 nip nip \ drop string from 1st evaluate
25 \ Note: The following ESC sequences has to be handled:
29 \ Reads and converts the function key.
31 : (function-key) ( -- n )
41 \ Checks if an ESC sequence occurs.
42 : (esc-sequence) ( -- n )
45 4f OF (function-key) ENDOF
47 key key (function-key) ENDOF
54 s" An 's' has been pressed. Entering Open Firmware Prompt"
55 nvramlog-write-string-cr
59 of-prompt? not auto-boot? and IF
65 #include "sms/sms-load.fs"
68 \ Watchdog will be rearmed during load if use-load-watchdog variable is TRUE
69 TRUE VALUE use-load-watchdog?
77 BEGIN parse-word dup WHILE
78 boot-dev-no my-boot-dev = IF
80 ['] evaluate catch ?dup IF \ and execute it
81 ." boot attempt returned: "
82 abort"-str @ count type cr
90 my-boot-dev 1 + to my-boot-dev
91 REPEAT 2drop 0 0 load-list 2!
97 \ Remove multiple F12 key presses if any
103 BEGIN parse-word dup WHILE
104 my-boot-dev (u.) s" . " $cat type 2dup type ." : " de-alias type cr
105 my-boot-dev 1 + to my-boot-dev
106 REPEAT 2drop 0 0 load-list 2!
108 cr BEGIN KEY dup emit
110 dup 30 - to digit-val
111 boot-dev-no a * digit-val + to boot-dev-no
115 boot-dev-no my-boot-dev < IF
116 s" boot-selected " s" $bootdev" evaluate $cat strdup evaluate
118 ." Invalid choice!" cr
124 ." Select boot device:" cr cr
125 s" boot-start " s" $bootdev" evaluate $cat strdup evaluate
128 : boot-menu-enabled? ( -- true|false )
129 s" qemu,boot-menu" get-chosen IF
139 34 = >r 32 = r> and IF
149 [char] s OF (s-pressed) ENDOF
154 f12-pressed? boot-menu-enabled? and IF
169 disable-watchdog FALSE to use-load-watchdog?