Changeset 2186


Ignore:
Timestamp:
Apr 13, 2011, 11:37:18 PM (4 years ago)
Author:
wmb
Message:

OLPC fsupdate - changed the error checking to work correctly for .zd and .zsp files that write block 0 last.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpu/x86/pc/olpc/via/fsupdate.fth

    r2043 r2186  
    99; 
    1010 
    11 0 value last-eblock# 
    12 : erase-eblock  ( eblock# -- ) 
    13    \ XXX 
    14    to last-eblock# 
    15 ; 
     110 value #eblocks-written 
    1612 
    1713: ?all-written  ( -- ) 
    18    last-eblock# 1+ #image-eblocks <>  if 
     14   #eblocks-written #image-eblocks <>  if 
    1915      cr 
    2016      red-letters 
    2117      ." WARNING: The file specified " #image-eblocks .d 
    22       ." chunks but wrote only " last-eblock# 1+ .d ." chunks" cr 
     18      ." chunks but wrote only " #eblocks-written .d ." chunks" cr 
    2319      black-letters 
    2420   then 
     
    27230 value secure-fsupdate? 
    2824d# 128 constant /spec-maxline 
    29  
    30 : erase-gap  ( end-block -- ) 
    31    dup last-eblock# >  if 
    32       last-eblock# 1+  ?do  i erase-eblock  loop 
    33    else 
    34       drop 
    35    then 
    36 ; 
    3725 
    3826\ We simultaneously DMA one data buffer onto NAND while unpacking the 
     
    8876   " write-blocks-end" $call-nand   ( error? ) 
    8977   " Write error" ?nand-abort 
    90 \   #image-eblocks erase-gap 
    9178   hdd-led-off 
    9279   release-inflater 
     
    11299 
    113100: erase-all  ( -- ) 
    114    #image-eblocks  0  ?do  i erase-eblock  loop 
    115101   #image-eblocks show-writing 
    116102; 
     
    215201\  then 
    216202 
    217    dup to last-eblock#                   ( eblock# ) 
    218    show-written                          ( ) 
     203   show-written                             ( ) 
     204   #eblocks-written 1+ to #eblocks-written  ( ) 
    219205   show-temperature 
    220206   hdd-led-toggle 
Note: See TracChangeset for help on using the changeset viewer.