How UEFI selects the image consistent with its architecture from the option rom, loads and executes it? #4048
-
I didn't find any relevant processing in the "ProcessOpRomImage" function. Please tell me the location of the relevant code, Thank very much! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi! I'm not an expert, but I've tried to investigate this subject myself. According to the UEFI specification target You can find this field in the relevant ///
/// EFI PCI Expansion ROM Header
/// Section 13.4.2, Unified Extensible Firmware Interface Specification, Version 2.1
///
typedef struct {
UINT16 Signature; ///< 0xaa55
UINT16 InitializationSize;
UINT32 EfiSignature; ///< 0x0EF1
UINT16 EfiSubsystem;
UINT16 EfiMachineType; // <-------------
UINT16 CompressionType;
UINT8 Reserved[8];
UINT16 EfiImageHeaderOffset;
UINT16 PcirOffset;
} EFI_PCI_EXPANSION_ROM_HEADER; But it is not processed neither in the PCI ROM parsing code, nor in the So it looks like EDKII just loads every image without checking its machine type. And it is responsibility of the Here is the relevant info from the UEFI specification that supports this conclusion: |
Beta Was this translation helpful? Give feedback.
Hi!
I'm not an expert, but I've tried to investigate this subject myself.
According to the UEFI specification target
Machine Type
is encoded in the header of a ROM image:You can find this field in the relevant
EFI_PCI_EXPANSION_ROM_HEADER
structure https://github.com/tianocore/edk2/blob/master/MdePkg/Include/IndustryStandard/Pci22.h