duskos

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

commit 0b0b4fa5bcc5bdb5720269962c3cef9b9c969a67
parent 1d5816f9012deea2bcd6a909e96ccbc04b18a906
Author: Virgil Dupras <hsoft@hardcoded.net>
Date:   Sun,  5 Feb 2023 12:09:54 -0500

pc: beefing up my tooling

As I've announced previously, I've been working mostly from within Dusk on my
target vintage laptop and it's been going great, but changes that implied
changing the boot sequence (kernel, bootlo, fat) weren't because my tooling is
inadequate: each try of the code I make has a high chance of breaking the system
and resetting it is time consuming.

I'm currently beeking up my tooling to allow alt-boot sequences.

Diffstat:
Mfs/doc/hw/i386/pc/deploy.txt | 4++--
Afs/home/chs.fs | 15+++++++++++++++
Mfs/home/init.fs | 1+
Afs/home/initw.fs | 15+++++++++++++++
Afs/xcomp/i386/pc/mbri.fs | 15+++++++++++++++
5 files changed, 48 insertions(+), 2 deletions(-)

diff --git a/fs/doc/hw/i386/pc/deploy.txt b/fs/doc/hw/i386/pc/deploy.txt @@ -104,5 +104,5 @@ the disk. Some PCs have weird drive geometry and you should ensure that you have the right one setup in your FAT headers. For example, I was really confused by how I couldn't get my Zenith Data System Pentium 75Mhz laptop to cross the first cylinder boundary, after head $0f (the BIOS *says* the HDD has 16 heads), but it -turns out that, on that 1G hard drive, the proper value for "numheads" is 46. -Weird but true. To do this kind of debugging, see hw/i386/pc/bios13. +turns out that, on that 1G hard drive, the proper value for "numheads" is 64. +To do this kind of debugging, see hw/i386/pc/bios13. diff --git a/fs/home/chs.fs b/fs/home/chs.fs @@ -0,0 +1,14 @@ +\ explore contents of sectors in CHS addressing in BIOS INT13h +\ This only works on a "bare" system without PIC, ATA etc. +?f<< /lib/fmt.fs +?f<< /lib/diag.fs + +0 value cyl +0 value head +1 value sec + +: .addr cyl . spc> head . spc> sec . nl> ; +: look .addr DRVNO head cyl sec BIOSBUF int13h BIOSBUF dump ; +: s+ 1 to+ sec look ; +: h+ 1 to+ head 1 to sec look ; +: c+ 1 to+ cyl 0 to head 1 to sec look ; +\ No newline at end of file diff --git a/fs/home/init.fs b/fs/home/init.fs @@ -27,6 +27,7 @@ f<< /drv/pc/ps28042.fs 8042ps2$ ' 8042kbd@? ' (ps2@?) realias +bootchoice 'w' = [if] f<< /home/initw.fs \s [then] bootchoice 'a' = [if] f<< /home/init2.fs \s [then] f<< fs/fat.fs diff --git a/fs/home/initw.fs b/fs/home/initw.fs @@ -0,0 +1,15 @@ +." work!\n" +f<< fs/fat.fs + +f<< /sys/loop.fs + +f<< /lib/fmt.fs +f<< /lib/diag.fs +f<< /sys/rdln.fs +f<< /text/pager.fs +f<< /lib/context.fs +context asm +?f<< /asm/i386.fs +context ed +f<< /text/ged.fs +: init S" Dusk OS\n" stype .free rdln$ stdio$ spager$ quit ; diff --git a/fs/xcomp/i386/pc/mbri.fs b/fs/xcomp/i386/pc/mbri.fs @@ -0,0 +1,14 @@ +\ Compile and install the MBR in target drive +?f<< /asm/i386.fs + +0 value mbr +0 value mbrlen +: compilembr + S" xcomp/i386/pc/mbr.fs" curpath :find# Path :fload + org to mbr here org - to mbrlen ; + +: installmbr ( drv -- ) + dup 0 here rot Drive :sec@ ( drv ) + mbr here $3e + mbrlen move ( drv ) + 0 here rot Drive :sec! ; + +\ No newline at end of file