Optimize the Boot Script

With the QNX Neutrino RTOS and its microkernel architecture, you can modify the script section in the buildfile to start services or applications earlier to take advantage of any idle time on the CPU.

This flexibility lets you start certain components in your system earlier. The script section is used to generate the boot script for a system.



Figure 1. Optimize the script section in the buildfile.
If your system and hardware platform permit, it's best to start device drivers only as required.
CAUTION:
This technique requires that you have a good understanding of the configuration of your buildfile. If any file is missing in the configuration, your system may fail to boot.
Note: Some hardware platforms require that all devices drivers be started at one time. For those platforms, you might not be able to use this technique to start applications before some of the device drivers.

Typically, the default buildfile that comes with the BSP that supports your QNX Platform for ADAS system (see the BSPs and Drivers project on Foundry27) starts the services and drivers that you're likely to need. However, you can optimize the buildfile to suit your specific target. Here are some examples of optimizations that you can try:

Start the SATA driver only if you're using AHCI SATA interfaces.
The default buildfile may include a script to start the SATA driver. For example:
...
# This waitfor is required only when the binaries
# are located in the filesystem, and not in the IFS.
waitfor /base/sbin/devb-ahci-omap5

# Starting SATA at /dev/satadrive0
devb-ahci-omap5 ahci
ioport=0x4a140000,irq=86 blk cache=16m,noatime
cam cache,async,quiet dos
exe=all disk name=satadrive &
...
                    
  1. The waitfor statement ensures that the binaries that are required by the SATA driver are in place before you start the driver. The waitfor is required only when the driver-related binaries are located in the filesystm instead of in the IFS. Optimize the boot time by excluding this waitfor statement when you're using SATA, and include the driver-related binaries in the IFS.
  2. If you're not using AHCI SATA interfaces, optimize the boot time by removing both the waitfor statement and the devb-ahci command to start the SATA driver.
Avoid using an "&" after your service or application startup command
If you specify an "&" after your service or application startup command, a waitfor may be executed, which may increase the boot time. For more information, see Consider the placement of waitfor statements in the Other System Optimization Practices section.
Starting required services and applications in the boot script
If you are including the Camera service and your camera application binaries and libraries in the primary IFS to try for a faster boot time, then you want to start them immediately after you start Screen in your boot script. See the Optimize the Boot Script chapter of Screen's Optimizing Startup Times guide.
Limit the number of services started in the boot script
It's best to minimize what is started by the boot script. However, in some situations, you might want to start some services, such as slogger, early so that you can debug your system. This practice is useful in the early stages of the development process, but later you might choose to disable slogger after your system is ready for production. You might find it useful to keep services enabled because they can help customer support troubleshoot issues in production systems.