Initial Program Loaders (IPLs)

IPLs initialize the hardware, set up a stack for the C-language environment, load the OS image into memory, and finish up by jumping to the QNX startup code.

An IPL is minimalist; it uses as little code as possible to get the startup code to run. An IPL first sets up the minimal environment needed to execute its compiled C code, which then looks up the OS image and loads it into memory. Thus, an IPL performs the following tasks, in sequence:

  1. Complete hardware initializations, if needed.
  2. Set up a stack for the C-language environment.
  3. Find and validate the OS image.
  4. Load the OS image into memory.
  5. Jump to the OS startup code.

An IPL can be stored on either a linearly-mapped device, such as a NOR Flash memory device, or a non-linearly-mapped device, such as an eMMC, SD card, or SPI NOR Flash device. Like the board architecture, the type of memory device on which the IPL and the OS image are stored on determines the design of the IPL (see Factors affecting IPL design below, and Image storage later in this chapter).

Factors affecting IPL design

The design and content of an IPL are affected by numerous factors, including:

IPLs are hardware architecture-specific. IPLs for x86 processors and ARM processors are very different (see From reset to startup).
In addition to being architecture-specific, an IPL is specific to the board (and even the board variant) that it runs on. It must be customized so that it knows how to configure the memory controller, set the clocks, and perform other hardware initializations.
Supported removeable media
The IPL must take into account the type of removable media that the board retrieves the boot image from, because this removable media determines the boot strategies and techniques that the IPL can use.
Although linear media are supported, non-linear media (for example, USB key or onboard eMMC, NOR flash, or NAN flash) has become the most common option.
Size of the storage media
Whether the IFS image is compressed or uncompressed depends on the size and performance of the storage media. For both compressed and uncompressed images, the IPL copies the IFS to RAM and then jumps to the startup code. The startup code determines whether the image is compressed or not, decompresses it (if it is compressed), and then relocates it to its proper location in RAM. Because all these tasks add time to the boot process, you can configure the boot process to copy the IFS to its final location, instead of the startup code.