00_Boot Flows - manojkumarpaladugu/UEFI-BIOS-Development GitHub Wiki
Introduction:
The PEI foundation is unaware the system boot pat. Only PEIMs know the boot mode and takes appropriate actions based on the boot mode.
To implement this each PEIM has the ability to change the boot mode using PeiService SetBootMode().
Change in boot mode doesn’t influence the order of PEIMs dispatched.
Code Flow:
The normal code flow in platform initialization is in the following order.
- SEC
- PEI
- DXE
- BDS
- Runtime
- Afterlife
Defined Boot modes:
The list of possible boot modes is defined in GetBootMode() function.
Priority of Boot Paths:
Within a given PEIM, the priority of the boot mode is from highest to lowest.
-
BOOT_IN_RECOVERY_MODE
-
BOOT_ON_FLASH_UPDATE
-
BOOT_ON_S3_RESUME
-
BOOT_WITH_MINIMAL_CONFIGURATION
-
BOOT_WITH_FULL_CONFIGURATION
-
BOOT_ASSUMING_NO_CONFIGURATION_CHANGES
-
BOOT_WITH_FULL_CONFIGURATION_PLUS_DIAGNOSTICS
-
BOOT_WITH_DEFAULT_SETTINGS
-
BOOT_ON_S4_RESUME
-
BOOT_ON_S5_RESUME
-
BOOT_ON_S2_RESUME
The boot modes listed above are defined in PEI services SetBootMode().
Reset Boot Paths:
- Intel Itanium Processor Reset: The internal microcode on the processor silicon, which starts up at PowerGood reset, finds the first layer of processor abstraction code (called PAL-A) located in the BFV. If the authentication of PAL-A passes, then invokes next layer PAL-B.
- Non-Power-On Reset:
Non-power-on reset can occur for many reasons. Some PEI and DXE services reset and reboot the entire platform. This can occur due to following reasons.
- Resetting processor to change frequency settings
- Resetting hardware to complete chipset initialization
- Responding to catastrophic failure
Normal Boot Path:
- Basic G0 to S0 and S0 variation boot paths:
S0 boot path is boot with full configuration. This setting informs all PEIMs to do full configuration.
Other supported booth paths:- Boot with minimal configuration
- Boot assuming no configuration changes
- Boot with full configuration plus diagnostics
- Boot with default settings
- S-State boot paths:
- S3 (Suspend to RAM): Must take extra care to preserve/restore system RAM and critical hardware, assumes previous settings are valid.
- S4 (Suspend to Disk): It is similar to S5, platform completely initializes, assumes previous settings are valid.
- S5 (Soft off): Platform initializes completely, can’t assume previous settings are valid.
Recovery Paths:
All the previously described boot paths can be modified or aborted if the system detects the recovery is needed. Recovery is the process of reconstituting a system’s firmware that have been corrupted. Generally, firmware is present in non-volatile memory as blocks. The reasons for firmware corruption could be a errant hardware or software.