BOOT_SRC := boot/uefi/main.c # number of vCPUs. anything above 1 is required for SMP work (AP bringup). SMP ?= 4 SRC := $(KERNEL_SRC) $(ARCH_SRC) $(ARCH_ASM_SRC) $(BOOT_SRC) OBJ := $(patsubst %,$(BUILD)/%.o,$(SRC)) DEP := $(OBJ:.o=.d) .PHONY: run run: $(EFI) @mkdir -p $(BUILD_BOOT)/esp/EFI/BOOT cp $(EFI) $(BUILD_BOOT)/esp/EFI/BOOT/BOOTX64.EFI @test -f $(BUILD_BOOT)/OVMF_VARS.fd || cp /usr/share/edk2-ovmf/OVMF_VARS.fd $(BUILD_BOOT)/OVMF_VARS.fd qemu-system-x86_64 -m 128M -smp $(SMP) -no-reboot \ -drive if=pflash,format=raw,readonly=on,file=/usr/share/edk2-ovmf/OVMF_CODE.fd \ -drive if=pflash,format=raw,file=$(BUILD_BOOT)/OVMF_VARS.fd \ -drive format=raw,file=fat:rw:$(BUILD_BOOT)/esp \ -nographic $(EFI): $(OBJ) @mkdir -p $(dir $@) lld-link -subsystem:efi_application -entry:efi_main -nodefaultlib -out:$@ $^ -include $(DEP)