The buildfile for the default .boot image, qnxbasedma.build, includes lines that start the system by running diskboot.
[+script] startup-script = { # To save memory make everyone use the libc in the boot image! # For speed (less symbolic lookups) we point to libc.so.2 instead # of libc.so procmgr_symlink ../../proc/boot/libc.so.3 /usr/lib/ldqnx.so.2 # Default user programs to priority 10, other scheduler (pri=10o) # Tell "diskboot" this is a hard disk boot (-b1) # Tell "diskboot" to use DMA on IDE drives (-D1) # Start 4 text consoles by passing "-n4" to "devc-con" # and "devc-con-hid" (-o). # By adding "-e", the Linux ext2 filesystem will be mounted # as well. [pri=10o] PATH=/proc/boot diskboot -b1 -D1 \ -odevc-con,-n4 -odevc-con-hid,-n4 }
This script starts the system by running diskboot, a program that's used on disk-based systems to boot Neutrino. For the entire qnxbasedma.build file, see the Examples appendix.
When diskboot starts, it prompts:
Press the space bar to input boot options...
Most of these options are for debugging purposes. The diskboot program looks for a Neutrino partition to mount, then runs a series of script files to initialize the system:
The main script for initializing the system is /etc/system/sysinit; you usually keep local system initialization files in the /etc/rc.d directory. For example, if you want to run extra commands at startup on a node, say to mount an NFS drive, you might create a script file named rc.local, make sure it's executable, and put it in the /etc/rc.d directory. For more information, see the description of rc.local later in this chapter.
Here's what diskboot does:
These are mounted as /fs/cdx for CD-ROMs, and /fs/hdx-type-y, where x is a disk number (e.g., /fs/cd0, /fs/hd1), and y is added for uniqueness as it counts upwards. For example, the second DOS partition on hard drive 1 would be /fs/hd1-dos-2.
By default, one QNX 4 partition is mounted as / instead. This is controlled by looking for a .diskroot file on each QNX 4 partition. If only one such partition has a .diskroot file specifying a mountpoint of /, that partition is unmounted as /fs/hdx-type-y and is then mounted as /; if more than one is found, then diskboot prompts you to select one.
The .diskroot file is usually empty, but it can contain some commands. For more information, see below.