Changeset 2869
- Timestamp:
- Feb 20, 2012 8:21:56 AM (15 months ago)
- File:
-
- 1 edited
-
cpu/x86/pc/olpc/via/fsverify.fth (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cpu/x86/pc/olpc/via/fsverify.fth
r2508 r2869 8 8 get-hex# to #image-eblocks 9 9 open-nand 10 \ #image-eblocks show-init11 10 /nand-block /nand-page / to nand-pages/block 12 11 ; 13 12 14 13 : zblocks-end: ( -- ) 15 \ XXX could check that everything else is erased ...16 14 ; 17 15 … … 23 21 24 22 : erase-all ( -- ) 25 \ XXX probably should set a flag saying that unspecified blocks are expected to be ff26 23 ; 27 24 28 \ We simultaneously DMA one data buffer onto NAND while unpacking the29 \ next block of data into another. The buffers exchange roles after30 \ each block.31 25 load-base value data-buffer 32 26 … … 49 43 safe-parse-word hex-decode ( eblock# hashname$ [ hash$ ] err? ) 50 44 " Malformed hash string" ?nand-abort ( eblock# hashname$ hash$ ) 51 45 52 46 verify-hash ( eblock# okay? ) 53 \ if show-written else show-bad then ( )54 47 swap .d if (cr else cr then 55 48 ; … … 57 50 previous definitions 58 51 59 : fs-verify ( "devspec"-- )60 load-crypto abort" Can't load hash routines" 52 : $fs-verify ( file$ -- ) 53 load-crypto abort" Can't load hash routines" ( file$ ) 61 54 62 false to secure-fsupdate? 63 safe-parse-word r/o open-file ( fd ) 64 abort" Can't open file" ( fd ) 55 false to secure-fsupdate? ( file$ ) 56 r/o open-file abort" Can't open file" ( fd ) 65 57 66 file @ ( fd fd' )67 over file ! linefeed line-delimiter c! ( fd fd' )68 file ! ( fd )58 file @ ( fd fd' ) 59 over file ! linefeed line-delimiter c! ( fd fd' ) 60 file ! ( fd ) 69 61 70 62 t-hms( 71 also fs-verify-commands 72 ['] include-file catch ?dup if ( x error )63 also fs-verify-commands 64 ['] include-file catch ?dup if ( x error ) 73 65 nip .error 74 66 then … … 78 70 )t-hms 79 71 ; 72 73 : fs-verify ( "devspec" -- ) 74 safe-parse-word $fs-verify 75 ; 76 80 77 [then] 81 78
Note: See TracChangeset
for help on using the changeset viewer.
