X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=Makefile;h=362c429255dcef90992572cfe584f70047864f6c;hb=d8a61fe84d4b71c21c4ce18a9b7bc78000db725a;hp=1bfaabe82ac9c90f294f7c2fc0f7f7e7f9620cd3;hpb=a856c7d5b35de1b48bdd948186ec4a03f7c3685c;p=rrq%2Fjonasforth.git diff --git a/Makefile b/Makefile index 1bfaabe..362c429 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,23 @@ -.PHONY: run -run: main - cat sys.f - | ./main +.PHONY: qemu +qemu: out/main OVMF_CODE.fd OVMF_VARS.fd + # Based on https://wiki.osdev.org/UEFI#Emulation_with_QEMU_and_OVMF + qemu-system-x86_64 -cpu qemu64 \ + -drive if=pflash,format=raw,unit=0,file=OVMF_CODE.fd,readonly=on \ + -drive if=pflash,format=raw,unit=1,file=OVMF_VARS.fd \ + -net none \ + -drive format=raw,file=fat:rw:out \ + -display type=gtk,zoom-to-fit=on -main: main.asm impl.asm bootstrap.asm - fasm $< $@ +# Assuming 'ovmf' package on Arch Linux is installed. +OVMF_CODE.fd: /usr/share/ovmf/x64/OVMF_CODE.fd + cp $< $@ +OVMF_VARS.fd: /usr/share/ovmf/x64/OVMF_VARS.fd + cp $< $@ + +out/main: main.asm impl.asm bootstrap.asm sys.f os/uefi.asm + mkdir -p out + OS_INCLUDE=os/uefi.asm fasm $< $@ .PHONY: clean clean: - rm -f main + rm -rf out OVMF_CODE.fd OVMF_VARS.fd