sys: parse drive number and load BPB

This commit is contained in:
Nero 2021-12-11 16:46:00 +00:00
parent a3ef693059
commit 725213b581
8 changed files with 436 additions and 5 deletions

View file

@ -11,7 +11,7 @@ PRODUCT = rdos
LABEL = $(PRODUCT) $(VERSION)
NASM = nasm
NASM_ARGS = -s -Ilib -DPRODUCT=$(PRODUCT) -DVERSION=$(VERSION)
NASM_ARGS = -s -Ilib --before "cpu 8086" -DPRODUCT=$(PRODUCT) -DVERSION=$(VERSION)
QEMU_ARGS += $(shell test -w /dev/kvm && echo --enable-kvm)
@ -28,7 +28,7 @@ SYS = host/sys.elf
FIXROM = host/fix-rom.elf
.PHONY: default clean qemu-floppy5 qemu-floppy3
.PRECIOUS: $(DISTFILES)
.PRECIOUS: %.com
default: fd1440.img
@ -37,7 +37,7 @@ host/%.elf: host/%.c
$(CC) -o $@ $<
# COM programs
%.com: com/%.asm
%.com: src/%.asm src/*.inc
$(NASM) $(NASM_ARGS) -o $@ $<
# Bootloaders, first sector on partition
@ -86,5 +86,8 @@ qemu-hdd: hdd.img $(ROMS)
qemu-uartctrl: uartctrl.rom chartab.bs
$(QEMU) $(QEMU_ARGS) -option-rom uartctrl.rom -serial stdio -hda chartab.bs
dosbox-%: %.com
dosbox -c "mount P $(CURDIR)" -c "P:" -c "$< $(ARGS)"
dosbox-%: %.com fd1440.img
dosbox -c "mount P $(CURDIR)" -c "P:" -c "IMGMOUNT A: FD1440.IMG -t floppy" -c "$< $(ARGS)" -c "pause" -c "exit"
emu2-%: %.com
emu2 $< $(ARGS)