Once developers get the system to boot for the first time, bootloader development often
goes on the back burner. Here are a few techniques that sometimes get overlooked (all
these optimizations are present in the QNX CAR platform):
Enable data and instruction cache as early as possible. This sounds obvious, but
some of the tight copy loops used in the bootloader benefit immensely from
having the instruction cache enabled.
Minimize or eliminate the boot script timeout. Bootloaders like RedBoot and
U-Boot, which run a script, typically contain an automatic timeout that lets you
abort the loading of one OS load and then load another OS. Also, the bootloader might
print messages (for instance, help or welcome messages) to the serial
port; you can suppress these. To modify the timeout in U-Boot, use the
bootdelay, bootcmd, and
preboot environment variables. For RedBoot, use
fconfig to change the value for Boot script timeout. This
step applies only if you're using a bootloader other than the IPL (which is not
recommended for production systems).
Don't scan for the OS image. If the system uses a default QNX IPL, you should
look at the code in main() within main.c
and remove anything unnecessary. In particular, look for code that calls
image_scan() and replace it with the OS image's hardcoded
address. You can also turn off the scan option when you generate the IPL (see
Generate the IPL to skip the image scan).
Note: If you pad the IPL to a fixed size, you will always know where
the OS image begins.
Eliminate the bootup checksum. In most cases, the system has a single OS image.
Consequently, performing a checksum to ensure the image's validity has little
value, since you can't perform a recovery if the image has failed. Also, the
checksum takes time; removing it allows your important code to start running
sooner.