UEFI
为什么要有 UEFI,Guest 里用 UEFI 能有什么好处?
UEFI uses the GPT partitioning scheme and supports much greater drive sizes. In addition, UEFI provides better security with the Secure Boot feature, preventing unauthorized apps from booting.
UEFI Shell / Grub Shell
Conceptually, a shell is built “around” some aspect of a rather complex system and provides simplified abstractions for users to gain access to the underlying infrastructure.
A platform running a BIOS that is UEFI-compliant is what might be characterized as the “rather complex item” that a UEFI Shell is built around.
The UEFI Shell is unusual in that it is not a shell that is a client of an operating system, but is actually considered a BIOS extension.
From: Harnessing the UEFI Shell
UEFI NVRAM variables
To create persistent variables between boots, an NVRAM (non-volatile RAM) is used in UEFI to store UEFI variables. Because the bootloader and other drivers are configured to load information from NVRAM, if we can write to some of these NVRAM variables, we will have control over parts of how the system boots.
UEFI defines variables through which an OS can interact with the firmware. A UEFI variable is specified with a combination of
- a GUID of the variable owner, this prevents name collisions between different vendors.
- a name,
- and a value.
There are some standard UEFI variables that are used for UEFI Boot Manager that are commonly used:
- Boot####: A boot load option. #### is a printed hex value.
- BootOrder: The ordered boot option load list.
- BootNext: The boot option for the next boot only.
- BootCurrent: The boot option selected for the current boot.
Sending data from UEFI to OS through UEFI variables | by Davy Souza | Medium
UEFI application
Booting Linux from GPT disks on UEFI systems involves creation of an EFI system partition (ESP), which contains UEFI applications such as bootloaders, operating system kernels, and utility software.
UEFI Hob / Hob list
HOB 是 Hand-off Block
的缩写。是 PEI 阶段向 DXE 传递系统信息的手段。按照 HOB 的使用情况,可以将整个 BIOS 的启动阶段分为两个部分:
- HOB 生成阶段(HOB producer phase),用来创建和修改 HOB;
- HOB 消费阶段(HOB consumer phase),用来使用 HOB,注意此阶段 HOB 是只读的。
HOB 是系列的连续的内存结构体(所以是堆在 RAM 中的),可以认为其由三部分构成:
- 第一部分,是 PHIT (Phase Handoff Information Table) 头,它描述了 HOB 的起始地址以及总的内存使用;
- 第二部分是 Hob 列表,DXE 阶段会根据这一部分获取相关资源;
- 第三部分是结束部分。
详细来说,HOB 列表的第一个必须要是 PHIT HOB。
根据 HOB 中包含的数据的不同可以对 HOB 进行分类:
// Union of all the possible HOB Types.
typedef union {
EFI_HOB_GENERIC_HEADER *Header;
EFI_HOB_HANDOFF_INFO_TABLE *HandoffInformationTable;
EFI_HOB_MEMORY_ALLOCATION *MemoryAllocation;
EFI_HOB_MEMORY_ALLOCATION_BSP_STORE *MemoryAllocationBspStore;
EFI_HOB_MEMORY_ALLOCATION_STACK *MemoryAllocationStack;
EFI_HOB_MEMORY_ALLOCATION_MODULE *MemoryAllocationModule;
EFI_HOB_RESOURCE_DESCRIPTOR *ResourceDescriptor;
EFI_HOB_GUID_TYPE *Guid;
EFI_HOB_FIRMWARE_VOLUME *FirmwareVolume;
EFI_HOB_FIRMWARE_VOLUME2 *FirmwareVolume2;
EFI_HOB_FIRMWARE_VOLUME3 *FirmwareVolume3;
EFI_HOB_CPU *Cpu;
EFI_HOB_MEMORY_POOL *Pool;
EFI_HOB_UEFI_CAPSULE *Capsule;
UINT8 *Raw;
} EFI_PEI_HOB_POINTERS;
【UEFI基础】HOB介绍_uefi buildguidhob-CSDN博客
Platform Initialization (PI) Phases
SEC, PEI, DXE, BDS.