Skip navigation.
Home
The QNX Community Portal

View topic - Which loader to use for USB flash stick

Which loader to use for USB flash stick

For discussion of realtime and/or embedded programming.

Which loader to use for USB flash stick

Postby Rune » Tue Apr 07, 2009 6:18 pm

I am running QNX 6.3.2 on a Boxer computer type AEC-6920. The boot device is a 4 Gbyte partition on an 8 Gbyte CF flash card. I have created a backup on a 4 Gbyte USB stick, and I try to make it bootable. The USB stick popped up as /fs/hd10-dos-1 and as /dev/hd10t12. After umounting those, I did:

fdisk /dev/hd10 delete -a
fdisk /dev/hd10 add -s1 -t79 -b -p100
dinit -h /dev/hd10t79

I found a zero length .boot file in the root of the stick so I tried

dinit -f /x86/boot/sys/ipl-diskpc2 /dev/hd10t79

but found that dinit reported /x86/boot/sys/ipl-diskpc2-flop for the loader.

I swapped boot priority in the BIOS but no success in booting. Swapping back again, I did boot fron the CF card but after some time I could select to mount either the CF or the USB stick as root. I mounted the USB stick as root and the system continued to boot and works fine, but slower.

Now I compared the sizes of the .boot files in the root of both devices, the
stick .boot was 472 bytes and the CF .boot (that worked) was 1214560 bytes!

I copied the CF .boot (and the .altboot) to the stick and tried again. It
stopped at the BIOS message "Hit Esc for .altboot", which was partially
overwritten by characters and then nothing happened.

Where can I find a suitable .boot file? The stick is reported as vendor
0x090c (SMI Corporation), product 0x1000, (Mem-drive easyII) by the usb
utility.

Or must I build my own.ifs file?

Grateful for help
/Rune
Rune
New Member
 
Posts: 1
Joined: Tue Apr 07, 2009 6:14 pm

Postby Tim » Tue Apr 07, 2009 9:40 pm

Rune,

You'll need to build your own usbStick.ifs file.

The .boot file from the CF card likely is only starting the devb-eide driver (an IDE driver, not a USB driver) used for the CF card. You need an ifs file that is starting the usb driver in order to mount the usb stick at boot time.

You'll probably also need to copy all the system files to the usb drive as well unless you put every file you need in the boot image.

Tim
Tim
Senior Member
 
Posts: 1392
Joined: Wed Mar 10, 2004 12:28 am

Postby jinma » Thu Apr 09, 2009 12:06 am

Here is a sample build file that I used for USB stick, you will have to have the required system files or other script files in the USB stick since the .boot file can't be more then X MB big. I forget exactly how big X is, maybe about 2Mb

[virtual=x86,bios +compress] boot = {
startup-bios
# PATH is the *safe* path for executables (confstr(_CS_PATH...))
# LD_LIBRARY_PATH is the *safe* path for libraries (confstr(_CS_LIBPATH))
# i.e. This is the path searched for libs in setuid/setgid executables.
PATH=/proc/boot:/q/bin:/bin:/usr/bin:/sbin LD_LIBRARY_PATH=/proc/boot:/q/bin/lib:/lib:/usr/lib:/lib/dll procnto
}

[+script] startup-script = {
procmgr_symlink ../../proc/boot/libc.so.2 /usr/lib/ldqnx.so.2
devc-con -n4 &
reopen /dev/con1

seedres
pci-bios &
waitfor /dev/pci
io-usb -duhci -dohci -dehci
waitfor /dev/io-usb/io-usb
devb-umass cam pnp verbose blk cache=2m,rw
waitfor /dev/hd0t79 10
mount /dev/hd0t79 /

# 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 &
reopen /dev/con4
[+session] sh &

# Start the main shell
reopen /dev/con1
sh /etc/system/sysinit
}

libc.so
libcam.so
io-blk.so
cam-disk.so
cam-cdrom.so
fs-qnx4.so
fs-dos.so
fs-ext2.so
fs-cd.so

#USB for console driver
devu-ehci.so
devu-ohci.so
devu-uhci.so
devh-usb.so
devh-ps2ser.so
libusbdi.so
[data=c]
seedres
pci-bios
mount
mkdir
devb-eide
devb-ram
devc-con
sh=ksh
devb-umass
umass-enum
umass-enum.cfg
io-usb
unlink_list={
/proc/boot/devb-*
}
jinma
Senior Member
 
Posts: 428
Joined: Thu Oct 28, 2004 10:13 pm


Return to Realtime and Embedded

Who is online

Users browsing this forum: No registered users and 3 guests

cron