Boot Sequence States (Compact 2013)
3/26/2014
Ultimately, the purpose of a boot loader is to take the device from the point at which it turns on to the point at which it starts the OS. To accomplish this task, the CE Boot core code repeatedly calls boot scenario functions depending on the existing state. The boot scenario code then changes the state of the boot loader. This process cycles the boot loader through a series of states. The successful completion of the series of states is a jump to the OS entry point.
The sequence of states that the boot process goes through depends on the OS image type and how the image is to be downloaded to the device. All possible states are listed in the table below. The first state is BOOT_STATE_POWERON. The only states that are required are BOOT_STATE_FAILURE and BOOT_STATE_RUN.
The three most typical scenarios are described below the table.
CE Boot States
State |
Description |
---|---|
BOOT_STATE_POWERON |
The initial boot loader state. |
BOOT_STATE_FAILURE |
A failure has occurred at some point in the boot process. If this state is reached, the device turns off. |
BOOT_STATE_CONFIG |
The boot loader reads the saved or default boot loader configuration from persistent storage, and the user can choose configuration options from a boot menu. |
BOOT_STATE_DOWNLOAD |
The boot loader downloads the image into RAM or persistent storage. |
BOOT_STATE_PRELOAD |
The boot loader determines if it will boot the the normal OS image or an alternate kernel image. |
BOOT_STATE_LOAD_OS |
The boot loader loads the image from persistent storage into memory. |
BOOT_STATE_RUN |
The boot loader places the OS into memory. When the OS starts, the boot process is finished. This is the final boot loader state. |
The boot loader can place a Windows Embedded Compact 2013 image into memory (RAM) and then execute it, or it can first store it on the device in persistent storage and execute it from there. The sequence of states that the boot loader enters during the boot process depends on the OS image type and how the image is to be downloaded to the device.
The three main scenarios are listed below:
- Download an OS image into persistent storage and then load it into RAM
- Download an OS image directly into RAM
- Load an OS image that is already in persistent storage into RAM
The sequence of states in each of these scenarios is shown in the illustration below. The scenarios show a successful boot process. Failure at any point results in a state of BOOT_STATE_FAILURE.
Boot State Sequences
The sequences of states shown in the illustration are explained below.
Download an OS image into persistent storage and then load it into RAM
- When the device is started, the boot loader is in BOOT_STATE_POWERON.
- In BOOT_STATE_CONFIG, the boot loader loads the saved or default configuration boot settings, and the user can select choices from a boot menu.
- In BOOT_STATE_DOWNLOAD, the boot loader downloads the image into persistent storage, such as flash memory.
- In BOOT_STATE_PRELOAD, the boot loader determines if it will start the normal OS image. In this scenario, it starts it.
- In BOOT_STATE_LOAD_OS, the boot loader loads the image from persistent storage into RAM.
- Finally, BOOT_STATE_RUN signals the successful end to the boot process.
Download an OS image directly into RAM
- When the device is started, the boot loader is in BOOT_STATE_POWERON.
- In BOOT_STATE_CONFIG, the boot loader loads the saved or default configuration boot settings, and the user can select choices from a menu.
- In BOOT_STATE_DOWNLOAD, the boot loader loads the image into RAM.
- Finally, BOOT_STATE_RUN signals the successful end to the boot process.
Load an OS image that is already in persistent storage into RAM
- When the device is started, the boot loader is in BOOT_STATE_POWERON.
- In BOOT_STATE_CONFIG, the boot loader loads the saved or default configuration boot settings, and the user can select choices from a menu.
- In BOOT_STATE_PRELOAD, the boot loader determines if it will start the normal OS image. In this scenario, it starts it.
- In BOOT_STATE_LOAD_OS, the boot loader loads the image from persistent storage into RAM.
- Finally, BOOT_STATE_RUN signals the successful end to the boot process.