1
0
Fork 0
mirror of https://gitlab.com/bztsrc/bootboot.git synced 2023-02-13 20:54:32 -05:00

Changed EFI PE subsystem per issue #4

This commit is contained in:
bzt 2020-01-05 14:03:22 +01:00
parent 0befcbe2af
commit d08079c3d0
4 changed files with 6 additions and 1 deletions

Binary file not shown.

Binary file not shown.

View file

@ -14,7 +14,7 @@ all: tinflate.o $(TARGET)
%.efi: %.so %.efi: %.so
@echo " src x86_64-efi (UEFI)" @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 @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) @gcc $(GNUEFI_INCLUDES) -Wall -fshort-wchar efirom.c -o efirom $(LIBS)
@./efirom $(TARGET) ../bootboot.rom || true @./efirom $(TARGET) ../bootboot.rom || true

View file

@ -90,6 +90,11 @@ static void read_pe_info ( void *pe, uint16_t *machine,
dos = pe; dos = pe;
nt = ( pe + dos->e_lfanew ); 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 */ /* Parse out PE information */
*machine = nt->nt64.FileHeader.Machine; *machine = nt->nt64.FileHeader.Machine;
*subsystem = nt->nt64.OptionalHeader.Subsystem; *subsystem = nt->nt64.OptionalHeader.Subsystem;