Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 May 2011 08:50:39 +0000 (UTC)
From:      Julian Elischer <julian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r222417 - in head/sys/boot: common forth i386/loader ia64/common pc98/loader powerpc/ofw powerpc/ps3 sparc64/loader
Message-ID:  <201105280850.p4S8odjf076440@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: julian
Date: Sat May 28 08:50:38 2011
New Revision: 222417
URL: http://svn.freebsd.org/changeset/base/222417

Log:
  New boot loader menus from Devin Teske.
  Discussed on hackers and recommended for inclusion into 9.0 at the devsummit.
  All support email to devin   dteske at vicor dot ignoreme dot com .
  
  Submitted by:	dteske at vicor dot ignoreme dot com
  Reviewed by:	me and many others

Added:
  head/sys/boot/forth/beastie.4th.8   (contents, props changed)
  head/sys/boot/forth/brand.4th   (contents, props changed)
  head/sys/boot/forth/brand.4th.8   (contents, props changed)
  head/sys/boot/forth/check-password.4th   (contents, props changed)
  head/sys/boot/forth/check-password.4th.8   (contents, props changed)
  head/sys/boot/forth/color.4th   (contents, props changed)
  head/sys/boot/forth/color.4th.8   (contents, props changed)
  head/sys/boot/forth/delay.4th   (contents, props changed)
  head/sys/boot/forth/delay.4th.8   (contents, props changed)
  head/sys/boot/forth/menu-commands.4th   (contents, props changed)
  head/sys/boot/forth/menu.4th   (contents, props changed)
  head/sys/boot/forth/menu.4th.8   (contents, props changed)
  head/sys/boot/forth/menu.rc   (contents, props changed)
  head/sys/boot/forth/shortcuts.4th   (contents, props changed)
  head/sys/boot/forth/version.4th   (contents, props changed)
  head/sys/boot/forth/version.4th.8   (contents, props changed)
Modified:
  head/sys/boot/common/Makefile.inc
  head/sys/boot/forth/beastie.4th
  head/sys/boot/forth/loader.4th
  head/sys/boot/forth/loader.conf.5
  head/sys/boot/forth/loader.rc
  head/sys/boot/forth/support.4th
  head/sys/boot/i386/loader/Makefile
  head/sys/boot/ia64/common/Makefile
  head/sys/boot/pc98/loader/Makefile
  head/sys/boot/powerpc/ofw/Makefile
  head/sys/boot/powerpc/ps3/Makefile
  head/sys/boot/sparc64/loader/Makefile

Modified: head/sys/boot/common/Makefile.inc
==============================================================================
--- head/sys/boot/common/Makefile.inc	Sat May 28 08:44:39 2011	(r222416)
+++ head/sys/boot/common/Makefile.inc	Sat May 28 08:50:38 2011	(r222417)
@@ -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: head/sys/boot/forth/beastie.4th
==============================================================================
--- head/sys/boot/forth/beastie.4th	Sat May 28 08:44:39 2011	(r222416)
+++ head/sys/boot/forth/beastie.4th	Sat May 28 08:50:38 2011	(r222417)
@@ -1,7 +1,8 @@
 \ Copyright (c) 2003 Scott Long <scottl@freebsd.org>
 \ Copyright (c) 2003 Aleksander Fafula <alex@fafula.com>
+\ Copyright (c) 2006-2011 Devin Teske <devinteske@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+
+\ Initialize logo placement to defaults
+46 logoX !
+4  logoY !
+
+: beastie-logo ( x y -- ) \ color BSD mascot (19 rows x 34 columns)
+
+2dup at-xy ."               ,        ," 1+
 2dup at-xy ."              /(        )`" 1+
 2dup at-xy ."              \ \___   / |" 1+
 2dup at-xy ."              /- _  `-/  '" 1+
@@ -59,7 +49,7 @@ variable rebootkey
 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 ."  <----.     __ / __   \" 1+
 2dup at-xy ."  <----|====O)))==) \) /====|" 1+
@@ -68,173 +58,201 @@ variable rebootkey
 2dup at-xy ."                \       /       /\" 1+
 2dup at-xy ."           ______( (_  / \______/" 1+
 2dup at-xy ."         ,'  ,-----'   |" 1+
-at-xy ."         `--{__________) "
+     at-xy ."         `--{__________)"
+
+	\ 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 ."  ```                        `" 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
 ;
 
-: 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

Added: head/sys/boot/forth/beastie.4th.8
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/boot/forth/beastie.4th.8	Sat May 28 08:50:38 2011	(r222417)
@@ -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@FreeBSD.org ,
+.An Aleksander Fafula Aq alex@fafula.com
+and
+.An Devin Teske Aq devinteske@hotmail.com .

Added: head/sys/boot/forth/brand.4th
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/boot/forth/brand.4th	Sat May 28 08:50:38 2011	(r222417)
@@ -0,0 +1,91 @@
+\ Copyright (c) 2006-2011 Devin Teske <devinteske@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
+;

Added: head/sys/boot/forth/brand.4th.8
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/boot/forth/brand.4th.8	Sat May 28 08:50:38 2011	(r222417)
@@ -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@hotmail.com .

Added: head/sys/boot/forth/check-password.4th
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/boot/forth/check-password.4th	Sat May 28 08:50:38 2011	(r222417)
@@ -0,0 +1,156 @@
+\ Copyright (c) 2006-2011 Devin Teske <devinteske@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 ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105280850.p4S8odjf076440>