commit 69f29a79e6ce34a55c1fdb3449e8b2568d6452a1
parent 6483d9cd3ab8e8c8e7061cb0914a8125334ed827
Author: Virgil Dupras <hsoft@hardcoded.net>
Date: Sat, 23 Jul 2022 08:26:54 -0400
i386: implement (alias) abort quit
I hit a strange I/O bug in mbr.fs: when I add to much comments (I think when
mbr.fs hits the $400 size mark), I get messed up results (mostly hang during
the build). It must be a bug in the FAT driver... TODO
Diffstat:
2 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/fs/xcomp/i386.fs b/fs/xcomp/i386.fs
@@ -9,7 +9,10 @@
0 to realmode
0 value L1
+0 value lblmainalias
$8000 to binstart \ This code lives at $8000.
+$6000 const RSTOP
+$8000 const PSTOP
here to org
forward16 jmp, to L1
@@ -28,14 +31,30 @@ xcode (val)
BX pspush,
ret,
+xcode (alias)
+ ax pop,
+ ax ax 0 d) mov, \ TODO: support ax 0 d) jmp,
+ ax jmp,
+
+xcode main
+ xwordlbl (alias) abs>rel call,
+ pc to lblmainalias 0 ,
+
+xcode quit
+ cld,
+ sp RSTOP i) mov,
+ xwordlbl main abs>rel call,
+
xcode fooval
xwordlbl (val) abs>rel call,
$07690748 ,
-xcode mainloop
+xcode abort
L1 forward!
- bp $8000 i) mov,
- sp $6000 i) mov,
+ bp PSTOP i) mov,
+ xwordlbl quit abs>rel jmp,
+
+pc lblmainalias pc>addr !
xwordlbl fooval abs>rel call,
AX pspop,
$b8000 m) ax mov,
diff --git a/fs/xcomp/pc/mbr.fs b/fs/xcomp/pc/mbr.fs
@@ -11,8 +11,7 @@ forward8 jmp, to L1 \ bypass BPB
$23 allot L1 forward!
cli, cld, GDTADDR m) lgdt,
ax $0003 i) mov, $10 int, \ video mode 80x25
-\ read sector 2 from boot floppy in memory at address $8000
-ax $0201 i) mov, bx $8000 i) mov, cx $0002 i) mov, dx $0000 i) mov, $13 int,
+ax $0210 i) mov, bx $8000 i) mov, cx $0002 i) mov, dx $0000 i) mov, $13 int,
ax cr0 mov, ax 1 i) or, cr0 ax mov,
$08 0 jmpfar, here org - binstart + here 4 - w! 0 to realmode
\ initialize all segments