Deleted Added
full compact
2a3
> \ Copyright (c) 2006-2011 Devin Teske <devinteske@hotmail.com>
4c5
< \
---
> \
13c14
< \
---
> \
25,26c26,27
< \
< \ $FreeBSD: head/sys/boot/forth/beastie.4th 217644 2011-01-20 16:03:28Z jhb $
---
> \
> \ $FreeBSD: head/sys/boot/forth/beastie.4th 222417 2011-05-28 08:50:38Z julian $
30,31c31,32
< include /boot/screen.4th
< include /boot/frames.4th
---
> include /boot/color.4th
> include /boot/delay.4th
33c34,35
< hide
---
> variable logoX
> variable logoY
35,39c37,39
< variable menuidx
< variable menubllt
< variable menuX
< variable menuY
< variable promptwidth
---
> \ Initialize logo placement to defaults
> 46 logoX !
> 4 logoY !
41,47c41
< variable bootkey
< variable bootacpikey
< variable bootsafekey
< variable bootverbosekey
< variable bootsinglekey
< variable escapekey
< variable rebootkey
---
> : beastie-logo ( x y -- ) \ color BSD mascot (19 rows x 34 columns)
49,53c43
< 46 constant dot
<
< \ The BSD Daemon. He is 19 rows high and 34 columns wide
< : beastie-logo ( x y -- )
< 2dup at-xy ." , ," 1+
---
> 2dup at-xy ." , ," 1+
62c52
< 2dup at-xy ." `.___/` / " 1+
---
> 2dup at-xy ." `.___/` /" 1+
71c61,64
< at-xy ." `--{__________) "
---
> at-xy ." `--{__________)"
>
> \ Put the cursor back at the bottom
> 0 25 at-xy
74,93c67,90
< : beastiebw-logo ( x y -- )
< 2dup at-xy ." , ," 1+
< 2dup at-xy ." /( )`" 1+
< 2dup at-xy ." \ \___ / |" 1+
< 2dup at-xy ." /- _ `-/ '" 1+
< 2dup at-xy ." (/\/ \ \ /\" 1+
< 2dup at-xy ." / / | ` \" 1+
< 2dup at-xy ." O O ) / |" 1+
< 2dup at-xy ." `-^--'`< '" 1+
< 2dup at-xy ." (_.) _ ) /" 1+
< 2dup at-xy ." `.___/` /" 1+
< 2dup at-xy ." `-----' /" 1+
< 2dup at-xy ." <----. __ / __ \" 1+
< 2dup at-xy ." <----|====O)))==) \) /====" 1+
< 2dup at-xy ." <----' `--' `.__,' \" 1+
< 2dup at-xy ." | |" 1+
< 2dup at-xy ." \ / /\" 1+
< 2dup at-xy ." ______( (_ / \______/" 1+
< 2dup at-xy ." ,' ,-----' |" 1+
< at-xy ." `--{__________)"
---
> : beastiebw-logo ( x y -- ) \ B/W BSD mascot (19 rows x 34 columns)
>
> 2dup at-xy ." , ," 1+
> 2dup at-xy ." /( )`" 1+
> 2dup at-xy ." \ \___ / |" 1+
> 2dup at-xy ." /- _ `-/ '" 1+
> 2dup at-xy ." (/\/ \ \ /\" 1+
> 2dup at-xy ." / / | ` \" 1+
> 2dup at-xy ." O O ) / |" 1+
> 2dup at-xy ." `-^--'`< '" 1+
> 2dup at-xy ." (_.) _ ) /" 1+
> 2dup at-xy ." `.___/` /" 1+
> 2dup at-xy ." `-----' /" 1+
> 2dup at-xy ." <----. __ / __ \" 1+
> 2dup at-xy ." <----|====O)))==) \) /====|" 1+
> 2dup at-xy ." <----' `--' `.__,' \" 1+
> 2dup at-xy ." | |" 1+
> 2dup at-xy ." \ / /\" 1+
> 2dup at-xy ." ______( (_ / \______/" 1+
> 2dup at-xy ." ,' ,-----' |" 1+
> at-xy ." `--{__________)"
>
> \ Put the cursor back at the bottom
> 0 25 at-xy
96,109c93,124
< : fbsdbw-logo ( x y -- )
< 2dup at-xy ." ______" 1+
< 2dup at-xy ." | ____| __ ___ ___ " 1+
< 2dup at-xy ." | |__ | '__/ _ \/ _ \" 1+
< 2dup at-xy ." | __|| | | __/ __/" 1+
< 2dup at-xy ." | | | | | | |" 1+
< 2dup at-xy ." |_| |_| \___|\___|" 1+
< 2dup at-xy ." ____ _____ _____" 1+
< 2dup at-xy ." | _ \ / ____| __ \" 1+
< 2dup at-xy ." | |_) | (___ | | | |" 1+
< 2dup at-xy ." | _ < \___ \| | | |" 1+
< 2dup at-xy ." | |_) |____) | |__| |" 1+
< 2dup at-xy ." | | | |" 1+
< at-xy ." |____/|_____/|_____/"
---
> : fbsdbw-logo ( x y -- ) \ "FreeBSD" logo in B/W (13 rows x 21 columns)
>
> \ We used to use the beastie himself as our default... until the
> \ eventual complaint derided his reign of the advanced boot-menu.
> \
> \ This is the replacement of beastie to satiate the haters of our
> \ beloved helper-daemon (ready to track down and spear bugs with
> \ his trident and sporty sneakers; see above).
> \
> \ Since we merely just changed the default and not the default-
> \ location, below is an adjustment to the passed-in coordinates,
> \ forever influenced by the proper location of beastie himself
> \ kept as the default loader_logo_x/loader_logo_y values.
> \
> 5 + swap 6 + swap
>
> 2dup at-xy ." ______" 1+
> 2dup at-xy ." | ____| __ ___ ___ " 1+
> 2dup at-xy ." | |__ | '__/ _ \/ _ \" 1+
> 2dup at-xy ." | __|| | | __/ __/" 1+
> 2dup at-xy ." | | | | | | |" 1+
> 2dup at-xy ." |_| |_| \___|\___|" 1+
> 2dup at-xy ." ____ _____ _____" 1+
> 2dup at-xy ." | _ \ / ____| __ \" 1+
> 2dup at-xy ." | |_) | (___ | | | |" 1+
> 2dup at-xy ." | _ < \___ \| | | |" 1+
> 2dup at-xy ." | |_) |____) | |__| |" 1+
> 2dup at-xy ." | | | |" 1+
> at-xy ." |____/|_____/|_____/"
>
> \ Put the cursor back at the bottom
> 0 25 at-xy
112,140c127,148
< : print-logo ( x y -- )
< s" loader_logo" getenv
< dup -1 = if
< drop
< fbsdbw-logo
< exit
< then
< 2dup s" fbsdbw" compare-insensitive 0= if
< 2drop
< fbsdbw-logo
< exit
< then
< 2dup s" beastiebw" compare-insensitive 0= if
< 2drop
< beastiebw-logo
< exit
< then
< 2dup s" beastie" compare-insensitive 0= if
< 2drop
< beastie-logo
< exit
< then
< 2dup s" none" compare-insensitive 0= if
< 2drop
< \ no logo
< exit
< then
< 2drop
< fbsdbw-logo
---
> : orb-logo ( x y -- ) \ color Orb mascot (15 rows x 30 columns)
>
> 3 + \ beastie adjustment (see `fbsdbw-logo' comments above)
>
> 2dup at-xy ." ``` `" 1+
> 2dup at-xy ." s` `.....---.......--.``` -/" 1+
> 2dup at-xy ." +o .--` /y:` +." 1+
> 2dup at-xy ." yo`:. :o `+-" 1+
> 2dup at-xy ." y/ -/` -o/" 1+
> 2dup at-xy ." .- ::/sy+:." 1+
> 2dup at-xy ." / `-- /" 1+
> 2dup at-xy ." `: :`" 1+
> 2dup at-xy ." `: :`" 1+
> 2dup at-xy ." / /" 1+
> 2dup at-xy ." .- -." 1+
> 2dup at-xy ." -- -." 1+
> 2dup at-xy ." `:` `:`" 1+
> 2dup at-xy ." .-- `--." 1+
> at-xy ." .---.....----."
>
> \ Put the cursor back at the bottom
> 0 25 at-xy
143,149c151,172
< : acpipresent? ( -- flag )
< s" hint.acpi.0.rsdp" getenv
< dup -1 = if
< drop false exit
< then
< 2drop
< true
---
> : orbbw-logo ( x y -- ) \ B/W Orb mascot (15 rows x 32 columns)
>
> 3 + \ beastie adjustment (see `fbsdbw-logo' comments above)
>
> 2dup at-xy ." ``` `" 1+
> 2dup at-xy ." s` `.....---.......--.``` -/" 1+
> 2dup at-xy ." +o .--` /y:` +." 1+
> 2dup at-xy ." yo`:. :o `+-" 1+
> 2dup at-xy ." y/ -/` -o/" 1+
> 2dup at-xy ." .- ::/sy+:." 1+
> 2dup at-xy ." / `-- /" 1+
> 2dup at-xy ." `: :`" 1+
> 2dup at-xy ." `: :`" 1+
> 2dup at-xy ." / /" 1+
> 2dup at-xy ." .- -." 1+
> 2dup at-xy ." -- -." 1+
> 2dup at-xy ." `:` `:`" 1+
> 2dup at-xy ." .-- `--." 1+
> at-xy ." .---.....----."
>
> \ Put the cursor back at the bottom
> 0 25 at-xy
152,157c175,194
< : acpienabled? ( -- flag )
< s" hint.acpi.0.disabled" getenv
< dup -1 <> if
< s" 0" compare 0<> if
< false exit
< then
---
> \ This function draws any number of beastie logos at (loader_logo_x,
> \ loader_logo_y) if defined, else (46,4) (to the right of the menu). To choose
> \ your beastie, set the variable `loader_logo' to the respective logo name.
> \
> \ Currently available:
> \
> \ NAME DESCRIPTION
> \ beastie Color ``Helper Daemon'' mascot (19 rows x 34 columns)
> \ beastiebw B/W ``Helper Daemon'' mascot (19 rows x 34 columns)
> \ fbsdbw "FreeBSD" logo in B/W (13 rows x 21 columns)
> \ orb Color ``Orb'' mascot (15 rows x 30 columns)
> \ orbbw B/W ``Orb'' mascot (15 rows x 32 columns) (default)
> \
> \ NOTE: Setting `loader_logo' to an undefined value (such as "none") will
> \ prevent beastie from being drawn.
> \
> : draw-beastie ( -- ) \ at (loader_logo_x,loader_logo_y), else (46,4)
>
> s" loader_logo_x" getenv dup -1 <> if
> ?number 1 = if logoX ! then
161,185c198,200
< true
< ;
<
< : printmenuitem ( -- n )
< menuidx @
< 1+ dup
< menuidx !
< menuY @ + dup menuX @ swap at-xy
< menuidx @ .
< menuX @ 1+ swap at-xy
< menubllt @ emit
< menuidx @ 48 +
< ;
<
< : beastie-menu ( -- )
< 0 menuidx !
< dot menubllt !
< 8 menuY !
< 5 menuX !
< clear
< 46 4 print-logo
< 42 20 2 2 box
< 13 6 at-xy ." Welcome to FreeBSD!"
< printmenuitem ." Boot FreeBSD [default]" bootkey !
< s" arch-i386" environment? if
---
> s" loader_logo_y" getenv dup -1 <> if
> ?number 1 = if logoY ! then
> else
187,193c202,207
< acpipresent? if
< printmenuitem ." Boot FreeBSD with ACPI " bootacpikey !
< acpienabled? if
< ." disabled"
< else
< ." enabled"
< then
---
> then
>
> s" loader_logo" getenv dup -1 = if
> logoX @ logoY @
> loader_color? if
> orb-logo
195,198c209
< menuidx @
< 1+
< menuidx !
< -2 bootacpikey !
---
> orbbw-logo
200,201c211
< else
< -2 bootacpikey !
---
> drop exit
203,213d212
< printmenuitem ." Boot FreeBSD in Safe Mode" bootsafekey !
< printmenuitem ." Boot FreeBSD in single user mode" bootsinglekey !
< printmenuitem ." Boot FreeBSD with verbose logging" bootverbosekey !
< printmenuitem ." Escape to loader prompt" escapekey !
< printmenuitem ." Reboot" rebootkey !
< menuX @ 20 at-xy
< ." Select option, [Enter] for default"
< menuX @ 21 at-xy
< s" or [Space] to pause timer " dup 2 - promptwidth !
< type
< ;
215,232c214,235
< : tkey
< seconds +
< begin 1 while
< over 0<> if
< dup seconds u< if
< drop
< -1
< exit
< then
< menuX @ promptwidth @ + 21 at-xy dup seconds - .
< then
< key? if
< drop
< key
< exit
< then
< 50 ms
< repeat
---
> 2dup s" beastie" compare-insensitive 0= if
> logoX @ logoY @ beastie-logo
> 2drop exit
> then
> 2dup s" beastiebw" compare-insensitive 0= if
> logoX @ logoY @ beastiebw-logo
> 2drop exit
> then
> 2dup s" fbsdbw" compare-insensitive 0= if
> logoX @ logoY @ fbsdbw-logo
> 2drop exit
> then
> 2dup s" orb" compare-insensitive 0= if
> logoX @ logoY @ orb-logo
> 2drop exit
> then
> 2dup s" orbbw" compare-insensitive 0= if
> logoX @ logoY @ orbbw-logo
> 2drop exit
> then
>
> 2drop
235c238,249
< set-current
---
> : clear-beastie ( -- ) \ clears beastie from the screen
> logoX @ logoY @
> 2dup at-xy 34 spaces 1+ 2dup at-xy 34 spaces 1+
> 2dup at-xy 34 spaces 1+ 2dup at-xy 34 spaces 1+
> 2dup at-xy 34 spaces 1+ 2dup at-xy 34 spaces 1+
> 2dup at-xy 34 spaces 1+ 2dup at-xy 34 spaces 1+
> 2dup at-xy 34 spaces 1+ 2dup at-xy 34 spaces 1+
> 2dup at-xy 34 spaces 1+ 2dup at-xy 34 spaces 1+
> 2dup at-xy 34 spaces 1+ 2dup at-xy 34 spaces 1+
> 2dup at-xy 34 spaces 1+ 2dup at-xy 34 spaces 1+
> 2dup at-xy 34 spaces 1+ 2dup at-xy 34 spaces 1+
> 2dup at-xy 34 spaces 2drop
237c251,255
< : beastie-start
---
> \ Put the cursor back at the bottom
> 0 25 at-xy
> ;
>
> : beastie-start ( -- ) \ starts the menu
246,250c264,267
< beastie-menu
< s" autoboot_delay" getenv
< dup -1 = if
< drop
< 10
---
>
> s" loader_delay" getenv
> -1 = if
> s" include /boot/menu.rc" evaluate
252,255c269,273
< 2dup s" -1" compare 0= if
< 0 boot
< then
< 0 s>d 2swap >number 2drop drop
---
> drop
> ." Loading Menu (Ctrl-C to Abort)" cr
> s" set delay_command='include /boot/menu.rc'" evaluate
> s" set delay_showdots" evaluate
> delay_execute
257,301d274
< begin
< dup tkey
< 0 25 at-xy
< dup 32 = if nip 0 swap then
< dup -1 = if 0 boot then
< dup 13 = if 0 boot then
< dup bootkey @ = if 0 boot then
< dup bootacpikey @ = if
< acpienabled? if
< s" 1" s" hint.acpi.0.disabled" setenv
< s" 1" s" loader.acpi_disabled_by_user" setenv
< else
< s" 0" s" hint.acpi.0.disabled" setenv
< then
< 0 boot
< then
< dup bootsafekey @ = if
< s" arch-i386" environment? if
< drop
< s" 1" s" hint.acpi.0.disabled" setenv
< s" 1" s" loader.acpi_disabled_by_user" setenv
< s" 1" s" hint.apic.0.disabled" setenv
< then
< s" 0" s" hw.ata.ata_dma" setenv
< s" 0" s" hw.ata.atapi_dma" setenv
< s" 0" s" hw.ata.wc" setenv
< s" 0" s" hw.eisa_slots" setenv
< s" 1" s" hint.kbdmux.0.disabled" setenv
< 0 boot
< then
< dup bootverbosekey @ = if
< s" YES" s" boot_verbose" setenv
< 0 boot
< then
< dup bootsinglekey @ = if
< s" YES" s" boot_single" setenv
< 0 boot
< then
< dup escapekey @ = if
< 2drop
< s" NO" s" autoboot_delay" setenv
< exit
< then
< rebootkey @ = if 0 reboot then
< again
303,304d275
<
< previous