Changeset 2900
- Timestamp:
- Mar 19, 2012 10:52:46 PM (14 months ago)
- File:
-
- 1 edited
-
cpu/x86/pc/olpc/via/fsupdate.fth (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cpu/x86/pc/olpc/via/fsupdate.fth
r2872 r2900 94 94 ; 95 95 96 h# 1be. 2value pt \ device byte offset to start of partition table 97 h# 10 value /pe \ size of a partition entry 98 /pe buffer: pe \ partition entry buffer 99 100 : pe-seek ( partition# -- ) 101 1- /pe * 0 pt d+ ( d.pos ) 102 " seek" nandih $call-method drop ( ) 103 ; 104 105 : pe-read ( partition# -- ) pe-seek pe /pe " read" nandih $call-method drop ; 106 : pe-write ( partition# -- ) pe-seek pe /pe " write" nandih $call-method drop ; 107 108 : pe-start@ ( pe -- start ) pe h# 08 + le-l@ ; 109 : pe-length@ ( pe -- length ) pe h# 0c + le-l@ ; 110 : pe-length! ( length pe -- ) pe h# 0c + le-l! ; 111 112 : pe-is-set? ( partition# -- flag ) pe-read pe-start@ pe-length@ or ; 113 114 : (resize:) ( -- ) 115 4 pe-is-set? abort" partition 4 is non-zero" 116 3 pe-is-set? abort" partition 3 is non-zero" 117 " size" nandih $call-method d# 512 um/mod swap drop 118 ( d-end ) 119 2 pe-read ( d-end ) 120 pe-start@ dup >r ( d-end p-start ) ( r: p-start ) 121 pe-length@ + swap ( p-end d-end ) ( r: p-start ) 122 2dup > abort" partition ends beyond device size" 123 2dup < if ( p-end d-end ) ( r: p-start ) 124 nip r> - pe-length! ( ) ( r: ) 125 2 pe-write ( ) ( r: ) 126 else ( p-end d-end ) ( r: p-start ) 127 r> 3drop ( ) ( r: ) 128 then ( ) ( r: ) 129 ; 130 96 131 : data: ( "filename" -- ) 97 132 safe-parse-word ( filename$ ) … … 242 277 : fs-update ( "devspec" -- ) 243 278 safe-parse-word $fs-update 279 ; 280 281 : fs-resize ( -- ) 282 open-nand 283 [ also nand-commands ] (resize:) [ previous ] 284 close-nand 244 285 ; 245 286
Note: See TracChangeset
for help on using the changeset viewer.
