Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \ openfirmware forth boot menu
- \ boot bootmenu.of
- input-device input
- output-device output
- \ stolen from quit
- \ stdout @ 0= if
- \ false to _normal-boot install-console
- \ then
- true to use-console? \ false to ignore-output? \ stdout-dump \ sign-on state
- \ off abort"-str off clearlocals false to xoff? false to xoff-filter?
- decimal
- : defaultkey ( secs defkey -- key | defaultkey )
- swap ( secs defkey -- defkey secs )
- 1000 * ( secs defkey -- defkey inms )
- get-msecs + ( secs defkey inms -- defkey maxms )
- begin ( defkey maxms -- )
- key? ( defkey maxms -- flag)
- 0<>
- if ( defkey maxms flag -- defkey maxms )
- 2drop ( defkey maxms -- )
- key ( -- key )
- true ( key -- key true )
- else ( defkey maxms flag -- defkey maxms )
- dup ( defkey maxms -- defkey maxms maxms )
- get-msecs ( defkey maxms maxms -- defkey maxms maxms ms )
- < ( defkey maxms maxms ms -- defkey maxms flag )
- if ( defkey maxms flag -- defkey maxms )
- drop ( defkey maxms -- defkey )
- true ( defkey -- defkey true )
- else ( defkey maxms flag -- defkey maxms )
- false ( defkey maxms -- defkey maxms )
- then
- then
- until
- ;
- : testleave
- 100 0 do
- i 20
- = ?leave
- i . cr
- loop
- ;
- reset-screen
- 12 emit erase-screen
- blink-screen
- \ invert-screen
- \ menutop
- cr cr cr 10 spaces
- 15 0 do 176 emit loop .( Boot Menu ) 15 0 do 176 emit loop cr
- \ menutop
- 10 spaces .( # q : Quit ) cr
- 10 spaces .( # n : /Netbsd ) cr
- 10 spaces .( # o : /netbsd.old ) cr
- 10 spaces .( # m : mac-boot ) cr
- 10 spaces .( # t : telnet ) cr
- 10 spaces .( # s : shut-down ) cr
- 10 spaces .( # r : Reset-OF ) cr
- \ menu bottom
- 10 spaces 41 0 do 176 emit loop cr
- 12 ascii m defaultkey
- invert-screen
- case
- ascii n of s" boot hd:,\ofwboot.xcf hd:9,/netbsd" eval endof
- ascii o of s" boot hd:,\ofwboot.xcf hd:9,/netbsd.old" eval endof
- ascii t of s" enet:telnet,192.168.199.188 " io quit endof
- ascii s of shut-down endof
- ascii m of mac-boot endof
- ascii q of quit endof
- ascii r of
- \ setenv default-router-ip 192.168.199.177
- \ setenv boot-command boot hd:,\bootmenu.of
- \ ^^^ nowork
- s" setenv default-router-ip 192.168.199.177" eval
- s" setenv boot-command boot hd:,\bootmenu.of" eval
- clear
- reset-all
- endof
- endcase
- \ delete here and below since I"m adding these remarks on pastebin, presently.
- \ this represents I believe the better version of menu that one doesn't have to press
- \ a key it will timeout than bootmenu.of does which is also like that
- \ both should work but you know of course that I haven't tested this recently
- \ this one I challenged msyelf a little more bc I was still
- \ strong with the FORTH lololol
- \ but it was more like Dune 'cause'like
- \ I don't say it like that tho.
Add Comment
Please, Sign In to add comment