Skip to content

How UEFI selects the image consistent with its architecture from the option rom, loads and executes it? #4048

Answered by Kostr
xuchao1234 asked this question in Q&A
Discussion options

You must be logged in to vote

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

///
/// 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    Compre…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by xuchao1234
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants