diff --git a/bootboot.efi b/bootboot.efi index cbc20c4..6d0f0b5 100755 Binary files a/bootboot.efi and b/bootboot.efi differ diff --git a/bootboot.rom b/bootboot.rom index fad245d..11cb290 100644 Binary files a/bootboot.rom and b/bootboot.rom differ diff --git a/x86_64-efi/Makefile b/x86_64-efi/Makefile index 7053bdf..c6fa3c6 100644 --- a/x86_64-efi/Makefile +++ b/x86_64-efi/Makefile @@ -14,7 +14,7 @@ all: tinflate.o $(TARGET) %.efi: %.so @echo " src x86_64-efi (UEFI)" - @objcopy -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel -j .rela -j .rel.* -j .rela.* -j .reloc --target efi-app-$(ARCH) --subsystem=13 $^ $@ + @objcopy -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel -j .rela -j .rel.* -j .rela.* -j .reloc --target efi-app-$(ARCH) --subsystem=10 $^ $@ @echo -n "BOOTBOOT Loader do not " | dd conv=notrunc of=$(TARGET) bs=1 seek=78 1>/dev/null 2>/dev/null @gcc $(GNUEFI_INCLUDES) -Wall -fshort-wchar efirom.c -o efirom $(LIBS) @./efirom $(TARGET) ../bootboot.rom || true diff --git a/x86_64-efi/efirom.c b/x86_64-efi/efirom.c index 56fd712..f3a65be 100644 --- a/x86_64-efi/efirom.c +++ b/x86_64-efi/efirom.c @@ -90,6 +90,11 @@ static void read_pe_info ( void *pe, uint16_t *machine, dos = pe; nt = ( pe + dos->e_lfanew ); + /* issue 4: TianoCore demands subsystem 10, so we must use EFI_APPLICATION + * in the PE header. Therefore we force EFI_ROM subsystem in this code here. */ + if(nt->nt64.OptionalHeader.Subsystem == 10) + nt->nt64.OptionalHeader.Subsystem = 13; + /* Parse out PE information */ *machine = nt->nt64.FileHeader.Machine; *subsystem = nt->nt64.OptionalHeader.Subsystem;