Fix hdd booting using bpb struc

This commit is contained in:
Nero 2020-09-19 08:22:50 +00:00
parent 1d64c2364d
commit 8ed9fe7465
2 changed files with 11 additions and 20 deletions

View file

@ -6,6 +6,7 @@ QEMU = qemu-system-i386
QEMU_ARGS = $(addprefix --option-rom ,$(ROMS))
VERSION = $(shell git log -1 --format=%cd --date=format:%Y%m%d)
LABEL = RDOS $(VERSION)
NASM = nasm
NASM_ARGS = -s -Ilib -DVERSION=$(VERSION)
@ -59,22 +60,12 @@ fat6.bs: boot/fat.asm
$(NASM) $(NASM_ARGS) -o $@ $< && utils/fix-rom $@
fd%.img: kernel.bs $(DISTFILES)
mformat -C -i $@ -f $* -R 8 -B kernel.bs ::
mformat -C -i $@ -f $* -R 8 -v "$(LABEL)" -B kernel.bs ::
dd if=kernel.bs conv=notrunc bs=512 skip=1 seek=1 of=$@
mcopy -i $@ $(DISTFILES) ::
hdimage.img: mbr.bs fd1440.img
cat mbr.bs fd1440 >$@
part.img: fatc.bs $(DISTFILES)
dd if=/dev/zero bs=1024 count=33k of=$@
mformat -i $@ -F -B fatc.bs ::
mmd -i $@ ::rdos
mcopy -i $@ $(DISTFILES) ::rdos
mattrib -i $@ +s ::rdos ::rdos/kernel.bs
hdd.img: part.img mbr.bs
cat mbr.bs part.img > $@
cat mbr.bs fd1440.img >$@
clean:
rm -f *.com *.bs *.0 *.lst *.img *.bin *.rom
@ -83,8 +74,8 @@ clean:
qemu-floppy: fd1440.img $(ROMS)
$(QEMU) $(QEMU_ARGS) -boot a -fda fd1440.img
qemu-hdd: hdd.img $(ROMS)
$(QEMU) $(QEMU_ARGS) -boot c -hda hdd.img
qemu-hdd: hdimage.img $(ROMS)
$(QEMU) $(QEMU_ARGS) -boot c -hda hdimage.img
qemu-pxe: pxeboot.0 $(ROMS)
$(QEMU) $(QEMU_ARGS) -boot n \