The following diagrams show some common methods for storing bootable images, and what
the IPL and startup code copy and extract to RAM in order to prepare the OS to run.
In the pseudo-code examples below, the image_paddr variable stores
the source location of the image in linear ROM, and the ram_paddr
variable stores the image's destination in RAM. For more information about the startup
header and its members, see The startup header in this
chapter.
Linear ROM XIP boot image
For an XIP image stored on a linearly mapped ROM device, the IPL needs to copy only the
startup code into RAM:
If the image on the linearly mapped device is compressed, XIP can't be used.
Instead, the IPL copies the startup code into RAM. Then, because the compressed image is
on linearly addressed media, the startup code can extract it directly from ROM to its
final location in RAM:
If XIP won't be used and the image isn't compressed, the IPL copies the startup code
into RAM, and this code simply copies the uncompressed image to the appropriate location
(ram_paddr) in RAM:
Suppose the image is loaded from a disk or a network onto an x86 system.
The BIOS or UEFI looks after loading the image into RAM (see x86 disk boot IPLs). The BIOS or UEFI doesn't know where to jump, so it jumps to its default
address, which is the start of the image. We place a small QNX IPL at this location;
this IPL simply jumps to the startup code at startup_vaddr:
Since the BIOS or UEFI handles everything else, the only step required in the IPL is the
jump instruction:
jump (startup_vaddr)
Disk/network compressed image (x86)
If the image loaded from disk or a network is compressed, the IPL still jumps to the
startup code (which can never be compressed), and the startup code extracts the image to
its required location in RAM: