Flash disk bootscript

Dear all,
I am truying to build up the image and bootscript for my flash disk to run the athenna board. I try the following bootscript :

[virtual=x86,bios +compress] boot = {
startup-bios
PATH=/proc/boot procnto
}

[+script] startup-script = {
# Start up some consoles
devc-con -n4 &
reopen /dev/con1

display_msg Welcome to QNX Neutrino

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

# Start IDE and mount the flash disk in /usr/hdd
devb-eide blk automount=hd0t77:/usr/hdd &

# Start Networking
io-net -d ns83815 duplex=0 -p tcpip
waitfor /dev/socket
ifconfig en0 192.168.1.221 netmask 255.255.255.0
route add default 192.168.1.1

Some common servers

pipe &
mqueue &
devc-ser8250 &
devc-pty &

# USB keyboard and mouse.  Disable this if not needed.
devu-ohci &
devu-kbd &
devu-mouse &

# Start a debug server for debugging programs
waitfor /dev/ser1
[+session] pdebug /dev/ser1 &

# These env variables inherited by all the programs which follow
SYSNAME=nto
TERM=qansi

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

# Start a high priority shell just in case
reopen /dev/con4
[pri=25 +session] sh &

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

}

Make the /temp point to the shared memory area

[type=link] /tmp=/dev/shmem

Programs require the runtime linker (ldqnx.so) to be at a fixed location

[type=link] /usr/lib/ldqnx.so.2=/proc/boot/libc.so
libc.so

You’ll need to add lines for the additional libraries you need. For

example, this will include support for C++ applications which require

the math library.

[type=link] /lib/stdc++.so.2.2.10.0=/proc/boot/libstdc++.so
[type=link] /lib/libm.so.2=/proc/boot/libm.so
libstdc++.so
libm.so

[data=c]

Executables must currently be below this line

Include a console driver

devc-con

Include pci server

pci-bios
seedres

Network related items

/lib/dll/devn-ns83815.so # National Semiconductor DP83815 “Macphyter”
/lib/dll/npm-tcpip.so
libsocket.so
/etc/termcap=/etc/termcap
/etc/hosts=/etc/hosts
/etc/resolv.conf=/etc/resolv.conf

Use the “public domain korn shell” as the default shell “sh”

sh=ksh

Other executables

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

pdebug
pipe
mqueue
devc-ser8250
devc-pty
devb-eide
devu-ohci # Remove these three devices if USB not needed
devu-kbd # See above
devu-mouse # See above
ls
cat
ps
pidin
uname
/sbin/io-net
/sbin/ifconfig
/sbin/route
/usr/bin/telnet
/usr/bin/ftp
/usr/bin/ping

Your programs go here

/opt/my/app

from diamondsystems.com/support/faqs/48
But after using the command
dinit -h -B ipl-diskpc1 /dev/hd1

dinit -h -f /path/to/my.ifs -B ipl-diskpc2 /dev/hd1t77

It become DOS, non QNX drive, not QNX drive I want
Do anyone can help me with this?
Thank you for your time.

you need to run fdisk first to format the disk with a qnx filesystem

Yes, I already run the fdisk to format the disk to type 77 - QNX. But after I run the dinit command, it becomes DOS and non QNX drive already.

Becomes DOS??? That can’t be. How do you tell it becomes DOS.

yes, unfortunately, it is.

After doing all the fdisk to set it to QNX 77 , bootable, loader, I copy the my.ifs file to the flash disk.
Then, when I run the command :
dinit -h -B ipl-diskpc1 /dev/hd1
the command ask me something about I am going to initialize for a raw disk, not a partition. I continued the process.
After that, I try again
fdisk /dev/hd1
It become two partition indeeed, one is DOS and one is NONQNX.

Do anyone know how to set up the bootscript for the flashdisk and athena board.

Thank you very much.

You say you copy my.ifs to flash and THEN run dinit? Well that should be the other way around.

fdisk then dinit -h /dev/hd1 then copy my.ifs as .boot

Thank you, i’ll try.

The tool is right, you should not init raw device, you should init partition. So:
first run fdisk, create partition type 79 (or 77, shouldn’t matter)
second run dinit on /dev/hd1t79
third copy boot image to disk

you should also use dloader utility to write bootloader.

Thank you, I got them run already.

Hi, I now got a new problem. I have to adjust the baud rate of my com port to 9600. I tried
stty baud=9600 </dev/ser1.
However, the system printed out: " cannot open /dev/ser1".
Can you please help me with this?

Thank you.

th12,

It sounds like the serial driver (devc-ser8250) isn’t being started at boot time.

If you do a ‘pidin’ command do you see it running?

Tim