Complete example — disk filesystem

In this example, we'll look at a filesystem for rotating media. Notice the shared libraries that need to be present:

[virtual=x86,bios +compress] .bootstrap = {
  PATH=/proc/boot:/bin LD_LIBRARY_PATH=/proc/boot:/lib:/dll procnto

[+script] .script = {
    pci-bios &
    devc-con &   
    reopen /dev/con1 
# Disk drivers
    devb-eide blk cache=2m,automount=hd0t79:/,automount=cd0:/cd &

# Wait for a bin for the rest of the commands
    waitfor /x86 10

# Some common servers
    pipe &
    mqueue &
    devc-pty &

# Start the main shell
    [+session] esh &

# make /tmp point to the shared memory area
[type=link] /tmp=/dev/shmem

# Redirect console messages
# [type=link] /dev/console=/dev/ser1

# Programs require the runtime linker ( to be at
# a fixed location
[type=link] /usr/lib/

# Add for HD support
[type=link] /usr/lib/

# add symbolic links for bin, dll, and lib 
# (files in /x86 with devb-eide)
[type=link] /bin=/x86/bin
[type=link] /dll=/x86/lib/dll
[type=link] /lib=/x86/lib

# We use the C shared lib (which also contains the runtime linker)

# Just in case someone needs floating point and our CPU doesn't
# have a floating point unit

# Include the hard disk shared objects so we can access the disk

# For the QNX 4 filesystem

# For the UDF filesystem and the PCI

# Copy code and data for all executables after this line

# Include a console driver, shell, etc.
Note: For this release of the QNX Neutrino RTOS, you can't use the floating-point emulator ( in statically linked executables.

In this buildfile, we see the startup command line for the devb-eide command:

devb-eide blk cache=2m,automount=hd0t79:/automount=cd0:/cd &

This line indicates that the devb-eide driver should start and then pass the string beginning with the cache= through to the end (except for the ampersand) to the block I/O file ( This will examine the passed command line and then start up with a 2-megabyte cache (the cache=2m part), automatically mount the partition identified by hd0t79 (the first QNX filesystem partition) as the pathname /hd, and automatically mount the CD-ROM as /cd.

Once this driver is started, we then need to wait for it to get access to the disk and perform the mount operations. This line does that:

waitfor /x86 10

This waits for the pathname /x86 to show up in the pathname space. (We're assuming a formatted hard disk that contains a valid QNX filesystem with ${QNX_TARGET} copied to the root.)

Now that we have a complete filesystem with all the shipped executables installed, we run a few common executables, like the Pipe server.

Finally, the list of shared objects contains the .so files required for the drivers and the filesystem.