commit 9e0b0db9d00ee12f42e5b8e2aa6756b91148e437
parent f1b17864898c4447d8b2b8eba70bb715242ea423
Author: Virgil Dupras <hsoft@hardcoded.net>
Date: Tue, 26 Jul 2022 07:23:14 -0400
pc: getting good with init
Also works on actual hardware!
Diffstat:
4 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/fs/drv/pc/int13h.fs b/fs/drv/pc/int13h.fs
@@ -7,8 +7,7 @@ $7c18 w@ const SECPERTRK
$7c1a w@ const NUMHEADS
$7c24 c@ const DRVNO
$80 const DRVNO
-SECPERTRK NUMHEADS * const SECPERCYL
: biossec@ ( sec dst -- )
- >r DRVNO swap SECPERCYL /mod ( drv sec cyl )
- swap SECPERTRK /mod ( drv cyl sec head ) rot> 1+ r> int13h ;
+ >r DRVNO swap SECPERTRK /mod ( drv sec trk )
+ NUMHEADS /mod ( drv sec head cyl ) rot 1+ r> int13h ;
diff --git a/fs/xcomp/i386.fs b/fs/xcomp/i386.fs
@@ -97,6 +97,12 @@ xcode [to]
lbltoptr m) ax mov,
ret,
+xcode to?
+ ax lbltoptr m) mov,
+ AX pspush,
+ lbltoptr m) 0 i) mov,
+ ret,
+
xcode main
wcall, (alias)
pc to lblmainalias 0 ,
@@ -496,6 +502,7 @@ pc to L1 ( word_eof )
lbltoptr m) ax mov,
ax ax xor,
AX pspush,
+ ret,
xcode maybeword ( -- str-or-0 )
\ save lbltoptr so that it doesn't mess in<, which could be calling a word
diff --git a/fs/xcomp/pc/glue1.fs b/fs/xcomp/pc/glue1.fs
@@ -1,2 +1,8 @@
BIOSSECSZ const drvblksz
alias biossec@ (drv@)
+\ this below is temporary. it's really useful for debugging...
+create _ ," 0123456789abcdef"
+: .xh $f and _ + c@ emit ;
+: .x1 dup 4 rshift .xh .xh ;
+: .x2 dup 8 rshift .x1 .x1 ;
+: .x ( n -- ) dup 16 rshift .x2 .x2 ;
diff --git a/fs/xcomp/pc/init.fs b/fs/xcomp/pc/init.fs
@@ -1,2 +1,6 @@
\ Initialization for PC
-: foo ." Hello Init!" ; foo bye
+0 S" sys" fchild S" file.fs" fchild fload
+\ We now have f<<
+f<< sys/doc.fs
+
+ : foo ." Hello Init!" ; foo bye