Author: wmb
Date: 2009-12-06 14:57:39 +0100 (Sun, 06 Dec 2009)
New Revision: 1542
Modified:
ofw/fs/zipfs.fth
Log:
Fixed a bug in zipfs's handling of symlinks - it caused dir to hang.
Modified: ofw/fs/zipfs.fth
===================================================================
--- ofw/fs/zipfs.fth 2009-12-06 13:56:04 UTC (rev 1541)
+++ ofw/fs/zipfs.fth 2009-12-06 13:57:39 UTC (rev 1542)
@@ -45,6 +45,8 @@
0 instance value name-len
: zip-name$ ( -- adr len ) zip-name name-len ;
+d# …
[View More]512 instance buffer: saved-name
+
d# 512 instance buffer: path-prefix
0 instance value prefix-len
: prefix$ ( -- adr len ) path-prefix prefix-len ;
@@ -376,7 +378,7 @@
\ di-expansion be-l@ ( id s m h d m y size )
\ ?dup 0= if di-size be-l@ then ( id s m h d m y size )
zip-attrs ( id s m h d m y size attributes )
- zip-name$ ( id s m h d m y size attr name$ )
+ zip-name$ saved-name $save ( id s m h d m y size attr name$ )
prefix-len /string ( id s m h d m y size attr name$' )
true ( id s m h d m y size attr name$ true )
exit
[View Less]
Author: wmb
Date: 2009-12-06 07:49:17 +0100 (Sun, 06 Dec 2009)
New Revision: 1540
Modified:
dev/ramdisk.fth
Log:
Ramdisk driver - moved base address and size assumptions out of the driver code; they can be set externally.
Modified: dev/ramdisk.fth
===================================================================
--- dev/ramdisk.fth 2009-12-06 06:18:01 UTC (rev 1539)
+++ dev/ramdisk.fth 2009-12-06 06:49:17 UTC (rev 1540)
@@ -1,23 +1,29 @@
\ See license at end of file
purpose: Block-…
[View More]method additions to subrange.fth device to make a RAMdisk device
-0 0 " b000000" " /" begin-package
- " ramdisk" device-name
- h# 3800000 constant /device
+\ Define ramdisk-base before loading this file
+0 0 ramdisk-base (u.) " /" begin-package
+
+" ramdisk" device-name
+0 value /device \ Range size, set later with set-size
+
external
-\ /device must be defined externally as the length of the subrange
-\ my-space is the base of the subrange
my-address my-space /device reg
0 value offset \ seek pointer
+\ Reduce adr,len as necessary to fit within the actual device size
: clip-size ( adr len -- adr actual )
offset + /device min offset - ( adr actual )
;
+
+\ Update the seek pointer to reflect the result of the previous read or write
: update-ptr ( actual -- actual ) dup offset + to offset ;
external
+
+\ Standard interface methods for a byte-granularity device
: open ( -- flag ) 0 to offset true ;
: close ( -- ) ;
@@ -36,9 +42,12 @@
tuck offset my-space + swap move ( actual )
update-ptr
;
-: size ( -- d ) /device 0 ;
+: size ( -- d ) /device u>d ;
+\ Device-specific method to set the device size when it is known
+: set-size ( d -- ) drop to /device ;
+\ Standard interface methods for block-granularity access
h# 200 value block-size
: #blocks ( -- n ) /device block-size / ;
: read-blocks ( adr block# #blocks -- actual-#blocks )
[View Less]
Author: wmb
Date: 2009-12-06 07:18:01 +0100 (Sun, 06 Dec 2009)
New Revision: 1539
Added:
cpu/x86/pc/olpc/sba.fth
Log:
Initial checkin of sba.fth
Added: cpu/x86/pc/olpc/sba.fth
===================================================================
--- cpu/x86/pc/olpc/sba.fth (rev 0)
+++ cpu/x86/pc/olpc/sba.fth 2009-12-06 06:18:01 UTC (rev 1539)
@@ -0,0 +1,69 @@
+\ See license at end of file
+purpose: Subrange device to access Secure Boot Area between boot record and …
[View More]first partition
+
+d# 512 constant /sector
+/sector instance buffer: sector-buf
+
+0 instance 2value image-size
+0 instance 2value seek-ptr
+external
+\ Expose for the OLPC security scheme
+0 instance 2value offset
+
+: clip-size ( adr len -- adr len' )
+ u>d seek-ptr d+ ( adr d.endptr )
+ 2dup image-size d> if ( adr d.endptr )
+ 2drop image-size ( adr d.endlimit )
+ then ( adr d.endlimit )
+ seek-ptr d- drop ( adr len' )
+;
+: update-ptr ( len' -- len' ) dup u>d seek-ptr d+ to seek-ptr ;
+
+: ptable-adr ( -- start ) sector-buf h# 1be + ;
+
+: open ( -- flag )
+ sector-buf /sector " read" $call-parent /sector <> if false exit then
+ sector-buf h# 1fe + le-w@ h# aa55 <> if false exit then \ FDisk?
+ ptable-adr 4 + c@ 7 <> if false exit then \ NTFS?
+ ptable-adr 8 + le-l@ /sector um* to image-size
+ h# 10 /sector um* to offset
+ true
+;
+
+external
+: seek ( d.offset -- status )
+ 2dup image-size d> if 2drop true exit then \ Seek offset too big
+ to seek-ptr
+ seek-ptr offset d+ " seek" $call-parent
+;
+: size ( -- d.size ) image-size ;
+: read ( adr len -- actual )
+ clip-size ( adr len' )
+ " read" $call-parent ( len' )
+ update-ptr ( len' )
+;
+
+
+\ LICENSE_BEGIN
+\ Copyright (c) 2009 FirmWorks
+\
+\ Permission is hereby granted, free of charge, to any person obtaining
+\ a copy of this software and associated documentation files (the
+\ "Software"), to deal in the Software without restriction, including
+\ without limitation the rights to use, copy, modify, merge, publish,
+\ distribute, sublicense, and/or sell copies of the Software, and to
+\ permit persons to whom the Software is furnished to do so, subject to
+\ the following conditions:
+\
+\ The above copyright notice and this permission notice shall be
+\ included in all copies or substantial portions of the Software.
+\
+\ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+\ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+\ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+\ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+\ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+\ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+\ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+\
+\ LICENSE_END
[View Less]