Commit dd39e94c authored by Aleksey R. (aka EreTIk)'s avatar Aleksey R. (aka EreTIk)
Browse files

Add support for native QEMU for Windows (WSL)

parent d0010475
Pipeline #9658 failed with stage
in 13 minutes and 18 seconds
......@@ -28,7 +28,7 @@ else
QEMUFLAGS+=-netdev user,id=net0,hostfwd=tcp::8080-:8080,hostfwd=tcp::8083-:8083,hostfwd=tcp::64126-:64126 -device e1000,netdev=net0,id=nic0
else
QEMUFLAGS+=-netdev user,id=net0 -device e1000,netdev=net0 \
-object filter-dump,id=f1,netdev=net0,file=build/network.pcap
-object filter-dump,id=f1,netdev=net0,file=$(WORKING_DIR)build/network.pcap
endif
endif
endif
......@@ -41,12 +41,19 @@ endif
ifeq ($(gdb),yes)
QEMUFLAGS+=-s
endif
ifeq ($(UNAME),Linux)
ifneq ($(kvm),no)
QEMUFLAGS+=-enable-kvm -cpu host
else
QEMUFLAGS+=-cpu max
ifeq ($(wsl_qemu),)
ifeq ($(UNAME),Linux)
ifneq ($(kvm),no)
QEMUFLAGS+=-enable-kvm -cpu host
else
QEMUFLAGS+=-cpu max
endif
endif
WORKING_DIR=
else
QEMUFLAGS+=-accel whpx,kernel-irqchip=off -accel tcg -cpu qemu64,+fpu,+sse,+pae,+pse,+pge,+fxsr,+xsave
QEMU:="$(shell wslpath -u "$(wsl_qemu)")"
WORKING_DIR:=\\"$(shell wslpath -w ./)\\"
endif
#,int,pcall
#-device intel-iommu
......@@ -60,95 +67,96 @@ build/extra.bin:
endif
qemu: build/harddrive.bin build/extra.bin
echo $(WORKING_DIR)
$(QEMU) $(QEMUFLAGS) \
-drive file=build/harddrive.bin,format=raw \
-drive file=build/extra.bin,format=raw
-drive file=$(WORKING_DIR)build/harddrive.bin,format=raw \
-drive file=$(WORKING_DIR)build/extra.bin,format=raw
qemu_no_build: build/extra.bin
$(QEMU) $(QEMUFLAGS) \
-drive file=build/harddrive.bin,format=raw \
-drive file=build/extra.bin,format=raw
-drive file=$(WORKING_DIR)build/harddrive.bin,format=raw \
-drive file=$(WORKING_DIR)build/extra.bin,format=raw
qemu_efi: build/harddrive-efi.bin build/extra.bin
$(QEMU) $(QEMUFLAGS) \
-bios $(QEMU_EFI) \
-drive file=build/harddrive-efi.bin,format=raw \
-drive file=build/extra.bin,format=raw
-drive file=$(WORKING_DIR)build/harddrive-efi.bin,format=raw \
-drive file=$(WORKING_DIR)build/extra.bin,format=raw
qemu_efi_no_build: build/extra.bin
$(QEMU) $(QEMUFLAGS) \
-bios $(QEMU_EFI) \
-drive file=build/harddrive-efi.bin,format=raw \
-drive file=build/extra.bin,format=raw
-drive file=$(WORKING_DIR)build/harddrive-efi.bin,format=raw \
-drive file=$(WORKING_DIR)build/extra.bin,format=raw
qemu_nvme: build/harddrive.bin build/extra.bin
$(QEMU) $(QEMUFLAGS) \
-drive file=build/harddrive.bin,format=raw,if=none,id=drv0 -device nvme,drive=drv0,serial=NVME_SERIAL \
-drive file=build/extra.bin,format=raw,if=none,id=drv1 -device nvme,drive=drv1,serial=NVME_EXTRA
-drive file=$(WORKING_DIR)build/harddrive.bin,format=raw,if=none,id=drv0 -device nvme,drive=drv0,serial=NVME_SERIAL \
-drive file=$(WORKING_DIR)build/extra.bin,format=raw,if=none,id=drv1 -device nvme,drive=drv1,serial=NVME_EXTRA
qemu_nvme_no_build: build/extra.bin
$(QEMU) $(QEMUFLAGS) \
-drive file=build/harddrive.bin,format=raw,if=none,id=drv0 -device nvme,drive=drv0,serial=NVME_SERIAL \
-drive file=build/extra.bin,format=raw,if=none,id=drv1 -device nvme,drive=drv1,serial=NVME_EXTRA
-drive file=$(WORKING_DIR)build/harddrive.bin,format=raw,if=none,id=drv0 -device nvme,drive=drv0,serial=NVME_SERIAL \
-drive file=$(WORKING_DIR)build/extra.bin,format=raw,if=none,id=drv1 -device nvme,drive=drv1,serial=NVME_EXTRA
qemu_nvme_efi: build/harddrive-efi.bin build/extra.bin
$(QEMU) $(QEMUFLAGS) \
-bios $(QEMU_EFI) \
-drive file=build/harddrive-efi.bin,format=raw,if=none,id=drv0 -device nvme,drive=drv0,serial=NVME_SERIAL \
-drive file=build/extra.bin,format=raw,if=none,id=drv1 -device nvme,drive=drv1,serial=NVME_EXTRA
-drive file=$(WORKING_DIR)build/harddrive-efi.bin,format=raw,if=none,id=drv0 -device nvme,drive=drv0,serial=NVME_SERIAL \
-drive file=$(WORKING_DIR)build/extra.bin,format=raw,if=none,id=drv1 -device nvme,drive=drv1,serial=NVME_EXTRA
qemu_nvme_efi_no_build: build/extra.bin
$(QEMU) $(QEMUFLAGS) \
-bios $(QEMU_EFI) \
-drive file=build/harddrive-efi.bin,format=raw,if=none,id=drv0 -device nvme,drive=drv0,serial=NVME_SERIAL \
-drive file=build/extra.bin,format=raw,if=none,id=drv1 -device nvme,drive=drv1,serial=NVME_EXTRA
-drive file=$(WORKING_DIR)build/harddrive-efi.bin,format=raw,if=none,id=drv0 -device nvme,drive=drv0,serial=NVME_SERIAL \
-drive file=$(WORKING_DIR)build/extra.bin,format=raw,if=none,id=drv1 -device nvme,drive=drv1,serial=NVME_EXTRA
qemu_nvme_live: build/livedisk.bin build/extra.bin
$(QEMU) $(QEMUFLAGS) \
-drive file=build/livedisk.bin,format=raw,if=none,id=drv0 -device nvme,drive=drv0,serial=NVME_SERIAL \
-drive file=build/extra.bin,format=raw,if=none,id=drv1 -device nvme,drive=drv1,serial=NVME_EXTRA
-drive file=$(WORKING_DIR)build/livedisk.bin,format=raw,if=none,id=drv0 -device nvme,drive=drv0,serial=NVME_SERIAL \
-drive file=$(WORKING_DIR)build/extra.bin,format=raw,if=none,id=drv1 -device nvme,drive=drv1,serial=NVME_EXTRA
qemu_nvme_live_no_build: build/extra.bin
$(QEMU) $(QEMUFLAGS) \
-drive file=build/livedisk.bin,format=raw,if=none,id=drv0 -device nvme,drive=drv0,serial=NVME_SERIAL \
-drive file=build/extra.bin,format=raw,if=none,id=drv1 -device nvme,drive=drv1,serial=NVME_EXTRA
-drive file=$(WORKING_DIR)build/livedisk.bin,format=raw,if=none,id=drv0 -device nvme,drive=drv0,serial=NVME_SERIAL \
-drive file=$(WORKING_DIR)build/extra.bin,format=raw,if=none,id=drv1 -device nvme,drive=drv1,serial=NVME_EXTRA
qemu_live: build/livedisk.bin build/extra.bin
$(QEMU) $(QEMUFLAGS) \
-drive file=build/livedisk.bin,format=raw \
-drive file=build/extra.bin,format=raw
-drive file=$(WORKING_DIR)build/livedisk.bin,format=raw \
-drive file=$(WORKING_DIR)build/extra.bin,format=raw
qemu_live_no_build: build/extra.bin
$(QEMU) $(QEMUFLAGS) \
-drive file=build/livedisk.bin,format=raw \
-drive file=build/extra.bin,format=raw
-drive file=$(WORKING_DIR)build/livedisk.bin,format=raw \
-drive file=$(WORKING_DIR)build/extra.bin,format=raw
qemu_iso: build/livedisk.iso build/extra.bin
$(QEMU) $(QEMUFLAGS) \
-boot d -cdrom build/livedisk.iso \
-drive file=build/extra.bin,format=raw
-drive file=$(WORKING_DIR)build/extra.bin,format=raw
qemu_iso_no_build: build/extra.bin
$(QEMU) $(QEMUFLAGS) \
-boot d -cdrom build/livedisk.iso \
-drive file=build/extra.bin,format=raw
-drive file=$(WORKING_DIR)build/extra.bin,format=raw
qemu_iso_efi: build/livedisk-efi.iso build/extra.bin
$(QEMU) $(QEMUFLAGS) \
-bios $(QEMU_EFI) \
-boot d -cdrom build/livedisk-efi.iso \
-drive file=build/extra.bin,format=raw
-drive file=$(WORKING_DIR)build/extra.bin,format=raw
qemu_iso_efi_no_build: build/extra.bin
$(QEMU) $(QEMUFLAGS) \
-bios $(QEMU_EFI) \
-boot d -cdrom build/livedisk-efi.iso \
-drive file=build/extra.bin,format=raw
-drive file=$(WORKING_DIR)build/extra.bin,format=raw
qemu_extra: build/extra.bin
$(QEMU) $(QEMUFLAGS) \
-drive file=build/extra.bin,format=raw
-drive file=$(WORKING_DIR)build/extra.bin,format=raw
qemu_nvme_extra: build/extra.bin
$(QEMU) $(QEMUFLAGS) \
-drive file=build/extra.bin,format=raw,if=none,id=drv1 -device nvme,drive=drv1,serial=NVME_EXTRA
-drive file=$(WORKING_DIR)build/extra.bin,format=raw,if=none,id=drv1 -device nvme,drive=drv1,serial=NVME_EXTRA
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment