Beyond BIOS: Implementing the Unified Extensible Firmware Interface with Intel's Framework

Two roads diverged in a wood .
Robert Frost, "The Road Less Taken"
The restart of a system admits to many possibilities, or paths of execution. The restart of a CPU execution for a given CPU can have many causes and different environment states that impinge upon it. These can include requests to the firmware for an update of the flash store, resumption of a power management event, initial startup of the system, and other possible restarts. This chapter describes some of these possible flows and how the Framework handles the events.
To begin, the normal code flow in the Framework passes through a succession of phases, in the following order:
SEC
PEI
DXE
BDS
Runtime
Afterlife
This chapter describes alternatives to this ordering, which can also be seen in Figure 14.1.
The PEI Foundation is unaware of the boot path required by the system. It relies on the PEIMs to determine the boot mode R0, R1, S3, and so on and to take appropriate action depending on the mode. To implement this determination of the boot mode, each PEIM has the ability to manipulate the boot mode using the PEI Service SetBootMode() described in Chapter 15. Note that the PEIM does not change the order in which PEIMs are dispatched depending on the boot mode.
The list of possible boot modes and their corresponding priorities is shown in the following section. Framework architecture avoids defining an upgrade path...