commit 3373039e13f2ed5ef0aa296c9a51866e66d26f43
parent 0b00c532fffe01598f771c6527467faaf5616094
Author: Virgil Dupras <hsoft@hardcoded.net>
Date: Fri, 17 Mar 2023 12:55:50 -0400
xcomp/tools: improve boot code "compression" algorithm
Things are becoming real tight in the $500-$7c00 space on PC. There was already
a "compression" algorithm in place to discard comments and double whitespaces
from the code before inserting it in the boot sequence, but it was imperfect:
if the "\" char wasn't the very first of the line (preceded by spaces), it was
kept. Not anymore. This allows us to stay under the fatal $7600 threshold in
pc.img.
EAX=2345 at bye
Diffstat:
3 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/fs/drv/pc/int13h.fs b/fs/drv/pc/int13h.fs
@@ -3,7 +3,6 @@
\ int13h ( drv head cyl sec dst ) word which must be implemented in the kernel.
\ This is slow, but will work on all PCs until a better driver is activated
-: foo $1234 bye ; foo
$200 const BIOSSECSZ
$7c18 w@ const SECPERTRK
$7c1a w@ const NUMHEADS
diff --git a/fs/xcomp/i386/pc/glue.fs b/fs/xcomp/i386/pc/glue.fs
@@ -1,4 +1,5 @@
\ Glue code that goes between the filesystem part and boothi
+$2345 bye
INT13hDrive FAT :mountvolume ( fs ) to bootfs
0 S" drv" bootfs Filesystem :child S" pc" bootfs Filesystem :child
S" int13h.fs" bootfs Filesystem :child floaded,
diff --git a/fs/xcomp/tools.fs b/fs/xcomp/tools.fs
@@ -33,6 +33,5 @@ LF value _last
dup case
'\' of = _last LF = if 1 to _incomment? 0 else 1 then endof
of ws? _last ws? not endof
- 1
- endcase ( c f ) over to _last dup not if nip then ;
-
+ 1 endcase ( c f )
+ dup if over to _last else nip then ;