From cdbb44d062b15c2839a66b96d0a6f9290d1ad499 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Thu, 27 Jun 2024 13:04:03 -0400 Subject: [PATCH] pc-bios: target Dusk v8 --- pc-bios/Makefile | 8 ++--- pc-bios/bios13.fs | 91 ----------------------------------------------- pc-bios/init.fs | 17 +++++---- 3 files changed, 12 insertions(+), 104 deletions(-) delete mode 100644 pc-bios/bios13.fs diff --git a/pc-bios/Makefile b/pc-bios/Makefile index 3280f5b..9bb9e59 100644 --- a/pc-bios/Makefile +++ b/pc-bios/Makefile @@ -1,4 +1,4 @@ -DUSKVER = v7 +DUSKVER = v8 TARGET = pcbios.img TARGETS = $(TARGET) bios13.img include ../common.mk @@ -7,9 +7,9 @@ QEMU_FLAGS = -accel kvm -accel tcg -rtc base=utc ../pc-piix/pc.img: $(MAKE) -C ../pc-piix pc.img -$(TARGET): ../pc-piix/pc.img +$(TARGET): ../pc-piix/pc.img init.fs cp ../pc-piix/pc.img $@ - cat init.fs $(FS)/xcomp/init.fs | mcopy -sQ -D o -i $@ - ::init.fs + mcopy -sQ -D o -i $@ init.fs :: .PHONY: emul emul: $(TARGET) @@ -17,7 +17,7 @@ emul: $(TARGET) -drive file=$(TARGET),format=raw,index=0,if=ide bios13.img: $(DUSK) $(FS)/xcomp/i386/pc/bios13.fs - echo " org 512 dataio write bye" | cat bios13.fs - \ + echo " org 512 dataio write bye" | cat $(FS)/xcomp/i386/pc/bios13.fs - \ | $(DUSK) 3> $@ # This script is not portable ./bios13gen.sh >> $@ || echo "bios13gen.sh failed. incomplete image, but it's going to somewhat work" diff --git a/pc-bios/bios13.fs b/pc-bios/bios13.fs deleted file mode 100644 index f6b4e3d..0000000 --- a/pc-bios/bios13.fs +++ /dev/null @@ -1,91 +0,0 @@ -\ TODO: this file normally lives in Dusk, but Duskv7 shipped with this unit -\ being broken. In the next release, we can remove this unit from -\ duskos-deployment. -\ Tool to debug PC INT13H. see doc/hw/i386/pc/bios13 -needs asm/i386 -1 to realmode - -$7c00 to binstart -0 value lblstart -0 value lblmsg -0 value lblprinthex -0 value lblkeypress -0 value lblloop - -here# to org $aa55 here# $1fe + w! -forward8 jmp, to lblstart -pc \ list of messages, 4 chars each -,"DL StopGeo SectErr Data" - -pc to lblmsg \ si=idx preserves cx/dx - cx push, dx push, - si 2 i) shl, ( x4 ) si swap ( pc ) i) add, cl 4 i) mov, - ah $0e i) mov, bx $0007 i) mov, - pc al 0 si+) mov, $10 int, si inc, cl dec, ( pc ) abs>rel jnz, - dx pop, cx pop, ret, - -pc to lblprinthex \ al=num preserves cx/dx - cx push, dx push, ah $0e i) mov, bx $0007 i) mov, - ax push, al 4 i) shr, - al '0' i) add, al ':' i) cmp, forward8 jc, al 7 i) add, forward! $10 int, - ax pop, al $0f i) and, - al '0' i) add, al ':' i) cmp, forward8 jc, al 7 i) add, forward! $10 int, - dx pop, cx pop, ret, - -pc to lblkeypress - ah ah xor, $16 int, \ read key press - al 's' i) cmp, forward8 jnz, - cl inc, - forward! - al 'h' i) cmp, forward8 jnz, - cl 1 i) mov, dh inc, - forward! - al 'c' i) cmp, forward8 jnz, - cl 1 i) mov, dh dh xor, ch inc, - forward! - ret, - -lblstart forward! -cli, cld, ax ax xor, es ax mov, ds ax mov, ss ax mov, sp $7c00 i) mov, sti, -ax $0003 i) mov, $10 int, \ video mode 80x25 -si 0 i) mov, lblmsg abs>rel call, -al dl mov, lblprinthex abs>rel call, - -ah ah xor, $13 int, \ reset - -\ If you want a hardcoded drive parameters, uncomment code below -\ dl $80 i) mov, - -si 2 i) mov, lblmsg abs>rel call, -dx push, ah 8 i) mov, $13 int, \ dh=numheads-1 cl&3f=sec per trk -al dh mov, lblprinthex abs>rel call, -al cl mov, lblprinthex abs>rel call, -dx pop, -\ int13h AH=08 can change ES! reset it -ax ax xor, es ax mov, - -\ We begin at cylinder 0, head 0, sector 1 -cx $0001 i) mov, \ ch=cyl cl=sec -dh dh xor, \ dh=head -pc to lblloop - si 3 i) mov, lblmsg abs>rel call, - al ch mov, lblprinthex abs>rel call, - al cl mov, lblprinthex abs>rel call, - al dh mov, lblprinthex abs>rel call, - al dl mov, lblprinthex abs>rel call, - bx $8000 i) mov, - ax $0201 i) mov, \ ah=read cmd al=read 1 sector - $13 int, forward8 jnc, - \ error - si 4 i) mov, lblmsg abs>rel call, - lblprinthex abs>rel call, - al ah mov, lblprinthex abs>rel call, - lblkeypress abs>rel call, - lblloop abs>rel jmp, - forward! - \ no error, print - si 5 i) mov, lblmsg abs>rel call, - di 8 i) mov, si $8000 i) mov, - pc al 0 si+) mov, lblprinthex abs>rel call, si inc, di dec, abs>rel jnz, - lblkeypress abs>rel call, - lblloop abs>rel jmp, diff --git a/pc-bios/init.fs b/pc-bios/init.fs index 472e97b..a38e489 100644 --- a/pc-bios/init.fs +++ b/pc-bios/init.fs @@ -4,15 +4,14 @@ needs drv/pc/acpi drv/pc/vga newvgagrid !{>grid} ' gridemit EMIT ! -f<< /sys/kbd.fs - -f<< /drv/pc/ps28042p.fs -f<< /drv/ps2.fs +needs io/kbd drv/pc/ps28042p drv/ps2 ' 8042kbd@? ' (ps2@?) realias -PS2Set1Keyboard :new keyboard' ! +newps2set1kbd to keyboard + +needs io/prompt +prompt$ -f<< /lib/fmt.fs -f<< /lib/diag.fs -f<< /sys/rdln.fs -: init ."Dusk OS\n" .free rdln$ quit ; +needs lib/fmt lib/diag +0 showprogress ! +."Dusk OS\n" .free -- 2.45.2