Boot Scenario Code (Compact 2013)
3/26/2014
The core code calls boot scenario functions to perform individual tasks that the boot process requires. The boot scenario function that is called depends on the boot loader state. The boot scenario function then returns a new state. The process of calling the boot scenario functions repeats until a boot scenario function returns BOOT_STATE_FAILURE or BOOT_STATE_RUN.
Several of the boot scenario functions create and use boot drivers to do the work that the boot process requires. For an example of the life cycle of a driver that was created using the boot-driver factory function OEMBootCreateDriver, see Boot Driver Code.
The boot scenario functions, and their corresponding states, are shown in the table below. The boot scenario functions have only one input parameter, which is a pointer, pLoader, to the boot loader context. The return value is the updated boot loader state.
Boot Scenario Functions
Function |
Corresponding state |
Description |
---|---|---|
BootLoaderPowerOn |
BOOT_STATE_POWERON |
Simply returns the next boot state (BOOT_STATE_CONFIG), although you can add your own functionality instead. |
BootLoaderConfig |
BOOT_STATE_CONFIG |
Reads the boot loader configuration information from persistent storage, which the user can configure by selecting options from a boot menu. |
BootLoaderDownload |
BOOT_STATE_DOWNLOAD |
Calls other functions to download the image to the device, if it is not already in persistent storage. |
BootLoaderPreLoad |
BOOT_STATE_PRELOAD |
Determines whether the device should boot the ULDR image instead of the OS image. |
BootLoaderLoadOs |
BOOT_STATE_LOAD_OS |
Loads the OS image into RAM. |