duskos

dusk os fork
git clone git://git.alexwennerberg.com/duskos
Log | Files | Refs | README | LICENSE

commit e23e97f467c3c9f90d4e102aa01cd3c1b0312bfd
parent e1549c08a2cd75d6837bb3f1cd8a32aef7f11cf5
Author: Virgil Dupras <hsoft@hardcoded.net>
Date:   Thu,  9 Feb 2023 15:31:01 -0500

pc: re-add "doc" folder into the image

I'm going to begin editing documentation from within Dusk too.

Also, change FAT creation parameters so that all sectors of a 1.44MB floppy are
used. Also, increase the Path buffer size to allow for the recursive copying of
all Dusk files.

Diffstat:
Mbuildpc.fs | 2+-
Mfs/fs/fat.fs | 3++-
Mfs/sys/file.fs | 6+++---
Mfs/xcomp/i386/pc/build.fs | 9++-------
4 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/buildpc.fs b/buildpc.fs @@ -1,5 +1,5 @@ f<< /xcomp/i386/pc/build.fs -S" pc.img" mountImage ( drv ) 1938 buildPC +S" pc.img" mountImage ( drv ) 2796 buildPC S" /xcomp/i386/pc/init.fs" S" /xcomp/init.fs" rot combineInit bye diff --git a/fs/fs/fat.fs b/fs/fs/fat.fs @@ -256,7 +256,8 @@ create _FATTemplate fatopts rsvdsec here $0e + w! fatopts rootentsec DirEntry SZ * here $11 + w! fatopts clustercnt fatopts secperclus * fatopts rootentsec + - fatopts rsvdsec + fatseccnt + here $13 + w! + fatopts rsvdsec + fatseccnt + dup here $13 + w! + ." TotSec " . nl> fatseccnt here $16 + w! $aa55 here $1fe + w! ( drv ) dup 0 here rot Drive :sec! ( drv ) diff --git a/fs/sys/file.fs b/fs/sys/file.fs @@ -13,9 +13,9 @@ bootfs filesystems ! \ record our boot FS in the list struct+[ Filesystem : :?newfile ( dirid name fs -- id ) - >r 2dup r@ :child ?dup if rdrop 2drop else r> :newfile then ; + >r 2dup r@ :child ?dup if rdrop nip nip else r> :newfile then ; : :?newdir ( dirid name fs -- id ) - >r 2dup r@ :child ?dup if rdrop 2drop else r> :newdir then ; + >r 2dup r@ :child ?dup if rdrop nip nip else r> :newdir then ; ]struct struct[ Path @@ -24,7 +24,7 @@ struct[ Path create _curpath bootfs , 0 , - $200 const BUFSZ + $400 const BUFSZ create _paths BUFSZ SZ * allot 0 value _pathidx diff --git a/fs/xcomp/i386/pc/build.fs b/fs/xcomp/i386/pc/build.fs @@ -30,12 +30,7 @@ org value kernel \ $00 to fatopts drvnum ( drv ) dup FAT newFAT12 FAT :mountvolume ; -: copyfs ( srcfs dstfs -- ) - 0 Path :new swap 0 Path :new Path :iter ( dst ) - Path :i Path :info dup FSInfo dir? - over FSInfo name S" doc" s= not and if ( dst info ) - FSInfo name over Path :newdir ( dst newdir ) - Path :i Path :copydir else drop then next ( dst ) drop ; +: copyfs ( srcfs dstfs -- ) 0 Path :new swap 0 Path :new Path :copydir ; $200 const SECSZ \ TODO: get from drive create _buf SECSZ allot0 @@ -53,7 +48,7 @@ create _buf SECSZ allot0 drop File :close rdrop ; : combineInit ( fname1 fname2 fat -- ) >r swap >r >r \ V1=fat V2=f1 V3=f2 - S" init.fs" V1 0 Path :new Path :newfile + 0 S" init.fs" V1 Filesystem :?newfile V1 swap Path :new V2 bootfs 0 Path :new Path :find# Path :copyfile V3 bootfs 0 Path :new Path :find# S" /init.fs" V1 0 Path :new Path :find# Path :appendfile