IPLs for x86 processors are board agnostic and support both 32- and 64-bit architectures.
The provided IPLs assume the x86 board has a PC-compatible BIOS and is configured to boot to legacy BIOS mode. Some recent boards use a Unified Extensible Firmware Interface (UEFI) or an Automotive Boot Loader (ABL) instead. The BIOS, UEFI, or ABL is in the board's firmware, which the board manufacturer can modify or update. (For simplicity, this guide uses BIOS unless it is discussing something specific to a UEFI or ABL.)
The startup program in the build file should match the board firmware. For example, when you boot to legacy BIOS mode, you must include startup-x86 (or startup-x86-32) in the build file. When you boot to UEFI, no QNX ILP is used and you must include startup-uefi (or startup-uefi-32) in the build file.
The BIOS looks after all the hardware initializations (for example, clocks, memory controller). When it finishes and passes execution to the IPL, the IPL only has to look after finding, validating, and loading the IFS.
Because the IPL for an x86 disk boot has to boot off partitioned media, it is composed of two IPLs we'll call IPL1 and IPL2. Both IPL1 and IPL2 are written in assembly. The division into IPL1 and IPL2 is necessary because the first code to execute on an x86 board must be inside the disk's Master Boot Record (MBR). Because this area has has only a few hundred bytes of storage, IPL1 is always very small.
Since the IPL for x86 boards is generic, its source code files are rarely included in a BSP. Instead, when you build a BSP, the generic IPL modules are retrieved from the SDP directories.
IPL1 is usually called ipl-diskpc1 and it begins execution after the BIOS has completed all the hardware initializations. Its tasks are to determine the disk and partition to boot from, load the first sector of IPL2, and transfer execution to IPL2.
IPL2 is usually called ipl-diskpc2-fsq6 (the suffix -fsq6 indicates that it is designed to boot from an fs-qnx6 file system) and performs the same tasks as the main() function in an ARM IPL (see ARM IPLs in this chapter). Like IPL1, IPL2 is written in assembly. However, IPL2 is stored in reserved sectors within the Power-Safe filesystem.
The mkqnx6fs utility creates and configures IPL2 (see mkqnx6fs in the Utilities Reference).
To update IPL2 to a newer version without reformatting or losing the filesystem contents, use mkqnx6fs -B.
ipl-diskpc2-fsq6 can boot only little-endian, Power-Safe filesystems, which are either formatted with mkqnx6fs -el on any machine or natively formatted on a little-endian platform with an unspecified endian-ness.
Because IPL2 is larger than the single block loaded by IPL1, its first action is to load the rest of its code. Next, it validates the filesystem and locates the most recent stable snapshot. In a Power-Safe filesystem (fs-qnx6.so), the IFS for an x86 board is always stored as a regular file in the /.boot directory. To be bootable, a file cannot be a zero-length file and its filename cannot be longer than 27 characters. If no file that meets these criteria is found, a "Missing OS Image" message is displayed.
If the /.boot directory contains only a single bootable file, it is booted immediately.
If more than one file is available, IPL2 displays all bootable files from the /.boot directory as a scrolling list and pauses for 3–4 seconds for a key press. You can use the up and down arrows to move from one file to another and press Enter to select a file. You can also press Home and End go to the beginning or end of the list. A maximum of 10 files are displayed on the screen. To see more files, press the up or down arrows until the list scrolls.
If you don't press a key before the timeout, the loader boots the default image. This file is always displayed as the first item in the list and is the file with the most recent modification time. (If more than one file has the most recent modification time, the file with the larger inode number is used). Generally speaking, this is the image that was copied into the directory most recently. You can use the touch utility to change the default image and the following command to determine the default file:
ls -t /.boot | head -1
After IPL2 has determined which IFS to try to boot first, it populates the boot header structure startup_header with the information that the OS startup code needs to start the OS (see The startup header).
If the IFS is compressed, the IPL copies the IFS to a temporary location in RAM and the startup code handles the extraction to the final location (see Startup Programs).
The boot loader can display the following error messages:
To access the Power-Safe filesystem, IPL2 needs to know in which partition on the disk the filesystem is located. Because IPL1 does not provide this information, the filesystem contains a dedicated field (offset) that specifies at which Logical Block Addressing (LBA) location the partition begins. How the filesystem is created and intialized determines if and how this field is set.
When you use mkxfs or mkqnx6fsimg to create an image of an individual Power-Safe filesystem, because you can use the partition image anywhere, no offset information is available yet. When this type of image is applied to a target disk partition, you can use the patch command provided by the partition table editor pted to provide the filesystem offset information.
The pted utility automatically performs the patching process. Because it knows the partition’s location and the filesystem’s internal structure, it can locate the offset field and populate it with the correct value. The patch command has no arguments other than the one that specifies which partition to patch.
For more information, see pted in the Utilities Reference.
For more information about Power-Safe filesystems, see Power-Safe filesystem in the System Architecture guide and fs-qnx6.so in the Utilities Reference.