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