svn commit: r222604 - in projects/pseries: boot/common boot/forth
boot/i386/loader boot/ia64/common boot/pc98/loader
boot/powerpc/ofw boot/powerpc/ps3 boot/sparc64/loader cam/ata
cddl/compat/openso...
Nathan Whitehorn
nwhitehorn at FreeBSD.org
Thu Jun 2 13:38:03 UTC 2011
Author: nwhitehorn
Date: Thu Jun 2 13:38:03 2011
New Revision: 222604
URL: http://svn.freebsd.org/changeset/base/222604
Log:
IFC
Added:
projects/pseries/boot/forth/beastie.4th.8
- copied unchanged from r222603, head/sys/boot/forth/beastie.4th.8
projects/pseries/boot/forth/brand.4th
- copied unchanged from r222603, head/sys/boot/forth/brand.4th
projects/pseries/boot/forth/brand.4th.8
- copied unchanged from r222603, head/sys/boot/forth/brand.4th.8
projects/pseries/boot/forth/check-password.4th
- copied unchanged from r222603, head/sys/boot/forth/check-password.4th
projects/pseries/boot/forth/check-password.4th.8
- copied unchanged from r222603, head/sys/boot/forth/check-password.4th.8
projects/pseries/boot/forth/color.4th
- copied unchanged from r222603, head/sys/boot/forth/color.4th
projects/pseries/boot/forth/color.4th.8
- copied unchanged from r222603, head/sys/boot/forth/color.4th.8
projects/pseries/boot/forth/delay.4th
- copied unchanged from r222603, head/sys/boot/forth/delay.4th
projects/pseries/boot/forth/delay.4th.8
- copied unchanged from r222603, head/sys/boot/forth/delay.4th.8
projects/pseries/boot/forth/menu-commands.4th
- copied unchanged from r222603, head/sys/boot/forth/menu-commands.4th
projects/pseries/boot/forth/menu.4th
- copied unchanged from r222603, head/sys/boot/forth/menu.4th
projects/pseries/boot/forth/menu.4th.8
- copied unchanged from r222603, head/sys/boot/forth/menu.4th.8
projects/pseries/boot/forth/menu.rc
- copied unchanged from r222603, head/sys/boot/forth/menu.rc
projects/pseries/boot/forth/shortcuts.4th
- copied unchanged from r222603, head/sys/boot/forth/shortcuts.4th
projects/pseries/boot/forth/version.4th
- copied unchanged from r222603, head/sys/boot/forth/version.4th
projects/pseries/boot/forth/version.4th.8
- copied unchanged from r222603, head/sys/boot/forth/version.4th.8
projects/pseries/dev/ath/ath_dfs/
- copied from r222603, head/sys/dev/ath/ath_dfs/
projects/pseries/dev/ath/if_athdfs.h
- copied unchanged from r222603, head/sys/dev/ath/if_athdfs.h
projects/pseries/dev/cxgbe/common/jhash.h
- copied unchanged from r222603, head/sys/dev/cxgbe/common/jhash.h
projects/pseries/dev/cxgbe/t4_l2t.c
- copied unchanged from r222603, head/sys/dev/cxgbe/t4_l2t.c
projects/pseries/dev/cxgbe/t4_l2t.h
- copied unchanged from r222603, head/sys/dev/cxgbe/t4_l2t.h
projects/pseries/dev/iicbus/ad7417.c
- copied unchanged from r222603, head/sys/dev/iicbus/ad7417.c
projects/pseries/dev/usb/serial/umcs7840.c
- copied unchanged from r222603, head/sys/dev/usb/serial/umcs7840.c
projects/pseries/dev/usb/serial/umcs7840.h
- copied unchanged from r222603, head/sys/dev/usb/serial/umcs7840.h
projects/pseries/modules/usb/umcs7840/
- copied from r222603, head/sys/modules/usb/umcs7840/
projects/pseries/powerpc/powermac/powermac_thermal.c
- copied unchanged from r222603, head/sys/powerpc/powermac/powermac_thermal.c
projects/pseries/powerpc/powermac/powermac_thermal.h
- copied unchanged from r222603, head/sys/powerpc/powermac/powermac_thermal.h
Modified:
projects/pseries/boot/common/Makefile.inc
projects/pseries/boot/forth/beastie.4th
projects/pseries/boot/forth/loader.4th
projects/pseries/boot/forth/loader.conf.5
projects/pseries/boot/forth/loader.rc
projects/pseries/boot/forth/support.4th
projects/pseries/boot/i386/loader/Makefile
projects/pseries/boot/ia64/common/Makefile
projects/pseries/boot/pc98/loader/Makefile
projects/pseries/boot/powerpc/ofw/Makefile
projects/pseries/boot/powerpc/ps3/Makefile
projects/pseries/boot/sparc64/loader/Makefile
projects/pseries/cam/ata/ata_da.c
projects/pseries/cddl/compat/opensolaris/kern/opensolaris_vfs.c
projects/pseries/conf/files
projects/pseries/conf/files.powerpc
projects/pseries/contrib/dev/acpica/changes.txt
projects/pseries/contrib/dev/acpica/debugger/dbexec.c
projects/pseries/contrib/dev/acpica/debugger/dbinput.c
projects/pseries/contrib/dev/acpica/debugger/dbutils.c
projects/pseries/contrib/dev/acpica/debugger/dbxface.c
projects/pseries/contrib/dev/acpica/include/acconfig.h
projects/pseries/contrib/dev/acpica/include/acdebug.h
projects/pseries/contrib/dev/acpica/include/acglobal.h
projects/pseries/contrib/dev/acpica/include/aclocal.h
projects/pseries/contrib/dev/acpica/include/acpiosxf.h
projects/pseries/contrib/dev/acpica/include/acpixf.h
projects/pseries/contrib/dev/acpica/include/acpredef.h
projects/pseries/contrib/dev/acpica/osunixxf.c
projects/pseries/contrib/dev/acpica/tables/tbinstal.c
projects/pseries/contrib/pf/net/pf.c
projects/pseries/contrib/pf/net/pf_ioctl.c
projects/pseries/contrib/pf/net/pf_norm.c
projects/pseries/dev/acpica/Osd/OsdDebug.c
projects/pseries/dev/ath/ath_hal/ah.c
projects/pseries/dev/ath/ath_hal/ah.h
projects/pseries/dev/ath/ath_hal/ah_desc.h
projects/pseries/dev/ath/ath_hal/ah_internal.h
projects/pseries/dev/ath/ath_hal/ar5212/ar5212.h
projects/pseries/dev/ath/ath_hal/ar5212/ar5212_attach.c
projects/pseries/dev/ath/ath_hal/ar5212/ar5212_misc.c
projects/pseries/dev/ath/ath_hal/ar5416/ar5416.h
projects/pseries/dev/ath/ath_hal/ar5416/ar5416_attach.c
projects/pseries/dev/ath/ath_hal/ar5416/ar5416_misc.c
projects/pseries/dev/ath/ath_hal/ar5416/ar5416phy.h
projects/pseries/dev/ath/ath_hal/ar9001/ar9130_attach.c
projects/pseries/dev/ath/ath_hal/ar9001/ar9160_attach.c
projects/pseries/dev/ath/ath_hal/ar9002/ar9280_attach.c
projects/pseries/dev/ath/ath_hal/ar9002/ar9285_attach.c
projects/pseries/dev/ath/ath_hal/ar9002/ar9287_attach.c
projects/pseries/dev/ath/ath_hal/ar9002/ar9287_reset.c
projects/pseries/dev/ath/if_ath.c
projects/pseries/dev/ath/if_ath_tx_ht.c
projects/pseries/dev/ath/if_athvar.h
projects/pseries/dev/cxgbe/adapter.h
projects/pseries/dev/cxgbe/common/common.h
projects/pseries/dev/cxgbe/common/t4fw_interface.h
projects/pseries/dev/cxgbe/offload.h
projects/pseries/dev/cxgbe/osdep.h
projects/pseries/dev/cxgbe/t4_ioctl.h
projects/pseries/dev/cxgbe/t4_main.c
projects/pseries/dev/cxgbe/t4_sge.c
projects/pseries/dev/iicbus/ds1775.c
projects/pseries/dev/iicbus/max6690.c
projects/pseries/dev/ipw/if_ipw.c
projects/pseries/dev/iwi/if_iwi.c
projects/pseries/dev/iwn/if_iwn.c
projects/pseries/dev/ixgbe/LICENSE
projects/pseries/dev/ixgbe/README
projects/pseries/dev/ixgbe/ixgbe.c
projects/pseries/dev/ixgbe/ixv.c
projects/pseries/dev/mfi/mfi.c
projects/pseries/dev/mfi/mfireg.h
projects/pseries/dev/mmc/mmc.c
projects/pseries/dev/mmc/mmcvar.h
projects/pseries/dev/msk/if_msk.c
projects/pseries/dev/nfe/if_nfe.c
projects/pseries/dev/sdhci/sdhci.c
projects/pseries/dev/usb/net/if_axe.c
projects/pseries/dev/usb/usb_process.c
projects/pseries/dev/usb/usbdevs
projects/pseries/dev/wpi/if_wpi.c
projects/pseries/fs/nfs/nfs_commonsubs.c
projects/pseries/fs/nfs/nfs_var.h
projects/pseries/fs/nfsclient/nfs_clbio.c
projects/pseries/fs/nfsclient/nfs_clcomsubs.c
projects/pseries/fs/nfsclient/nfs_clstate.c
projects/pseries/fs/nfsclient/nfs_clvnops.c
projects/pseries/fs/nfsserver/nfs_nfsdsocket.c
projects/pseries/fs/nfsserver/nfs_nfsdstate.c
projects/pseries/fs/nwfs/nwfs_io.c
projects/pseries/fs/smbfs/smbfs_io.c
projects/pseries/geom/geom_dump.c
projects/pseries/kern/kern_racct.c
projects/pseries/kern/kern_rctl.c
projects/pseries/kern/subr_msgbuf.c
projects/pseries/kern/subr_prf.c
projects/pseries/kern/uipc_socket.c
projects/pseries/modules/ath/Makefile
projects/pseries/modules/cxgbe/if_cxgbe/Makefile
projects/pseries/modules/usb/Makefile
projects/pseries/net/if_ethersubr.c
projects/pseries/netinet/in.c
projects/pseries/netinet/in_pcb.c
projects/pseries/netinet/in_pcb.h
projects/pseries/netinet/ip_divert.c
projects/pseries/netinet/ipfw/ip_dummynet.c
projects/pseries/netinet/ipfw/ip_fw2.c
projects/pseries/netinet/ipfw/ip_fw_dynamic.c
projects/pseries/netinet/ipfw/ip_fw_sockopt.c
projects/pseries/netinet/raw_ip.c
projects/pseries/netinet/sctp_indata.c
projects/pseries/netinet/sctp_indata.h
projects/pseries/netinet/sctputil.c
projects/pseries/netinet/sctputil.h
projects/pseries/netinet/siftr.c
projects/pseries/netinet/tcp_input.c
projects/pseries/netinet/tcp_subr.c
projects/pseries/netinet/tcp_syncache.c
projects/pseries/netinet/tcp_timer.c
projects/pseries/netinet/tcp_usrreq.c
projects/pseries/netinet/udp_usrreq.c
projects/pseries/netinet6/in6_pcb.c
projects/pseries/netinet6/in6_pcb.h
projects/pseries/netinet6/in6_src.c
projects/pseries/netinet6/udp6_usrreq.c
projects/pseries/nfsclient/nfs_bio.c
projects/pseries/nfsclient/nfs_vfsops.c
projects/pseries/powerpc/booke/locore.S
projects/pseries/powerpc/booke/machdep.c
projects/pseries/powerpc/booke/platform_bare.c
projects/pseries/powerpc/booke/pmap.c
projects/pseries/powerpc/conf/GENERIC
projects/pseries/powerpc/conf/GENERIC64
projects/pseries/powerpc/conf/NOTES
projects/pseries/powerpc/include/spr.h
projects/pseries/powerpc/mpc85xx/mpc85xx.c
projects/pseries/powerpc/mpc85xx/mpc85xx.h
projects/pseries/powerpc/powermac/fcu.c
projects/pseries/powerpc/powermac/smu.c
projects/pseries/powerpc/powermac/smusat.c
projects/pseries/sys/msgbuf.h
projects/pseries/sys/racct.h
projects/pseries/teken/libteken/teken.3
projects/pseries/ufs/ffs/ffs_alloc.c
projects/pseries/vm/vm_object.c
projects/pseries/vm/vnode_pager.c
projects/pseries/vm/vnode_pager.h
Directory Properties:
projects/pseries/ (props changed)
projects/pseries/amd64/include/xen/ (props changed)
projects/pseries/boot/ (props changed)
projects/pseries/boot/i386/efi/ (props changed)
projects/pseries/boot/ia64/efi/ (props changed)
projects/pseries/boot/ia64/ski/ (props changed)
projects/pseries/boot/powerpc/boot1.chrp/ (props changed)
projects/pseries/boot/powerpc/ofw/ (props changed)
projects/pseries/cddl/contrib/opensolaris/ (props changed)
projects/pseries/conf/ (props changed)
projects/pseries/contrib/dev/acpica/ (props changed)
projects/pseries/contrib/octeon-sdk/ (props changed)
projects/pseries/contrib/pf/ (props changed)
projects/pseries/contrib/x86emu/ (props changed)
Modified: projects/pseries/boot/common/Makefile.inc
==============================================================================
--- projects/pseries/boot/common/Makefile.inc Thu Jun 2 12:49:45 2011 (r222603)
+++ projects/pseries/boot/common/Makefile.inc Thu Jun 2 13:38:03 2011 (r222604)
@@ -44,8 +44,15 @@ SRCS+= pnp.c
# Forth interpreter
.if defined(BOOT_FORTH)
SRCS+= interp_forth.c
+MAN+= ../forth/beastie.4th.8
+MAN+= ../forth/brand.4th.8
+MAN+= ../forth/check-password.4th.8
+MAN+= ../forth/color.4th.8
+MAN+= ../forth/delay.4th.8
MAN+= ../forth/loader.conf.5
MAN+= ../forth/loader.4th.8
+MAN+= ../forth/menu.4th.8
+MAN+= ../forth/version.4th.8
.endif
.if defined(BOOT_PROMPT_123)
Modified: projects/pseries/boot/forth/beastie.4th
==============================================================================
--- projects/pseries/boot/forth/beastie.4th Thu Jun 2 12:49:45 2011 (r222603)
+++ projects/pseries/boot/forth/beastie.4th Thu Jun 2 13:38:03 2011 (r222604)
@@ -1,7 +1,8 @@
\ Copyright (c) 2003 Scott Long <scottl at freebsd.org>
\ Copyright (c) 2003 Aleksander Fafula <alex at fafula.com>
+\ Copyright (c) 2006-2011 Devin Teske <devinteske at hotmail.com>
\ All rights reserved.
-\
+\
\ Redistribution and use in source and binary forms, with or without
\ modification, are permitted provided that the following conditions
\ are met:
@@ -10,7 +11,7 @@
\ 2. Redistributions in binary form must reproduce the above copyright
\ notice, this list of conditions and the following disclaimer in the
\ documentation and/or other materials provided with the distribution.
-\
+\
\ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
\ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
\ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -22,35 +23,24 @@
\ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
\ SUCH DAMAGE.
-\
+\
\ $FreeBSD$
marker task-beastie.4th
-include /boot/screen.4th
-include /boot/frames.4th
+include /boot/color.4th
+include /boot/delay.4th
-hide
+variable logoX
+variable logoY
-variable menuidx
-variable menubllt
-variable menuX
-variable menuY
-variable promptwidth
-
-variable bootkey
-variable bootacpikey
-variable bootsafekey
-variable bootverbosekey
-variable bootsinglekey
-variable escapekey
-variable rebootkey
-
-46 constant dot
-
-\ The BSD Daemon. He is 19 rows high and 34 columns wide
-: beastie-logo ( x y -- )
-2dup at-xy ." [1;31m, ," 1+
+\ Initialize logo placement to defaults
+46 logoX !
+4 logoY !
+
+: beastie-logo ( x y -- ) \ color BSD mascot (19 rows x 34 columns)
+
+2dup at-xy ." [31m, ," 1+
2dup at-xy ." /( )`" 1+
2dup at-xy ." \ \___ / |" 1+
2dup at-xy ." /- [37m_[31m `-/ '" 1+
@@ -59,7 +49,7 @@ variable rebootkey
2dup at-xy ." [34mO O [37m) [31m/ |" 1+
2dup at-xy ." [37m`-^--'[31m`< '" 1+
2dup at-xy ." (_.) _ ) /" 1+
-2dup at-xy ." `.___/` / " 1+
+2dup at-xy ." `.___/` /" 1+
2dup at-xy ." `-----' /" 1+
2dup at-xy ." [33m<----.[31m __ / __ \" 1+
2dup at-xy ." [33m<----|====[31mO)))[33m==[31m) \) /[33m====|" 1+
@@ -68,173 +58,201 @@ variable rebootkey
2dup at-xy ." \ / /\" 1+
2dup at-xy ." [36m______[31m( (_ / \______/" 1+
2dup at-xy ." [36m,' ,-----' |" 1+
-at-xy ." `--{__________) [0m"
+ at-xy ." `--{__________)[37m"
+
+ \ Put the cursor back at the bottom
+ 0 25 at-xy
;
-: 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
;
-: 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
;
-: 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 ." [31m``` [31;1m`[31m" 1+
+ 2dup at-xy ." s` `.....---...[31;1m....--.``` -/[31m" 1+
+ 2dup at-xy ." +o .--` [31;1m/y:` +.[31m" 1+
+ 2dup at-xy ." yo`:. [31;1m:o `+-[31m" 1+
+ 2dup at-xy ." y/ [31;1m-/` -o/[31m" 1+
+ 2dup at-xy ." .- [31;1m::/sy+:.[31m" 1+
+ 2dup at-xy ." / [31;1m`-- /[31m" 1+
+ 2dup at-xy ." `: [31;1m:`[31m" 1+
+ 2dup at-xy ." `: [31;1m:`[31m" 1+
+ 2dup at-xy ." / [31;1m/[31m" 1+
+ 2dup at-xy ." .- [31;1m-.[31m" 1+
+ 2dup at-xy ." -- [31;1m-.[31m" 1+
+ 2dup at-xy ." `:` [31;1m`:`" 1+
+ 2dup at-xy ." [31;1m.-- `--." 1+
+ at-xy ." .---.....----.[37m"
+
+ \ Put the cursor back at the bottom
+ 0 25 at-xy
;
-: 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
;
-: 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
else
drop
then
- 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
drop
- 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
else
- menuidx @
- 1+
- menuidx !
- -2 bootacpikey !
+ orbbw-logo
then
- else
- -2 bootacpikey !
+ drop exit
then
- 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
-;
-: 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
;
-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
+
+ \ Put the cursor back at the bottom
+ 0 25 at-xy
+;
-: beastie-start
+: beastie-start ( -- ) \ starts the menu
s" beastie_disable" getenv
dup -1 <> if
s" YES" compare-insensitive 0= if
@@ -243,62 +261,15 @@ set-current
else
drop
then
- beastie-menu
- s" autoboot_delay" getenv
- dup -1 = if
- drop
- 10
+
+ s" loader_delay" getenv
+ -1 = if
+ s" include /boot/menu.rc" evaluate
else
- 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
then
- 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
;
-
-previous
Copied: projects/pseries/boot/forth/beastie.4th.8 (from r222603, head/sys/boot/forth/beastie.4th.8)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/pseries/boot/forth/beastie.4th.8 Thu Jun 2 13:38:03 2011 (r222604, copy of r222603, head/sys/boot/forth/beastie.4th.8)
@@ -0,0 +1,171 @@
+.\" Copyright (c) 2011 Devin Teske
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd May 16, 2011
+.Dt BEASTIE.4TH 8
+.Os
+.Sh NAME
+.Nm beastie.4th
+.Nd FreeBSD ASCII art boot module.
+.Sh DESCRIPTION
+The file that goes by the name of
+.Nm
+is a set of commands designed to draw the ASCII art FreeBSD mascot
+.Nd known simply as
+.Ic beastie
+.Nd to the right of the boot loader menu.
+The commands of
+.Nm
+by themselves are not enough for most uses.
+Please refer to the
+examples below for the most common situations, and to
+.Xr loader 8
+for additional commands.
+.Pp
+Before using any of the commands provided in
+.Nm ,
+it must be included
+through the command:
+.Pp
+.Dl include beastie.4th
+.Pp
+This line is present in the default
+.Pa /boot/loader.rc
+file, so it is not needed (and should not be re-issued) in a normal setup.
+.Pp
+The commands provided by it are:
+.Pp
+.Bl -tag -width disable-module_module -compact -offset indent
+.It Ic draw-beastie
+Draws the FreeBSD logo.
+.Pp
+The logo that is drawn is configured by setting the
+.Ic loader_logo
+variable in
+.Xr loader.conf 5
+to one of
+.Dq Li beastie ,
+.Dq Li beastiebw ,
+.Dq Li fbsdbw ,
+.Dq Li orb ,
+and
+.Dq Li orbbw
+(the default).
+.Pp
+The position of the logo can be configured by setting the
+.Ic loader_logo_x
+and
+.Ic loader_logo_y
+variables in
+.Xr loader.conf 5 .
+The default values are 46 (x) and 4 (y).
+.Pp
+.It Ic clear-beastie
+Clears the screen of beastie.
+.Pp
+.It Ic beastie-start
+Initializes the interactive boot loader menu.
+.Pp
+The
+.Ic loader_delay
+variable can be configured in
+.Xr loader.conf 5
+to the number of seconds you would like to delay loading the boot menu.
+During the delay the user can press Ctrl-C to fall back to autoboot or ENTER
+to proceed.
+The default behavior is to not delay.
+.El
+.Pp
+The environment variables that effect its behavior are:
+.Bl -tag -width bootfile -offset indent
+.It Va loader_logo
+Selects the desired logo in the beastie boot menu. Possible values are:
+.Dq Li fbsdbw ,
+.Dq Li beastie ,
+.Dq Li beastiebw ,
+.Dq Li orb ,
+.Dq Li orbbw
+(default), and
+.Dq Li none .
+.It Va loader_logo_x
+Sets the desired column position of the logo. Default is 46.
+.It Va loader_logo_y
+Sets the desired row position of the logo. Default is 4.
+.It Va beastie_disable
+If set to
+.Dq YES ,
+the beastie boot menu will be skipped.
+.It Va loader_delay
+If set to a number higher than zero, introduces a delay before starting the
+beastie boot menu. During the delay the user can press either Ctrl-C to skip
+the menu or ENTER to proceed to the menu. The default is to not delay when
+loading the menu.
+.El
+.Sh FILES
+.Bl -tag -width /boot/loader.4th -compact
+.It Pa /boot/loader
+The
+.Xr loader 8 .
+.It Pa /boot/beastie.4th
+.Nm
+itself.
+.It Pa /boot/loader.rc
+.Xr loader 8
+bootstrapping script.
+.El
+.Sh EXAMPLES
+Standard i386
+.Pa /boot/loader.rc :
+.Pp
+.Bd -literal -offset indent -compact
+include /boot/beastie.4th
+beastie-start
+.Ed
+.Pp
+Set a different logo in
+.Xr loader.conf 5 :
+.Pp
+.Bd -literal -offset indent -compact
+loader_logo="beastie"
+.Ed
+.Sh SEE ALSO
+.Xr loader.conf 5 ,
+.Xr loader 8 ,
+.Xr loader.4th 8
+.Sh HISTORY
+The
+.Nm
+set of commands first appeared in
+.Fx 5.1 .
+.Sh AUTHORS
+The
+.Nm
+set of commands was written by
+.An -nosplit
+.An Scott Long Aq scottl at FreeBSD.org ,
+.An Aleksander Fafula Aq alex at fafula.com
+and
+.An Devin Teske Aq devinteske at hotmail.com .
Copied: projects/pseries/boot/forth/brand.4th (from r222603, head/sys/boot/forth/brand.4th)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/pseries/boot/forth/brand.4th Thu Jun 2 13:38:03 2011 (r222604, copy of r222603, head/sys/boot/forth/brand.4th)
@@ -0,0 +1,91 @@
+\ Copyright (c) 2006-2011 Devin Teske <devinteske at hotmail.com>
+\ All rights reserved.
+\
+\ Redistribution and use in source and binary forms, with or without
+\ modification, are permitted provided that the following conditions
+\ are met:
+\ 1. Redistributions of source code must retain the above copyright
+\ notice, this list of conditions and the following disclaimer.
+\ 2. Redistributions in binary form must reproduce the above copyright
+\ notice, this list of conditions and the following disclaimer in the
+\ documentation and/or other materials provided with the distribution.
+\
+\ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+\ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+\ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+\ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+\ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+\ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+\ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+\ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+\ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+\ SUCH DAMAGE.
+\
+\ $FreeBSD$
+
+marker task-brand.4th
+
+variable brandX
+variable brandY
+
+\ Initialize logo placement
+2 brandX !
+1 brandY !
+
+: fbsd-logo ( x y -- ) \ "FreeBSD" [wide] logo in B/W (7 rows x 42 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+
+ at-xy ." |_| |_| \___|\___||____/|_____/|_____/ "
+
+ \ Put the cursor back at the bottom
+ 0 25 at-xy
+;
+
+\ This function draws any number of company logos at (loader_brand_x,
+\ loader_brand_y) if defined, or (2,1) (top-left) if not defined. To choose
+\ your logo, set the variable `loader_brand' to the respective logo name.
+\
+\ Currently available:
+\
+\ NAME DESCRIPTION
+\ fbsd FreeBSD logo
+\
+\ NOTE: Setting `loader_brand' to an undefined value (such as "none") will
+\ prevent any brand from being drawn.
+\
+: draw-brand ( -- )
+
+ s" loader_brand_x" getenv dup -1 <> if
+ ?number 1 = if
+ brandX !
+ then
+ else
+ drop
+ then
+
+ s" loader_brand_y" getenv dup -1 <> if
+ ?number 1 = if
+ brandY !
+ then
+ else
+ drop
+ then
+
+ s" loader_brand" getenv dup -1 = if
+ brandX @ brandY @ fbsd-logo
+ drop exit
+ then
+
+ 2dup s" fbsd" compare-insensitive 0= if
+ brandX @ brandY @ fbsd-logo
+ 2drop exit
+ then
+
+ 2drop
+;
Copied: projects/pseries/boot/forth/brand.4th.8 (from r222603, head/sys/boot/forth/brand.4th.8)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/pseries/boot/forth/brand.4th.8 Thu Jun 2 13:38:03 2011 (r222604, copy of r222603, head/sys/boot/forth/brand.4th.8)
@@ -0,0 +1,125 @@
+.\" Copyright (c) 2011 Devin Teske
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd May 18, 2011
+.Dt BRAND.4TH 8
+.Os
+.Sh NAME
+.Nm brand.4th
+.Nd FreeBSD ASCII art boot module.
+.Sh DESCRIPTION
+The file that goes by the name of
+.Nm
+is a set of commands designed to draw the ASCII art BSD brand above the boot
+loader menu.
+The commands of
+.Nm
+by themselves are not enough for most uses.
+Please refer to the
+examples below for the most common situations, and to
+.Xr loader 8
+for additional commands.
+.Pp
+Before using any of the commands provided in
+.Nm ,
+it must be included
+through the command:
+.Pp
+.Dl include brand.4th
+.Pp
+This line is present in the default
+.Pa /boot/menu.rc
+file, so it is not needed (and should not be re-issued) in a normal setup.
+.Pp
+The commands provided by it are:
+.Pp
+.Bl -tag -width disable-module_module -compact -offset indent
+.It Ic draw-brand
+Draws the BSD brand.
+.Pp
+The brand that is drawn is configured by setting the
+.Ic loader_brand
+variable in
+.Xr loader.conf 5
+to one of
+.Dq Li fbsd
+(the default) or
+.Dq Li none .
+.Pp
+The position of the logo can be configured by setting the
+.Ic loader_brand_x
+and
+.Ic loader_brand_y
+variables in
+.Xr loader.conf 5 .
+The default values are 2 (x) and 1 (y).
+.El
+.Pp
+The environment variables that effect its behavior are:
+.Bl -tag -width bootfile -offset indent
+.It Va loader_brand
+Selects the desired brand in the beastie boot menu. Possible values are:
+.Dq Li fbsd
+(default) or
+.Dq Li none .
+.It Va loader_brand_x
+Sets the desired column position of the brand. Default is 2.
+.It Va loader_brand_y
+Sets the desired row position of the brand. Default is 1.
+.El
+.Sh FILES
+.Bl -tag -width /boot/loader.4th -compact
+.It Pa /boot/loader
+The
+.Xr loader 8 .
+.It Pa /boot/brand.4th
+.Nm
+itself.
+.It Pa /boot/loader.rc
+.Xr loader 8
+bootstrapping script.
+.El
+.Sh EXAMPLES
+Set FreeBSD brand in
+.Xr loader.conf 5 :
+.Pp
+.Bd -literal -offset indent -compact
+loader_brand="fbsd"
+.Ed
+.Sh SEE ALSO
+.Xr loader.conf 5 ,
+.Xr loader 8 ,
+.Sh HISTORY
+The
+.Nm
+set of commands first appeared in
+.Fx 9.0 .
+.Sh AUTHORS
+The
+.Nm
+set of commands was written by
+.An -nosplit
+.An Devin Teske Aq devinteske at hotmail.com .
Copied: projects/pseries/boot/forth/check-password.4th (from r222603, head/sys/boot/forth/check-password.4th)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/pseries/boot/forth/check-password.4th Thu Jun 2 13:38:03 2011 (r222604, copy of r222603, head/sys/boot/forth/check-password.4th)
@@ -0,0 +1,156 @@
+\ Copyright (c) 2006-2011 Devin Teske <devinteske at hotmail.com>
+\ All rights reserved.
+\
+\ Redistribution and use in source and binary forms, with or without
+\ modification, are permitted provided that the following conditions
+\ are met:
+\ 1. Redistributions of source code must retain the above copyright
+\ notice, this list of conditions and the following disclaimer.
+\ 2. Redistributions in binary form must reproduce the above copyright
+\ notice, this list of conditions and the following disclaimer in the
+\ documentation and/or other materials provided with the distribution.
+\
+\ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+\ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+\ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+\ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+\ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+\ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+\ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+\ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+\ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+\ SUCH DAMAGE.
+\
+\ $FreeBSD$
+
+marker task-check-password.4th
+
+include /boot/screen.4th
+
+13 constant enter_key \ The decimal ASCII value for Enter key
+8 constant bs_key \ The decimal ASCII value for Backspace key
+16 constant readmax \ Maximum number of characters for the password
+
+variable readX \ Current X offset (column)(used by read)
+variable read-start \ Starting X offset (column)(used by read)
+
+create readval 16 allot \ input obtained (maximum 16 characters)
+variable readlen \ input length
+
+\ This function blocks program flow (loops forever) until a key is pressed.
+\ The key that was pressed is added to the top of the stack in the form of its
+\ decimal ASCII representation. Note: the stack cannot be empty when this
+\ function starts or an underflow exception will occur. Simplest way to prevent
+\ this is to pass 0 as a stack parameter (ie. `0 sgetkey'). This function is
+\ called by the read function. You need not call it directly. NOTE: arrow keys
+\ show as 0 on the stack
+\
+: sgetkey ( -- )
+
+ begin \ Loop forever
+ key? if \ Was a key pressed? (see loader(8))
+
+ drop \ Remove stack-cruft
+ key \ Get the key that was pressed
+
+ \ Check key pressed (see loader(8)) and input limit
+ dup 0<> if ( and ) readlen @ readmax < if
+
+ \ Echo an asterisk (unless Backspace/Enter)
+ dup bs_key <> if ( and ) dup enter_key <> if
+ ." *" \ Echo an asterisk
+ then then
+
+ exit \ Exit from the function
+ then then
+
+ \ Always allow Backspace and Enter
+ dup bs_key = if exit then
+ dup enter_key = if exit then
+
+ then
+ 50 ms \ Sleep for 50 milliseconds (see loader(8))
+ again
+;
+
+: read ( -- String prompt )
+
+ 0 25 at-xy \ Move the cursor to the bottom-left
+ dup 1+ read-start ! \ Store X offset after the prompt
+ read-start @ readX ! \ copy value to the current X offset
+ 0 readlen ! \ Initialize the read length
+ type \ Print the prompt
+
+ begin \ Loop forever
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-projects
mailing list