Changeset 3366


Ignore:
Timestamp:
Oct 13, 2012, 3:30:13 AM (3 years ago)
Author:
wmb
Message:

OLPC trac #12106 and #12181 - inflate initrd images from inside a .zip bundle.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpu/x86/pc/olpc/security.fth

    r3364 r3366  
    797797      img$  sig$  sha-valid?  if
    798798         show-unlock
    799          img$ place-ramdisk
     799         img$ $inflated? drop  place-ramdisk
    800800         exit
    801801      else
  • ofw/core/infltdi.fth

    r1 r3366  
    5252' try-inflate to ?inflate
    5353
    54 : (?inflate-loaded)  ( -- )
    55    load-base  " "(1f8b08)"  comp 0=  if
    56       load-base  loaded +  tuck  inflate  !load-size  ( infl-adr )
    57       loaded move                                     ( )
     54\ Inflates the image at adr len if it is compressed.
     55\ The uncompressed image is placed after the compressed image in memory,
     56\ so sufficient space must be available there.  In practice, this
     57\ usually means that adr should be in the region beginning at load-base .
     58
     59: $inflated?  ( adr len -- adr' len' true | adr len false )
     60   over " "(1f8b08)"  comp 0=  if    ( adr len )
     61      over +  4 round-up  tuck       ( adr+len adr adr+len )
     62      inflate  true                  ( adr' len' true )
     63   else                              ( adr len )
     64      false                          ( adr len false )
    5865   then
    5966;
     67: (?inflate-loaded)  ( -- )
     68   loaded $inflated?  if       ( adr len )
     69      !load-size  loaded move  ( )
     70   else                        ( adr len )
     71      2drop                    ( )
     72   then
     73;
     74
    6075' (?inflate-loaded) to ?inflate-loaded
    6176headers
Note: See TracChangeset for help on using the changeset viewer.