I looking for suggestions on how to fit a minimal PPC QNX image into
less than 512Kb of linear flash.
Here’s my setup:
QNX 6.2 on a custom PPC board configured w/ a 512Kb boot flash
(socketed), a 32 Mb NAND flash disk (not socketed), 32+ Mb of RAM, a
serial port and an Ethernet port.
Currently, the boot flash contains a very small IPL (< 32 kb) that is
capable of loading a image from the NAND flash or using the serial port
(slow!). When I first bring a board up, I’m forced to use the serial
download to load a image capable of formatting the NAND flash and
storing a full OS images in NAND. This is OK for development but not
ideal for production. (Pre-programmed NAND flash parts are not readily
available or cost-effective.)
I’d like to make use of the Ethernet interface to speed things up. If I
could create an OS image small enough, I could put it in the linear boot
flash w/ the IPL. This image would contain the esh, a startup script
and the minimal network configuration needed to run TFTP. The image
would use TFTP to transfer the necessary files/libraries/etc to shared
memory where it could then execute a script to format the NAND flash and
store the production OS image.
- I’m getting close to the desired size, but I still can’t squeeze
everything (IPL + image) into 512Kb. My build file and mkifs output are
below - I’d prefer to keep the devc driver and esh if possible to enable
scripting and some amount of debugging - I’ve stripped down libc and libsocket using the method described in
http://www.qnx.com/developer/articles/index.html?article=may2301 - Other options include added Ethernet/bootp support directly to the
IPL, but this would be a significant development effort
Any suggestions are welcome. Thanks!
Dan Giorgis
–build file–
[image=0x100000]
[virtual=ppcbe/binary +compress] .bootstrap = {
startup-james
PATH=/proc/boot procnto-600 # run this 2nd
}
[+script] .script = {
devc-ser8250-jace5 -e -c25000000 -b57600 0xffffc000,9 &
reopen
display_msg Welcome to Neutrino on jace8240(james)
These env variables inherited by all the programs which follow
SYSNAME=nto
TERM=qansi
start the pci driver
pci-jace5 &
waitfor /dev/pci
initialize the ethernet driver
io-net -ddevn-speedo.so -pnpm-ttcpip.so if=en0:10.10.8.52 &
kick off a command-line shell on the serial port
[+session pri=30] esh -l &
}
links
[type=link] /bin/login=/proc/boot/login
[type=link] /bin/ls=/proc/boot/ls
[type=link] /dev/console=/dev/ser1
[type=link] /usr/lib/ldqnx.so.2=/proc/boot/libc.so
[type=link] /tmp=/dev/shmem
[type=link] /bin/sh=/proc/boot/esh
shared libraries
devn-speedo.so
npm-ttcpip.so
custom libc / libsocket
bootrom/libsocket.so.2
bootrom/libc.so.2
[data=c]
binaries
io-net
pci-jace5=pci-james
devc-ser8250-jace5
esh
tftp
–mkifs output—
Offset Size Entry Ramoff Target=Host
100000 100 ---- — Startup-header
100100 b008 101e8c — ._L4.AAD
10b108 5c ---- — Image-header
10b164 3bc ---- — Image-directory
---- — ---- — bin/sh=/proc/boot/esh
---- — ---- — tmp=/dev/shmem
---- — ---- — usr/lib/ldqnx.so.2=/proc/boot/libc.so
---- — ---- — dev/console=/dev/ser1
---- — ---- — bin/ls=/proc/boot/ls
---- — ---- — bin/login=/proc/boot/login
10b520 178 ---- — proc/boot/.script=._L4.AAC
10c000 51000 12a03c — proc/boot/procnto-600=._L4.AAE
15d000 10000 3324 —
proc/boot/devn-speedo.so=C:/QNXsdk/target/qnx6/ppcbe/lib/dll/devn-speedo.so
16d000 17000 3804 —
proc/boot/npm-ttcpip.so=C:/QNXsdk/target/qnx6/ppcbe/lib/dll/npm-ttcpip.so
184000 1b000 51b0 —
proc/boot/libsocket.so.2=bootrom/libsocket.so.2
19f000 3e000 c238 — proc/boot/libc.so.2=bootrom/libc.so.2
1dd000 11424 480417cc —
proc/boot/io-net=C:/QNXsdk/target/qnx6/ppcbe/sbin/io-net
1ef000 adc8 48040b64 —
proc/boot/pci-jace5=images/ppcbe/sbin/pci-james
1fa000 9008 48041228 —
proc/boot/devc-ser8250-jace5=images/ppcbe/sbin/devc-ser8250-jace5
204000 4030 48040e64 —
proc/boot/esh=C:/QNXsdk/target/qnx6/ppcbe/bin/esh
209000 4fcc 48040be0 —
proc/boot/tftp=C:/QNXsdk/target/qnx6/ppcbe/usr/bin/tftp
20dfcc 4 ---- — Image-trailer