menu-commands.4th (256281) | menu-commands.4th (262701) |
---|---|
1\ Copyright (c) 2006-2012 Devin Teske <dteske@FreeBSD.org> | 1\ Copyright (c) 2006-2013 Devin Teske <dteske@FreeBSD.org> |
2\ All rights reserved. 3\ 4\ Redistribution and use in source and binary forms, with or without 5\ modification, are permitted provided that the following conditions 6\ are met: 7\ 1. Redistributions of source code must retain the above copyright 8\ notice, this list of conditions and the following disclaimer. 9\ 2. Redistributions in binary form must reproduce the above copyright --- 7 unchanged lines hidden (view full) --- 17\ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18\ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19\ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20\ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21\ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23\ SUCH DAMAGE. 24\ | 2\ All rights reserved. 3\ 4\ Redistribution and use in source and binary forms, with or without 5\ modification, are permitted provided that the following conditions 6\ are met: 7\ 1. Redistributions of source code must retain the above copyright 8\ notice, this list of conditions and the following disclaimer. 9\ 2. Redistributions in binary form must reproduce the above copyright --- 7 unchanged lines hidden (view full) --- 17\ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18\ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19\ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20\ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21\ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23\ SUCH DAMAGE. 24\ |
25\ $FreeBSD: stable/10/sys/boot/forth/menu-commands.4th 243660 2012-11-28 18:35:46Z dteske $ | 25\ $FreeBSD: stable/10/sys/boot/forth/menu-commands.4th 262701 2014-03-03 07:16:39Z dteske $ |
26 27marker task-menu-commands.4th 28 29include /boot/menusets.4th 30 31variable kernel_state 32variable root_state | 26 27marker task-menu-commands.4th 28 29include /boot/menusets.4th 30 31variable kernel_state 32variable root_state |
330 kernel_state ! 340 root_state ! |
|
33 34\ 35\ Boot 36\ 37 38: init_boot ( N -- N ) 39 dup 40 s" boot_single" getenv -1 <> if --- 233 unchanged lines hidden (view full) --- 274\ Kernel 275\ 276 277: init_kernel ( N -- N ) 278 kernel_state @ ( n -- n k ) 279 init_cyclestate ( n k -- n ) 280; 281 | 35 36\ 37\ Boot 38\ 39 40: init_boot ( N -- N ) 41 dup 42 s" boot_single" getenv -1 <> if --- 233 unchanged lines hidden (view full) --- 276\ Kernel 277\ 278 279: init_kernel ( N -- N ) 280 kernel_state @ ( n -- n k ) 281 init_cyclestate ( n k -- n ) 282; 283 |
282: cycle_kernel ( N -- N TRUE ) 283 cycle_menuitem 284 menu-redraw | 284: activate_kernel ( N -- N ) 285 dup cycle_stateN @ ( n -- n n2 ) 286 dup kernel_state ! ( n n2 -- n n2 ) \ copy for re-initialization 287 48 + ( n n2 -- n n2' ) \ kernel_state to ASCII num |
285 | 288 |
286 \ Now we're going to make the change effective 287 288 dup cycle_stateN @ 289 dup kernel_state ! \ save a copy for re-initialization 290 48 + \ convert to ASCII numeral 291 | |
292 s" set kernel=${kernel_prefix}${kernel[N]}${kernel_suffix}" | 289 s" set kernel=${kernel_prefix}${kernel[N]}${kernel_suffix}" |
293 36 +c! \ replace 'N' with ASCII numeral 294 evaluate \ sets $kernel to full kernel-path | 290 36 +c! ( n n2 c-addr/u -- n c-addr/u ) \ 'N' to ASCII num 291 evaluate ( n c-addr/u -- n ) \ sets $kernel to full kernel-path 292; |
295 | 293 |
296 TRUE \ loop menu again | 294: cycle_kernel ( N -- N TRUE ) 295 cycle_menuitem \ cycle cycle_stateN to next value 296 activate_kernel \ apply current cycle_stateN 297 menu-redraw \ redraw menu 298 TRUE \ loop menu again |
297; 298 299\ 300\ Root 301\ 302 303: init_root ( N -- N ) 304 root_state @ ( n -- n k ) 305 init_cyclestate ( n k -- n ) 306; 307 | 299; 300 301\ 302\ Root 303\ 304 305: init_root ( N -- N ) 306 root_state @ ( n -- n k ) 307 init_cyclestate ( n k -- n ) 308; 309 |
308: cycle_root ( N -- N TRUE ) 309 cycle_menuitem 310 menu-redraw | 310: activate_root ( N -- N ) 311 dup cycle_stateN @ ( n -- n n2 ) 312 dup root_state ! ( n n2 -- n n2 ) \ copy for re-initialization 313 48 + ( n n2 -- n n2' ) \ root_state to ASCII num |
311 | 314 |
312 \ Now we're going to make the change effective 313 314 dup cycle_stateN @ 315 dup root_state ! \ save a copy for re-initialization 316 48 + \ convert to ASCII numeral 317 | |
318 s" set root=${root_prefix}${root[N]}${root_suffix}" | 315 s" set root=${root_prefix}${root[N]}${root_suffix}" |
319 30 +c! \ replace 'N' with ASCII numeral 320 evaluate \ sets $root to full root-path | 316 30 +c! ( n n2 c-addr/u -- n c-addr/u ) \ 'N' to ASCII num 317 evaluate ( n c-addr/u -- n ) \ sets $root to full kernel-path 318; |
321 | 319 |
322 TRUE \ loop menu again | 320: cycle_root ( N -- N TRUE ) 321 cycle_menuitem \ cycle cycle_stateN to next value 322 activate_root \ apply current cycle_stateN 323 menu-redraw \ redraw menu 324 TRUE \ loop menu again |
323; 324 325\ 326\ Menusets 327\ 328 329: goto_menu ( N M -- N TRUE ) 330 menu-unset --- 16 unchanged lines hidden --- | 325; 326 327\ 328\ Menusets 329\ 330 331: goto_menu ( N M -- N TRUE ) 332 menu-unset --- 16 unchanged lines hidden --- |