Introduction
EFI (Extensible Firmware Interface) images are
PE/COFF files: the PE specification gives
subsystem values for EFI applications and drivers, and the EDK2 header
PeImage.h of the TianoCore project introduces its subsystem constants
under the heading “PE32+ Subsystem type for EFI images”. The headers, sections and
tables are those described on the .EXE page, with
PE32+ as the format named by that heading. The
sources consulted do not name the .efi extension.
A file dropped on any page opens in the explorer as a PE file, with its structure and code.
What is particular: the subsystem
Microsoft’s PE specification lists four EFI values of the subsystem field of the optional header:
| Value | Name | Description (Microsoft) |
|---|---|---|
| 10 | IMAGE_SUBSYSTEM_EFI_APPLICATION | An Extensible Firmware Interface (EFI) application |
| 11 | IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER | An EFI driver with boot services |
| 12 | IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER | An EFI driver with run-time services |
| 13 | IMAGE_SUBSYSTEM_EFI_ROM | An EFI ROM image |
EDK2’s PeImage.h defines the first three as
EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION,
EFI_IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER and
EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER, with the values 10, 11 and 12.
The same header lists these machine values: 0x014c (I386),
0x0200 (IA64), 0x0EBC (EBC), 0x8664 (X64),
0x01c2 (ARM Thumb mixed), 0xAA64 (ARM64),
0x5032, 0x5064 and 0x5128 (RISC-V 32, 64 and
128) and 0x6232 and 0x6264 (LoongArch 32 and 64). The
explorer shows the subsystem and the machine in the
optional header.
Not described
Unknown
- UEFI specification: its pages could not be fetched, so the entry point and its arguments, the section alignment it requires, the compressed and signed forms, and the file name extension are not described here.
Links
Software
Reference
- PE Format – Microsoft’s specification, with the subsystem values 10 to 13
- PeImage.h – EDK2’s definitions of the EFI subsystem and machine values
- UEFI Specifications – the UEFI Forum’s specifications (not read for this page)