commit ac9dde7d06f3fb9bf01006894cd19b64cbcc15d0
parent 2eddc11d55a8defae21212978b8f47823f9953da
Author: Virgil Dupras <hsoft@hardcoded.net>
Date: Tue, 27 Jun 2023 11:18:41 -0400
rpi: all tests/sys pass
Diffstat:
5 files changed, 17 insertions(+), 10 deletions(-)
diff --git a/fs/drv/ramdrive.fs b/fs/drv/ramdrive.fs
@@ -13,5 +13,5 @@ extends Drive struct[ RAMDrive
swap r@ _addr ( src dst ) r> Drive secsz move ;
: :new ( secsz seccnt -- drv )
- here rot , swap , ['] :sec@ , ['] :sec! , dup :bufsz allot ( drv ) ;
+ here# rot , swap , ['] :sec@ , ['] :sec! , dup :bufsz allot ( drv ) ;
]struct
diff --git a/fs/fs/fat.fs b/fs/fs/fat.fs
@@ -20,6 +20,7 @@
?f<< /lib/drivelo.fs
?f<< /fs/fatlo.fs
+?f<< /lib/fmt.fs
?f<< /lib/str.fs
extends FSInfo struct[ FATInfo
@@ -57,7 +58,7 @@ struct[ FatOpts
sfield drvnum
]struct
-here FatOpts SZ allot structbind FatOpts fatopts
+here# FatOpts SZ allot structbind FatOpts fatopts
struct+[ FAT
$e5 const DIRFREE
@@ -165,20 +166,22 @@ create _FATTemplate
( BootSig ) $29 c, ( VolID ) 0 , ( VolLabel ) ," NONAME "
( FilSysType ) ," FAT12 "
+: lew! ( n a -- ) \ w! that can write on odd addresses w/ alignment discipline
+ over 8 rshift over 1+ c! c! ;
: newFAT12 ( drv -- )
fatopts clustercnt 341 / 1+ >r \ V1=fatseccnt
( drv ) dup Drive secsz >r ( drv ) \ V2=secsz
- here V2 0 fill
+ here# V2 0 fill
_FATTemplate here $3e move ( drv )
- V2 here $0b + w!
+ V2 here $0b + lew!
fatopts secpertrk here $18 + w!
fatopts numheads here $1a + w!
fatopts drvnum here $24 + c!
fatopts secperclus here $0d + c!
fatopts rsvdsec here $0e + w!
- fatopts rootentsec DirEntry SZ * here $11 + w!
+ fatopts rootentsec DirEntry SZ * here $11 + lew!
fatopts clustercnt fatopts secperclus * fatopts rootentsec +
- fatopts rsvdsec + V1 + dup here $13 + w!
+ fatopts rsvdsec + V1 + dup here $13 + lew!
." TotSec " . nl>
V1 here $16 + w!
$aa55 here $1fe + w!
diff --git a/fs/xcomp/arm/rpi/glue.fs b/fs/xcomp/arm/rpi/glue.fs
@@ -1,4 +1,7 @@
emmc :init
emmc :self FAT :mountvolume ( fs ) structbind FAT bootfs
-bootfs :self 0 S" sys" bootfs :child S" file.fs" bootfs :child fload
+0 S" drv" bootfs :child S" rpi" bootfs :child
+ S" emmc.fs" bootfs :child floaded,
+0 S" lib" bootfs :child S" drivelo.fs" bootfs :child floaded,
+0 S" fs" bootfs :child S" fatlo.fs" bootfs :child floaded,
diff --git a/fs/xcomp/arm/rpi/init.fs b/fs/xcomp/arm/rpi/init.fs
@@ -7,3 +7,6 @@ uart$
f<< /sys/kbd.fs
' uart@? ' key? realias
+
+f<< /fs/fat.fs
+bootfs :patchlo
diff --git a/fs/xcomp/arm/rpi/kernel.fs b/fs/xcomp/arm/rpi/kernel.fs
@@ -255,7 +255,7 @@ xcode maybeword ( -- str-or-0 )
wcall, in<
xnip,
cmp) rTOP rn) 0 i) ,)
- L1 abs>rel b) le) ,)
+ L1 abs>rel b) le) ,) \ EOF
cmp) rTOP rn) SPC i) ,)
( pc ) abs>rel b) le) ,) \ rTOP=first non-ws
mov) r6 rd) 0 i) ,)
@@ -265,8 +265,6 @@ xcode maybeword ( -- str-or-0 )
str) rTOP rd) r5 rn) 8b) 1 +i) pre) !) ,)
wcall, in<
xnip,
- cmp) rTOP rn) 0 i) ,)
- L1 abs>rel b) le) ,)
cmp) rTOP rn) SPC i) ,)
( pc ) abs>rel b) gt) ,)
lblcurword rTOP pc>reg,