To build a multiple IFS image, you must create a primary and a secondary IFS. The primary IFS includes only the startup and procnto (kernel). The secondary IFS includes all other libraries and binaries including libc, drivers, and applications.
Here's a sample primary buildfile:
################################################################# ## START OF PRIMARY IFS BUILD SCRIPT for Renesas EDOSK7780 Board ################################################################# [image=0x88010000] [virtual=shle/binary +compress] .bootstrap = { startup-edosk7780 -Dscif..115200.1843200.16 -f400000000 -i0x700000 -vv PATH=/proc/boot:/ifs2 LD_LIBRARY_PATH=/proc/boot:/ifs2 procnto -vvvv } [+script] .script = { # Default libc symbolic link #procmgr_symlink ../../proc/boot/libc.so.2 /usr/lib/ldqnx.so.2 # Symbolic link to libc in secondary IFS procmgr_symlink ../../ifs2/libc.so.2 /usr/lib/ldqnx.so.2 display_msg Welcome to QNX Neutrino on the Renesas EDOSK-7780 devc-sersci -e -F -x -b115200 -c1843200/16 scif0 scif1 & reopen /dev/ser1 SYSNAME=nto TERM=qansi [+session] PATH=:/proc/boot:/ifs2 LD_LIBRARY_PATH=/proc/boot:/ifs2 ksh & } [type=link] /dev/console=/dev/ser1 [type=link] /tmp=/dev/shmem ################################################################### ## END OF PRIMARY IFS BUILD SCRIPT ###################################################################
The sample secondary buildfile is as follows:
################################################################# ## START OF SECONDARY IFS BUILD SCRIPT for Renesas EDOSK7780 Board ################################################################# # Specify the search path, otherwise defaults to x86 [search=${QNX_TARGET}/shle/bin:${QNX_TARGET}/shle/usr/bin:${QNX_TARGET}/shle/sbin:${QNX_TARGET}/shle/usr/sbin:${QNX_TARGET}/shle/lib:${QNX_TARGET}/shle/lib/dll:${QNX_TARGET}/shle/usr/lib] # Windows mkifs needs to be reminded of permissions [perms=+x] # Where the files will be mounted at boot time [prefix=/ifs2] # Libraries to include [data=copy] libc.so # Binaries to include [+raw data=copy] cat devc-sersci ls pidin ksh echo ################################################################### ## END OF SECONDARY IFS BUILD SCRIPT ###################################################################
Unless the physical address for the source location for the secondary image is specified, IFS Restoration will automatically look for the secondary IFS in flash directly following the primary IFS.
To create an image consisting of both primary and secondary IFS:
# mkifs -v primary.build primary.ifs # mkifs -v secondary.build secondary.ifs # cat primary.ifs secondary.ifs > edosk7780.ifs # mkflashimage
The above example loads a primary IFS and a secondary IFS mounted at /ifs2. The output will look something like:
Press 'd' to download an OS image serially Press any other key to boot from flash
Press a key other than d.
Downloading from Flash ifs2_paddr_dst: 0x0806d000 ifs2_paddr_src: 0x0003a9b0 ifs2_paddr_src (auto): 0x0003a9b0 System page at phys:0800a000 user:0800a000 kern:8800a000 Starting next program at v8803c258 Welcome to QNX Neutrino on the Renesas EDOSK-7780 # ls /proc/boot .script procnto # ls /ifs2 cat ksh ls echo libc.so pidin devc-sersci libc.so.2
To restore the secondary IFS, modify the options to startup in the primary buildfile (enable secondary IFS restoration, enable checksum):
startup-edosk7780 -Dscif..115200.1843200.16 -f400000000 -i0x700000,K -vv
After rebuilding and burning the updated multiple IFS image to flash, the output will look like:
QNX Neutrino IPL for the EDOSK-7780 Press 'd' to download an OS image serially Press any other key to boot from flash
Press a key other than d.
Downloading from Flash ifs2_paddr_dst: 0x0806d000 Restore IFS2 searching for valid IFS in RAM... rifs2_info PADDR = 0x08008000 rifs2_info ADDR = 0x88008000 INVALID IFS signature Restore IFS2 failed - Reload entire IFS2. ifs2_paddr_src: 0x0003a9b0 ifs2_paddr_src (auto): 0x0003a9b0 System page at phys:0800b000 user:0800b000 kern:8800b000 Starting next program at v8803c258 Welcome to QNX Neutrino on the Renesas EDOSK-7780 #
Press the reset button to simulate wake-up:
# QNX Neutrino IPL for the EDOSK-7780 Press 'd' to download an OS image serially Press any other key to boot from flash
Press a key other than d:
Downloading from Flash ifs2_paddr_dst: 0x0806d000 Restore IFS2 searching for valid IFS in RAM... rifs2_info PADDR = 0x08008000 rifs2_info ADDR = 0x88008000 FOUND valid IFS signature FOUND valid IFS2 signature and RIFS2 info in RAM. System page at phys:0800b000 user:0800b000 kern:8800b000 Starting next program at v8803c258 Welcome to QNX Neutrino on the Renesas EDOSK-7780 #
To disable the checksum verification on the secondary IFS after it has been restored, modify the buildfile to:
startup-edosk7780 -Dscif..115200.1843200.16 -f400000000 -i0x700000,R -vv
On subsequent boots, you will see the additional output (with debug enabled):
WARNING: Skipped IFS2 checksum verification
If you don't want to put the primary and secondary IFS together in flash (by using the cat utility), you can put the secondary IFS anywhere in the flash you wish and manually specify its location. Additionally, you can manually specify the location to copy the secondary IFS to in RAM if you don't wish to use the default location. Use the optional arguments to specify the physical address for the secondary IFS source and destination:
To calculate the destination in RAM:
paddr_dst = paddr_start_of_RAM + paddr_location_in_RAM
For example, on the EDOSK7780, there is 128 MB of RAM starting at the address 0x08000000. To put the secondary IFS at the 120 MB location in RAM:
paddr_dst = 0x08000000 + 120 * 1024 * 1024 = 0x0F800000
paddr_dst = paddr_dst & 0xFFFFF000.
To manually specify the source of the secondary IFS located in flash at 0x00040000:
startup-edosk7780 -Dscif..115200.1843200.16 -f400000000 -i0x700000,0x00040000
To manually specify the source of the secondary IFS located in flash at 0x00040000, and the destination of the secondary IFS in RAM at 0x0F800000:
startup-edosk7780 -Dscif..115200.1843200.16 -f400000000 -i0x700000,0x00040000, 0x0F800000
To manually specify the source of the secondary IFS located in flash at 0x00040000, the destination of the secondary IFS in RAM at 0xF8000000, and enable restoring with checksum:
startup-edosk7780 -Dscif..115200.1843200.16 -f400000000 -i0x700000,K,0x00040000, 0x0F800000