summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordcs <dcs@FreeBSD.org>2000-09-16 21:04:49 +0000
committerdcs <dcs@FreeBSD.org>2000-09-16 21:04:49 +0000
commit3383919e3fcc70f38d021287ac97515f03c3c9cb (patch)
treef56be1d3751dd10df9f663a636c759a6a547c9ef
parent39399239a0550131088f051a0e993f6b2c7b9290 (diff)
downloadFreeBSD-src-3383919e3fcc70f38d021287ac97515f03c3c9cb.zip
FreeBSD-src-3383919e3fcc70f38d021287ac97515f03c3c9cb.tar.gz
Use _ instead or - where proper, according to the style I have been
using. Overload "?" so it will also show loader.4th commands.
-rw-r--r--sys/boot/forth/loader.4th22
-rw-r--r--sys/boot/forth/support.4th30
2 files changed, 35 insertions, 17 deletions
diff --git a/sys/boot/forth/loader.4th b/sys/boot/forth/loader.4th
index 3ac4bf7..d063368 100644
--- a/sys/boot/forth/loader.4th
+++ b/sys/boot/forth/loader.4th
@@ -57,7 +57,7 @@ include /boot/support.4th
only forth also support-functions also builtins definitions
: boot
- 0= if ( interpreted ) get-arguments then
+ 0= if ( interpreted ) get_arguments then
\ Unload only if a path was passed
dup if
@@ -83,7 +83,7 @@ only forth also support-functions also builtins definitions
;
: boot-conf
- 0= if ( interpreted ) get-arguments then
+ 0= if ( interpreted ) get_arguments then
0 1 unload drop
load_kernel_and_modules
?dup 0= if 0 1 autoboot then
@@ -282,5 +282,23 @@ only forth definitions also support-functions
\ Return to strict forth vocabulary
+: #type
+ over - >r
+ type
+ r> spaces
+;
+
+: .? 2 spaces 2swap 15 #type 2 spaces type cr ;
+
+: ?
+ ['] ? execute
+ s" boot-conf" s" load kernel and modules, then autoboot" .?
+ s" read-conf" s" read a configuration file" .?
+ s" enable-module" s" enable loading of a module" .?
+ s" disable-module" s" disable loading of a module" .?
+ s" toggle-module" s" toggle loading of a module" .?
+ s" show-module" s" show module load data" .?
+;
+
only forth also
diff --git a/sys/boot/forth/support.4th b/sys/boot/forth/support.4th
index a1c6f68..e014b30 100644
--- a/sys/boot/forth/support.4th
+++ b/sys/boot/forth/support.4th
@@ -1493,7 +1493,7 @@ also builtins
abort" Unable to load a kernel!"
;
-: set-defaultoptions ( -- )
+: set_defaultoptions ( -- )
s" kernel_options" getenv dup -1 = if
drop
else
@@ -1511,7 +1511,7 @@ also builtins
pick
;
-: drop-args ( aN uN ... a1 u1 N -- )
+: drop_args ( aN uN ... a1 u1 N -- )
0 ?do 2drop loop
;
@@ -1519,7 +1519,7 @@ also builtins
dup
;
-: queue-argv ( aN uN ... a1 u1 N a u -- a u aN uN ... a1 u1 N+1 )
+: queue_argv ( aN uN ... a1 u1 N a u -- a u aN uN ... a1 u1 N+1 )
>r
over 2* 1+ -roll
r>
@@ -1527,7 +1527,7 @@ also builtins
1+
;
-: unqueue-argv ( aN uN ... a1 u1 N -- aN uN ... a2 u2 N-1 a1 u1 )
+: unqueue_argv ( aN uN ... a1 u1 N -- aN uN ... a2 u2 N-1 a1 u1 )
1- -rot
;
@@ -1547,28 +1547,28 @@ also builtins
r>
;
-: concat-argv ( aN uN ... a1 u1 N -- a u )
+: concat_argv ( aN uN ... a1 u1 N -- a u )
strlen(argv) allocate if out_of_memory throw then
0 2>r
begin
argc
while
- unqueue-argv
+ unqueue_argv
2r> 2swap
strcat
s" " strcat
2>r
repeat
- drop-args
+ drop_args
2r>
;
-: set-tempoptions ( addrN lenN ... addr1 len1 N -- addr len 1 | 0 )
+: set_tempoptions ( addrN lenN ... addr1 len1 N -- addr len 1 | 0 )
\ Save the first argument, if it exists and is not a flag
argc if
0 argv[] drop c@ [char] - <> if
- unqueue-argv 2>r \ Filename
+ unqueue_argv 2>r \ Filename
1 >r \ Filename present
else
0 >r \ Filename not present
@@ -1579,33 +1579,33 @@ also builtins
\ If there are other arguments, assume they are flags
?dup if
- concat-argv
+ concat_argv
2dup s" temp_options" setenv
drop free if free_error throw then
else
- set-defaultoptions
+ set_defaultoptions
then
\ Bring back the filename, if one was provided
r> if 2r> 1 else 0 then
;
-: get-arguments ( -- addrN lenN ... addr1 len1 N )
+: get_arguments ( -- addrN lenN ... addr1 len1 N )
0
begin
\ Get next word on the command line
parse-word
?dup while
- queue-argv
+ queue_argv
repeat
drop ( empty string )
;
: load_kernel_and_modules ( args -- flag )
- set-tempoptions
+ set_tempoptions
argc >r
s" temp_options" getenv dup -1 <> if
- queue-argv
+ queue_argv
else
drop
then
OpenPOWER on IntegriCloud