[OpenBIOS] [commit] r803 - in trunk/openbios-devel/forth: admin bootstrap debugging
repository service
svn at openbios.org
Mon Jun 28 07:16:15 CEST 2010
Author: mcayland
Date: Mon Jun 28 07:16:15 2010
New Revision: 803
URL: http://tracker.coreboot.org/trac/openbios/changeset/803
Log:
Fix up parse word so that it can correctly handle empty arguments and (encode-bootpath) word so that it can handle optional
arguments. With these fixes in place we can now switch the boot word to use (encode-bootpath) which means that the bootpath and
bootarg properties are now set exactly the same when executing boot and/or load.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at siriusit.co.uk>
Modified:
trunk/openbios-devel/forth/admin/userboot.fs
trunk/openbios-devel/forth/bootstrap/bootstrap.fs
trunk/openbios-devel/forth/debugging/client.fs
Modified: trunk/openbios-devel/forth/admin/userboot.fs
==============================================================================
--- trunk/openbios-devel/forth/admin/userboot.fs Sun Jun 27 22:08:21 2010 (r802)
+++ trunk/openbios-devel/forth/admin/userboot.fs Mon Jun 28 07:16:15 2010 (r803)
@@ -1,7 +1,7 @@
\ 7.4.3.5 User commands for booting
: boot ( "{param-text}<cr>" -- )
- linefeed parse cr
+ (encode-bootpath)
s" platform-boot" $find if
execute
else
Modified: trunk/openbios-devel/forth/bootstrap/bootstrap.fs
==============================================================================
--- trunk/openbios-devel/forth/bootstrap/bootstrap.fs Sun Jun 27 22:08:21 2010 (r802)
+++ trunk/openbios-devel/forth/bootstrap/bootstrap.fs Mon Jun 28 07:16:15 2010 (r803)
@@ -704,6 +704,11 @@
>r \ save delimiter
ib >in @ +
span @ >in @ - \ ib+offs len-offset.
+ dup 0 < if \ if we are already at the end of the string, return an empty string
+ + 0 \ move to end of input string
+ r> drop
+ exit
+ then
2dup r> \ ib+offs len-offset ib+offs len-offset delim
findchar if \ look for the delimiter.
nip dup 1+
Modified: trunk/openbios-devel/forth/debugging/client.fs
==============================================================================
--- trunk/openbios-devel/forth/debugging/client.fs Sun Jun 27 22:08:21 2010 (r802)
+++ trunk/openbios-devel/forth/debugging/client.fs Mon Jun 28 07:16:15 2010 (r803)
@@ -56,13 +56,21 @@
;
: (encode-bootpath) ( "{params}<cr>" -- bootpath-str bootpath-len)
- bl parse 2dup encode-string
- " /chosen" (find-dev) if
- " bootpath" rot (property)
+ \ Parse the current input buffer of a load/boot command and set both
+ \ the bootargs and bootpath properties as appropriate.
+ bl parse dup if
+ 2dup encode-string
+ " /chosen" (find-dev) if
+ " bootpath" rot (property)
+ then
then
- linefeed parse encode-string
- " /chosen" (find-dev) if
- " bootargs" rot (property)
+ linefeed parse dup if
+ encode-string
+ " /chosen" (find-dev) if
+ " bootargs" rot (property)
+ then
+ else
+ 2drop
then
;
More information about the OpenBIOS
mailing list