Make mechanism for using qemu with option roms generic

This commit is contained in:
Nero 2019-09-18 11:03:21 +00:00
parent c70f388548
commit 7d7b4a89e6

View File

@ -2,17 +2,19 @@ FLOPPY = 360
PROGRAMS = $(patsubst %.asm,%.com,$(wildcard programs/*.asm))
DISTFILES = kernel.com $(PROGRAMS)
ROMS =
QEMU_ARCH = $(shell uname -m)
QEMU = qemu-system-$(QEMU_ARCH)
QEMU_ARGS = $(addprefix --option-rom ,$(ROMS))
ifdef KVM
QEMU_ARGS += --enable-kvm
endif
ifdef DEBUG
QEMU_ARGS += -option-rom debug.rom
DEBUGROM = debug.rom
ROMS += debug.rom
endif
ifndef DISPLAY
@ -48,8 +50,8 @@ hdimage.img: boot/mbr.bs fdimage.img
clean:
rm -f *.com *.bin *.rom *.img *.log *.bs *.lst programs/*.com
qemu-floppy: fdimage.img $(DEBUGROM)
qemu-floppy: fdimage.img $(ROMS)
$(QEMU) $(QEMU_ARGS) -boot c -fda fdimage.img
qemu-hdd: hdimage.img $(DEBUGROM)
qemu-hdd: hdimage.img $(ROMS)
$(QEMU) $(QEMU_ARGS) -boot c -hda hdimage.img