Author: quozl Date: Thu Jul 12 09:24:50 2012 New Revision: 3052 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3052
Log: OLPC XO-1.5 XO-1.75 - an fs-load command, the reverse of fs-save, very slow, but useful for testing.
Added: cpu/x86/pc/olpc/via/fsload.fth Modified: cpu/arm/olpc/build-fw.fth cpu/x86/pc/olpc/via/fw.bth
Modified: cpu/arm/olpc/build-fw.fth ============================================================================== --- cpu/arm/olpc/build-fw.fth Thu Jul 12 08:29:04 2012 (r3051) +++ cpu/arm/olpc/build-fw.fth Thu Jul 12 09:24:50 2012 (r3052) @@ -660,6 +660,7 @@ fload ${BP}/cpu/x86/pc/olpc/via/fsupdate.fth fload ${BP}/cpu/x86/pc/olpc/via/fsverify.fth fload ${BP}/cpu/x86/pc/olpc/via/fssave.fth +fload ${BP}/cpu/x86/pc/olpc/via/fsload.fth devalias fsdisk int:0
\ create pong-use-touchscreen
Added: cpu/x86/pc/olpc/via/fsload.fth ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ cpu/x86/pc/olpc/via/fsload.fth Thu Jul 12 09:24:50 2012 (r3052) @@ -0,0 +1,51 @@ +\ Read blocks from a file and write to internal storage +[ifndef] fs-load +vocabulary fs-load-commands +also fs-load-commands definitions + +0 value data-buffer + +h# ff a5 00 rgb>565 constant loaded-color \ orange + +: (fs-load-chunk) ( #bytes -- ) + data-buffer over filefd fgets ( #bytes #read ) + over <> " Read failure" ?nand-abort ( #bytes #read ) + data-buffer swap " write" $call-nand ( #bytes ) + drop ( ) +; + +: (fs-load) ( -- ) + load-base to data-buffer + " size" $call-nand /nand-block um/mod ( #left-over-bytes #blocks ) + dup show-init + 0 do + /nand-block (fs-load-chunk) ( #left-over-bytes ) + i dup show-eblock# loaded-color show-state ( #left-over-bytes ) + loop ( #left-over-bytes ) + ?dup if ( #left-over-bytes ) + (fs-load-chunk) ( ) + then ( ) +; + +previous definitions + +: $fs-load ( file$ -- ) + open-nand ( file$ ) + r/o open-file ( fd error? ) + " Can't open file" ?nand-abort ( fd ) + to filefd ( ) + t-hms( + [ also fs-load-commands ] + ['] (fs-load) catch ( 0 | x error# ) + [ previous ] + show-done + close-nand-ihs + )t-hms + throw ( ) +; + +: fs-load ( "fs.img" -- ) \ read blocks from a file + safe-parse-word $fs-load +; + +[then]
Modified: cpu/x86/pc/olpc/via/fw.bth ============================================================================== --- cpu/x86/pc/olpc/via/fw.bth Thu Jul 12 08:29:04 2012 (r3051) +++ cpu/x86/pc/olpc/via/fw.bth Thu Jul 12 09:24:50 2012 (r3052) @@ -523,6 +523,7 @@ fload ${BP}/cpu/x86/pc/olpc/via/fsupdate.fth fload ${BP}/cpu/x86/pc/olpc/via/fsverify.fth fload ${BP}/cpu/x86/pc/olpc/via/fssave.fth +fload ${BP}/cpu/x86/pc/olpc/via/fsload.fth devalias fsdisk int:0
fload ${BP}/ofw/inet/sntp.fth
openfirmware@openfirmware.info