[OpenBIOS] r613 - in trunk/openbios-devel/forth: admin bootstrap

svn at openbios.org svn at openbios.org
Tue Nov 17 17:54:25 CET 2009


Author: stepan
Date: 2009-11-17 17:54:24 +0100 (Tue, 17 Nov 2009)
New Revision: 613

Modified:
   trunk/openbios-devel/forth/admin/nvram.fs
   trunk/openbios-devel/forth/bootstrap/bootstrap.fs
Log:
This patch replaces the string definitions in nvram.fs by the 
simpler version s" that does not contain a complex parser for
" "(0a) type of strings.

Also use handle-text in " instead of the hand crafted version. This fixes 
strings in "see".

Signed-off-by: Stefan Reinauer <stepan at coresystems.de>



Modified: trunk/openbios-devel/forth/admin/nvram.fs
===================================================================
--- trunk/openbios-devel/forth/admin/nvram.fs	2009-11-15 21:19:59 UTC (rev 612)
+++ trunk/openbios-devel/forth/admin/nvram.fs	2009-11-17 16:54:24 UTC (rev 613)
@@ -39,7 +39,7 @@
   dup >cf.name 2@ $create ,
   does> @
     dup >cf.name 2@
-    " /options" find-dev if
+    s" /options" find-dev if
       get-package-property if 0 -1 then
       ( configp prop-str prop-len )
       \ drop trailing zero
@@ -120,14 +120,14 @@
 \ ------------------------------------------------------------
 
 : exec-secmode-conf ( str len -- n )
-  2dup " command" strcmp 0= if 2drop 1 exit then
-  2dup " full" strcmp 0= if 2drop 2 exit then
+  2dup s" command" strcmp 0= if 2drop 1 exit then
+  2dup s" full" strcmp 0= if 2drop 2 exit then
   2drop 0
 ;
 : check-secmode-conf ( str len -- str len valid? )
-  2dup " none" strcmp 0= if true exit then
-  2dup " command" strcmp 0= if true exit then
-  2dup " full" strcmp 0= if true exit then
+  2dup s" none" strcmp 0= if true exit then
+  2dup s" command" strcmp 0= if true exit then
+  2dup s" full" strcmp 0= if true exit then
   false
 ;
 
@@ -141,18 +141,18 @@
 \ ------------------------------------------------------------
 
 : exec-bool-conf ( str len -- value )
-  2dup " true" strcmp 0= if 2drop true exit then
-  2dup " false" strcmp 0= if 2drop false exit then
-  2dup " TRUE" strcmp 0= if 2drop false exit then
-  2dup " FALSE" strcmp 0= if 2drop false exit then
+  2dup s" true" strcmp 0= if 2drop true exit then
+  2dup s" false" strcmp 0= if 2drop false exit then
+  2dup s" TRUE" strcmp 0= if 2drop false exit then
+  2dup s" FALSE" strcmp 0= if 2drop false exit then
   parse-hex 0<>
 ;
 
 : check-bool-conf ( name len -- str len valid? )
-  2dup " true" strcmp 0= if true exit then
-  2dup " false" strcmp 0= if true exit then
-  2dup " TRUE" strcmp 0= if 2drop " true" true exit then
-  2dup " FALSE" strcmp 0= if 2drop " false" true exit then
+  2dup s" true" strcmp 0= if true exit then
+  2dup s" false" strcmp 0= if true exit then
+  2dup s" TRUE" strcmp 0= if 2drop s" true" true exit then
+  2dup s" FALSE" strcmp 0= if 2drop s" false" true exit then
   false
 ;
 
@@ -181,7 +181,7 @@
   then
   
   2swap encode-string 2swap
-  " /options" find-package drop
+  s" /options" find-package drop
   encode-property
 ;
 
@@ -199,7 +199,7 @@
   linefeed parse 2drop
 
   active-package
-  " /options" find-device
+  s" /options" find-device
   .properties
   active-package!
 ;
@@ -272,7 +272,7 @@
     dup if 1- then
   then
   ( name len value-str len )
-  2swap " =" 2swap
+  2swap s" =" 2swap
   pocket tmpstrcat tmpstrcat drop
   2dup + 0 swap c!
   1+
@@ -281,7 +281,7 @@
 : nvram-store-configs ( data len -- )
   2 - \ make room for two trailing zeros
 
-  " /options" find-dev 0= if 2drop exit then
+  s" /options" find-dev 0= if 2drop exit then
   >r
   config-root
   ( data len configptr R: phandle )
@@ -301,66 +301,66 @@
 \ NVRAM variables
 \ --------------------------------------------------------
 \ fcode-debug? input-device output-device
-" true"     " auto-boot?"           bool-config   \ 7.4.3.5
-" boot"     " boot-command"         str-config    \ 7.4.3.5
-" "         " boot-file"            str-config    \ 7.4.3.5
-" false"    " diag-switch?"         bool-config   \ 7.4.3.5
-no-conf-def " diag-device"          str-config    \ 7.4.3.5
-no-conf-def " diag-file"            str-config    \ 7.4.3.5
-" false"    " fcode-debug?"         bool-config   \ 7.7
-" "         " nvramrc"              str-config    \ 7.4.4.2
-" false"    " oem-banner?"          bool-config
-" "         " oem-banner"           str-config  
-" false"    " oem-logo?"            bool-config
-no-conf-def " oem-logo"             str-config
-" false"    " use-nvramrc?"         bool-config   \ 7.4.4.2
-" keyboard" " input-device"         str-config    \ 7.4.5
-" screen"   " output-device"        str-config    \ 7.4.5
-" 80"       " screen-#columns"      int-config    \ 7.4.5
-" 24"       " screen-#rows"         int-config    \ 7.4.5
-" 0"        " selftest-#megs"       int-config
-no-conf-def " security-mode"        secmode-config
+s" true"     s" auto-boot?"           bool-config   \ 7.4.3.5
+s" boot"     s" boot-command"         str-config    \ 7.4.3.5
+s" "         s" boot-file"            str-config    \ 7.4.3.5
+s" false"    s" diag-switch?"         bool-config   \ 7.4.3.5
+no-conf-def  s" diag-device"          str-config    \ 7.4.3.5
+no-conf-def  s" diag-file"            str-config    \ 7.4.3.5
+s" false"    s" fcode-debug?"         bool-config   \ 7.7
+s" "         s" nvramrc"              str-config    \ 7.4.4.2
+s" false"    s" oem-banner?"          bool-config
+s" "         s" oem-banner"           str-config  
+s" false"    s" oem-logo?"            bool-config
+no-conf-def  s" oem-logo"             str-config
+s" false"    s" use-nvramrc?"         bool-config   \ 7.4.4.2
+s" keyboard" s" input-device"         str-config    \ 7.4.5
+s" screen"   s" output-device"        str-config    \ 7.4.5
+s" 80"       s" screen-#columns"      int-config    \ 7.4.5
+s" 24"       s" screen-#rows"         int-config    \ 7.4.5
+s" 0"        s" selftest-#megs"       int-config
+no-conf-def  s" security-mode"        secmode-config
 
 \ --- devices ---
-" -1"       " pci-probe-mask"       int-config
-" false"    " default-mac-address"  bool-config
-" false"    " skip-netboot?"        bool-config
-" true"     " scroll-lock"          bool-config
+s" -1"       s" pci-probe-mask"       int-config
+s" false"    s" default-mac-address"  bool-config
+s" false"    s" skip-netboot?"        bool-config
+s" true"     s" scroll-lock"          bool-config
 
 [IFDEF] CONFIG_PPC
 \ ---- PPC ----
-" disk"     " boot-device"          str-config    \ 7.4.3.5
-" false"    " little-endian?"       bool-config
-" false"    " real-mode?"           bool-config
-" -1"       " real-base"            int-config
-" -1"       " real-size"            int-config
-" 4000000"  " load-base"          int-config
-" -1"       " virt-base"            int-config
-" -1"       " virt-size"            int-config
+s" disk"     s" boot-device"          str-config    \ 7.4.3.5
+s" false"    s" little-endian?"       bool-config
+s" false"    s" real-mode?"           bool-config
+s" -1"       s" real-base"            int-config
+s" -1"       s" real-size"            int-config
+s" 4000000"  s" load-base"          int-config
+s" -1"       s" virt-base"            int-config
+s" -1"       s" virt-size"            int-config
 [THEN]
 
 [IFDEF] CONFIG_X86
 \ ---- X86 ----
-" disk"     " boot-device"          str-config    \ 7.4.3.5
-" true"     " little-endian?"       bool-config
+s" disk"     s" boot-device"          str-config    \ 7.4.3.5
+s" true"     s" little-endian?"       bool-config
 [THEN]
 
 [IFDEF] CONFIG_SPARC32
 \ ---- SPARC32 ----
-" true"     " tpe-link-test?"        bool-config
-" 9600,8,n,1,-" " ttya-mode"         str-config
-" true"     " ttya-ignore-cd"        bool-config
-" false"    " ttya-rts-dtr-off"      bool-config
-" 9600,8,n,1,-" " ttyb-mode"         str-config
-" true"     " ttyb-ignore-cd"        bool-config
-" false"    " ttyb-rts-dtr-off"      bool-config
+s" true"     s" tpe-link-test?"        bool-config
+s" 9600,8,n,1,-" s" ttya-mode"         str-config
+s" true"     s" ttya-ignore-cd"        bool-config
+s" false"    s" ttya-rts-dtr-off"      bool-config
+s" 9600,8,n,1,-" s" ttyb-mode"         str-config
+s" true"     s" ttyb-ignore-cd"        bool-config
+s" false"    s" ttyb-rts-dtr-off"      bool-config
 [THEN]
 
 \ --- ??? ---
-" "         " boot-screen"          str-config
-" "         " boot-script"          str-config
-" false"    " use-generic?"         bool-config
-" "         " boot-args"            str-config    \ ???
+s" "         s" boot-screen"          str-config
+s" "         s" boot-script"          str-config
+s" false"    s" use-generic?"         bool-config
+s" "         s" boot-args"            str-config    \ ???
 
 \ defers
 ['] fcode-debug? to _fcode-debug?

Modified: trunk/openbios-devel/forth/bootstrap/bootstrap.fs
===================================================================
--- trunk/openbios-devel/forth/bootstrap/bootstrap.fs	2009-11-15 21:19:59 UTC (rev 612)
+++ trunk/openbios-devel/forth/bootstrap/bootstrap.fs	2009-11-17 16:54:24 UTC (rev 613)
@@ -1307,14 +1307,7 @@
     +loop
   repeat
   over -
-  state @ if
-    ['] (lit) , here 5 cells + ,
-    ['] (lit) , dup ,
-    ['] dobranch ,
-    here -rot
-    /n allot
-    ", null-align resolve-orig
-  then
+  handle-text
 ; immediate
 
 




More information about the OpenBIOS mailing list