Author: wmb Date: 2009-08-21 11:28:53 +0200 (Fri, 21 Aug 2009) New Revision: 1316
Modified: ofw/core/bootparm.fth Log: New "last" devalias reports the device name of the device that was last used for load/boot. It's useful in e.g. /boot/olpc.fth for chaining to a file on the same device.
Modified: ofw/core/bootparm.fth =================================================================== --- ofw/core/bootparm.fth 2009-08-21 09:27:16 UTC (rev 1315) +++ ofw/core/bootparm.fth 2009-08-21 09:28:53 UTC (rev 1316) @@ -95,6 +95,13 @@ then ;
+: make-last-alias ( adr len -- ) + [char] \ left-parse-string 2nip ( dev$ ) + dup 0= if 2drop exit then ( dev$ ) + 2dup + 1- c@ [char] : = if 1- then ( dev$' ) + " last" 2swap $devalias ( ) +; + : (boot-read) ( adr len -- ) opened-ih if ( adr len ) 2drop opened-ih 0 to opened-ih ( ihandle ) @@ -105,7 +112,9 @@ ( print-probe-list ) true abort" "r"nCan't open boot device"r"n" then ( fileid ) - dup ihandle>devname limit-1023 load-path place-cstr drop ( fileid ) + dup ihandle>devname ( fileid path$ ) + 2dup make-last-alias ( fileid path$ ) + limit-1023 load-path place-cstr drop ( fileid ) >r ( ) load-started 0 !load-size load-base ( load-adr )
openfirmware@openfirmware.info