Sample Buildfile

The following buildfile shows you how to add the adaptive partitioning module to procnto. It also includes commands that create partitions, start a program in the partition, and set the security level.

Note: In a real buildfile, you can't use a backslash (\) to break a long line into shorter pieces, but we've done that here, just to make the buildfile easier to read.
[compress=3]
[virtual=x86,bios] .bootstrap = {
    startup-x86

    # PATH is the *safe* path for executables (confstr(_CS_PATH...))
    # LD_LIBRARY_PATH is the *safe* path for libraries
    # (confstr(_CS_LIBPATH)). That is, it's the path searched for libs
    # in setuid/setgid executables.

    # The module=aps enables the adaptive partitioning scheduler.

    [module=aps] PATH=/proc/boot:/bin:/usr/bin:/sbin:/usr/sbin \
        LD_LIBRARY_PATH=/proc/boot:/lib:/lib/dll:/usr/lib \
        procnto-smp-instr 
}

# Start-up script

[+script] .script = {
    # Programs require the runtime linker (ldqnx.so) to be at a fixed
    # location. To save memory, make everyone use the libc in the boot
    # image. For speed (fewer symbolic lookups), we point to libc.so.4
    # instead of libc.so.
    procmgr_symlink ../../proc/boot/libc.so.4 /usr/lib/ldqnx.so.2

    # Create some adaptive partitions during system startup:
    #   - IOPKT with a 20% budget
    #   - QCONN with a 20% budget
    # NOTE: To specify a critical budget, use the "aps modify" command
    #       when the filesystem on the disk is available.
    sched_aps IOPKT 20
    sched_aps QCONN 20

    # Start the system logger.
    slogger2 &
    dumper -d /var/dumps

    # Start the PCI server.
    seedres
    pci-server &
    waitfor /dev/pci

    display_msg .
    display_msg Welcome to QNX Neutrino 6.6.0 on an PC-compatible
    display_msg BIOS system with APS enabled

    # Get the disk up and running.
    devb-eide blk automount=hd0t179:/ &

    waitfor /bin

    # Further commands can now be run from disk.

    # USB services
    display_msg "Start USB services..."
    io-usb-otg -dehci &
    waitfor /dev/io-usb/io-usb 4
    waitfor /dev/io-usb/devu-ehci.so 4

    display_msg "Starting Input services..."
    io-hid -d ps2ser kbd:kbddev:ps2mouse:mousedev \
       -d usb /dev/io-usb/io-usb &
    waitfor /dev/io-hid/io-hid 10

    # Start up some consoles.
    display_msg Starting consoles
    devc-pty &
    devc-con-hid -n4 &
    reopen /dev/con1

    display_msg Starting serial port driver
    devc-ser8250 -b115200 &

    # Start the networking manager in the IOPKT partition.
    on -X aps=IOPKT io-pkt-v4-hc -d /lib/dll/devnp-abc100.so

    # Start some services.
    pipe &
    random -t &

    if_up -p wm0
    dhclient -m wm0

    #waitfor /dev/dbgmem

    # Create an additional parition with services:
    aps create -b10 INETD
    on -X aps=INETD inetd &
    on -X aps=QCONN qconn &

    # Specify a critical budget for a partition created during startup:
    aps modify -B 10 IOPKT

    # Use the "recommended" security level for the partitions:
    aps modify -s recommended

    # These env variables are inherited by all the programs that follow:
    SYSNAME=nto
    TERM=qansi

    # Start some extra shells on other consoles:
    reopen /dev/con2
    [+session] sh &
    reopen /dev/con3
    [+session] sh &
    reopen /dev/con4
    [+session] sh &

    # Start the main shell
    reopen /dev/con1
    [+session] sh &
}

[perms=0777] 
# Include the current "libc.so". It will be created as a real file
# using its internal "SONAME", with "libc.so" being a symlink to it.
# The symlink will point to the last "libc.so.*" so if an earlier
# libc is needed (e.g. libc.so.4) add it before the this line.
libc.so
libelfcore.so.1
libslog2.so


#######################################################################
## uncomment for USB driver
#######################################################################
#libusbdi.so
devu-hcd-ehci.so

fs-qnx6.so
cam-disk.so
io-blk.so
libcam.so

devnp-abc100.so
#libsocket.so

[data=copy] 

devc-con
pci-server
seedres
devc-ser8250
dumper
devb-eide
io-pkt-v4-hc
mount
slogger2
sh
cat
ls
pidin
less
on
qconn