Startup Messages and boot image

Hello everybody,

i want to build my own boot image, but i dont know which shared libs and binarys i need to include.
My ES has a Touchscreen, ethernet, usb, integrated graficchip intel gma 945 Gm, SSD over Sata, and i want to use the qnx filesystem 6.

And another question is, when i start my System i become some Messages:

"Press F1-F4 to select drive or select Partition 1? 1

QNX v1.2b Boot Loeader: qnxbase.ifs

Press the Space bar to input boot options…
Trying SATA ahci. Scanning for devices…
xpt_configure: ahci SIM attach failure
Trying EIDE. Scanning for devices…
…found 1 device
Detected USB. Scanning for devices…
Trying Sata mvSata. Scanning for devices…
xpt_configure: No mvSata interfaces found
mount: Can’t mount / (type io-audio)
mount: Possible reason: Invalid argument
Starting extra run commands
Starting qconn…
Starting inetd…
login:
"

How to disable the partition selection? Is there any file i need to change, to boot automatically from the first partition?
and in which files i find the print or echo outputs of the boot progress?

and is there any possibility to skip the login?
i have a Qt application on the system and in rc.local i added “qconn”, “inetd”, “devi-hid -Pr kbd touch abs -a3”, “cd /home/Qt” and “./Qtapp -qws”. this is how i made my own “skip” the login.

and my last question is, when i shutdown the system without reboot, i need to power off the system manually.
can i made this automatically?

I hope somebody can answer my questions ;)

with best regards

nudels

Building a boot image and figuring out what needs to be included can be a bit of a black art.
The documentation is very sparse on this kind of information. Obviously common sense helps but ultimately you need to use trial an error to see what is missing.

I recommend you not use the QNX diskboot program. Instead you start the appropriate hard disk driver, waitfor /dev/hd0, then enumerate the partitions (mount -e /dev/hd0), mount the partition as root and start your startup script. This speeds up the process and allows you to just have the needed driver.

To disable the partition selection, you will need to get or write a custom partition loader. There may be something available with QNX, but I don’t know. Fdisk has the option to load it however.

login is optional. Typically tinit is used to put up login’s, which you can skip. In that case your startup script has to start everything.

There is a program “shutdown” which will stop the system. Not all hardware responds by powering down, in which case you may need to write a custom shutdown program.

Hi,

thank you for your fast reply.

okay now i have written my own build-image.
But i become an error when i want to load the ethernet adapter/driver.

here is my build file:


#
# own image file
# 

[virtual=x86,bios +compress] boot = {
    # Reserve 64k of video memory to handle multiple video cards 
    startup-bios -s64k
    PATH=/proc/boot:/bin:/sbin:/usr/bin:/usr/sbin 
    LD_LIBRARY_PATH=/proc/boot:/lib:/usr/lib:/lib/dll:/opt/lib procnto
    
}



#
# Startscript
#	

[+script] startup-script = {
# Programs require the runtime linker (ldqnx.so) to be at a fixed location
	procmgr_symlink ../../proc/boot/libc.so.3 /usr/lib/ldqnx.so.2
	
	
	display_msg "Image v1.0"
	
	
# start pci
	display_msg "Start PCI"
	seedres
	pci-bios &
	waitfor /dev/pci
	pipe 
	slogger
	
	
# start hdd driver
	display_msg "Start hdd driver"
	devb-eide blk automount=hd0t179
	waitfor /dev/hd0t179
	#mount -v -e -t qnx6 /dev/hd0t179 /mnt/fs
	
	

	
	
# start other driver
	display_msg "Start other driver"
	#devc-con-hid &
	io-pkt-v4-hc -v -ptcpip
	waitfor /dev/io-net/en0
	mount -v -T io-pkt /dev/io-net/en0
	
	#qconn
	
# start console
	display_msg "Start Console"
	devc-con -n4 &
	reopen /dev/con1
	[+session] sh &
	
}
	


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

libsocket.so
devnp-shim.so
devnp-e1000.so
libc.so
fs-qnx6.so
io-blk.so
libcam.so.2
cam-disk.so	



# executable
[data=copy]
pci-bios
seedres
pipe
slogger
ls
shutdown
sh
pidin
devc-con
ifconfig
qconn
devc-con
shutdown
use
devb-eide
mount
devc-con-hid
io-pkt-v4-hc
waitfor

and the error is:

“unable to access “/dev/io-net/en0” (2)
Parsed: mount from [/dev/io-net/en0] mount on [NULL] type [io-pkt]
mount: can’t mount / (type io-pkt)
mount: possible reason: No such device or address”

and sometimes i become an error when i reboot the system to test my image. its sound like: Boot OS cannot be loaded.
and then i must reinstall the hole system with the bootable CD.

Thanks for replies ;)

with best regards

nudels

Why are you waiting for this? You only need to if the next application is immediately trying to access the network.

The mount afterwards makes no sense.

And, your io-pkt line is missing the corresponding driver, e.g.: io-pkt-v4-hc -de1000 ← should be enough. -p tcpip is legacy io-net and not needed any more.

If you need to wait, wait for the right thing. I understand you use the devnp-e1000 driver - does it really create an entry like that under /dev? I think only legacy io-net drivers do that. Check which entry it actually creates. Alternatively, you could wait for /dev/socket.

Finally, how does it feel to be an error? I ask because you wrote that you became an error :slight_smile:

oh, sry for my bad english :smiley: :mrgreen:

okay i removed waitfor and mount.
now i only start “io-pkt-v4-hc -de1000”.
when i call ifconfig i get the following output:
“lo0: flags=8049<UP, LOOPBACK, RUNNING, MULTICAST> mtu 33192
inet 127.0.0.1 netmask 0xff000000”

how do i start the ethernet driver? :confused:
sry, but i dont have only 1 week experience with qnx :confused:

with best regards

nudels

You can start the eithernet driver either as a parameter to io-pkt-v4 when you start it, or you can mount it after io-pkt-v4 has started.

You have to know which driver to start.
You can find out by checking the Ethernet chipset detected by pci server.
Here is how to do that:
“pci -vvv | grep Ethernet”
It will print out the Ethernet chipset used in your system. With this info in hand go to qnx.com and look for Hardware Supported.
There you will find which driver you have to start. Note that QNX version is important.

Ehm, actually I assumed you were using devnp-e1000.so because you found out that it’s the right driver for your hardware. If it’s not, then of course it doesn’t work. :slight_smile:

So, boot from CD and do a

pidin mem

It will show you all processes and all the libraries they have loaded. For io-pkt, this will show you which driver has been loaded by the enumerator.

On a side note: to analyze startup problems, include slogger and sloginfo in your boot image, start slogger as first item in the boot script, and then use sloginfo to find out if, maybe, a driver put a message into the system log that it couldn’t find the hardware it was written for.

hey,

thanks for the good tips. i made it ;)

okay now, how could it be, i have a new problem :smiley:

after a few times of building .ifs files and testing them on the target, there is a new error.
when i now want to build a new image with mkifs, i get this error:

“cc: unknown target 'gcc_ntox86+static
cc: no targets defined in /usr/qnx650/host/qnx6/x86/etc/qcc/gcc!
Unable to link relocatable elf file /usr/qnx650/target/qnx6/x86/boot/sys/procnto.”

but funny is, that i didn’t changed anything. i just restarted and commented my “my.build” -file.

here is my .build - file:
(but its not perfect)

#
# own image file
# 

[virtual=x86,bios +compress] boot = {
    # Reserve 64k of video memory to handle multiple video cards 
    startup-bios -s64k
    PATH=/proc/boot:/bin:/sbin:/usr/bin:/usr/sbin 
    LD_LIBRARY_PATH=/proc/boot:/lib:/usr/lib:/lib/dll:/opt/lib procnto
    
}


#
# Startscript
#	

[+script] startup-script = {
# Programs require the runtime linker (ldqnx.so) to be at a fixed location
	procmgr_symlink ../../proc/boot/libc.so.3 /usr/lib/ldqnx.so.2
	
	
# start slogger

	slogger
	
display_msg "Image v1.0"
	
	
# start pci
	
	seedres
	pci-bios &
	waitfor /dev/pci
	pipe 

	
# start hdd driver
	
	devb-eide blk automount=hd0t179:/ 
	waitfor /dev/hd0t179
	
	
# start console driver

	devc-con -n4 
	
	
# Anzahl der möglichen verbindungen

	devc-pty -n32 
	
	
# start Ethernet driver and init en0 with 192.168.1.3

	io-pkt-v4-hc -drtl 
	waitfor /dev/socket
	ifconfig en0 192.168.1.3
	
	
# start connections to host

	qconn 
	inetd 
	
	
# start common server

	io-hid 
	io-usb 
	io-display -dvid=0x8086,did=0x27a2
	mount -T io-usb devu-ehci.so /dev/io-usb/io-usb
	#enum-devices
	#enum-usb
	
	
# start console

	reopen /dev/con1
	[+session] sh 
	
}
	


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

devg-svga.so
libffb.so.2
libsocket.so
devnp-shim.so
devn-rtl.so
libc.so
fs-qnx6.so
io-blk.so
libcam.so.2
cam-disk.so	
libhiddi.so

libsocket.so.3
libusbdi.so.2
libm.so.2
libz.so.2
libgf.so.1
devh-usb.so
#libstdc++.so.6
devu-ehci.so
devu-uhci.so



# executable


[data=copy]
pci-bios
seedres
pipe
slogger
ls
shutdown
sh
pidin
ifconfig
qconn
devc-con
shutdown
use
devb-eide
mount
devc-con-hid
io-pkt-v4-hc
waitfor
io-hid
inetd
netstat
sloginfo
io-display
io-hid
enum-devices
enum-usb
devc-pty
tar
cp

with best regards

nudels

And another question is, when i start my System i become some Messages:
"Press F1-F4 to select drive or select Partition 1? 1

If you manually patch ipl-diskpc1 as follows, it will still display the message but it will not “wait” for a response…

offset 0xa6 0x75 → 0xeb
offset 0xa7 0x17 → 0x3f

Install the changed loader with “fdisk -B /tmp/my_ipl-diskpc1 /dev/hd0 loader”

hi denkelly,

thank for your advice :slight_smile: it works perfectly :slight_smile:

okay guys, now i have some new problems :smiley::D:D
i dont know or its too difficult or im too stupid :confused:

i tried to mount the usb stack and tried to connect a usb keyboard.
when i dont mount the usb stack, then the keyboard works (through a usb port), but when i mount the usb stack, the keyboard dont works :confused:

here is my image:

#
# own image file
# 

[virtual=x86,bios +compress] boot = {
    # Reserve 64k of video memory to handle multiple video cards 
    startup-bios -s64k
    PATH=/proc/boot:/bin:/sbin:/usr/bin:/usr/sbin 
    LD_LIBRARY_PATH=/proc/boot:/lib:/usr/lib:/lib/dll:/opt/lib procnto-instr
    
}


#
# Startscript
#	

[+script] startup-script = {
# Programs require the runtime linker (ldqnx.so) to be at a fixed location
	procmgr_symlink ../../proc/boot/libc.so.3 /usr/lib/ldqnx.so.2
	
	
# start slogger

	slogger
	
display_msg "Image v1.0"
	
	
# start pci
	
	seedres
	pci-bios &
	waitfor /dev/pci
	pipe 
	
	
# start hdd driver

	devb-eide blk automount=hd0t179:/ 
	waitfor /dev/hd0t179
	
	
# start console driver

	devc-con -n4 
	
	
# Anzahl der möglichen verbindungen

	devc-pty -n4 
	
	
# start Ethernet driver and init en0 with 192.168.1.3

	io-pkt-v4-hc -drtl
	waitfor /dev/socket
	ifconfig en0 192.168.1.3
	
	
# start connections to host

	qconn 
	inetd 
	
	
# start common server

	io-usb -duhci -dehci &
	waitfor /dev/io-usb/io-usb
	io-hid -dusb 
	io-display -dvid=0x8086,did=0x27a2
	
	
# start console

	reopen /dev/con1
	[+session] sh 
	
}
	


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

devg-svga.so
libffb.so.2
libsocket.so
devnp-shim.so
devn-rtl.so
libc.so
fs-qnx6.so
io-blk.so
libcam.so.2
cam-disk.so	
libhiddi.so

libsocket.so.3
libusbdi.so
libm.so.2
libz.so.2
libgf.so.1
devh-usb.so
#libstdc++.so.6
devu-ehci.so
devu-uhci.so


# executable


[data=copy]
seedres
pci-bios
pipe
slogger
pidin
ifconfig
qconn
devc-con
devb-eide
mount
devc-con-hid
inetd
netstat
sloginfo
devi-hid
devc-con-hid

unlink_list={
/proc/boot/devb-*
}

and another Problem i have is with Qt Libraries.
i have started my own image and have installed the Qt Libs.
now when i want to start a Qt app, like cEasy with “./cEasy -qws” then i get this error: “ldd:FATAL: Could not load library libQtGui.so.4”.
do i need to set a path to the direction where the libs are? (they are in : “\usr\qnx650\target\qnx6\x86\usr\lib” and they are definitly in this direction).
but when i start the normal qnx image like qnxbase.ifs then the qt app works normally :confused:

with best regards
nudels

I recall that getting a USB keyboard working can be a bit tricky. How you do it depends on whether or not you are using photon or just a console. I didn’t see anything wrong in your boot file, but that’s not saying I know much about it.

The way I always go about figuring out such things is

  1. use a development system and see what is loaded when you are running
  2. read the docs

I hope this is helpful.

In any case, my theory about your problem is that by default your BIOS is emulating a PS2 keyboard using a USB keyboard. When you start the USB stack, you interfere with this, which is of course what you want to do, but you have to get it right.

they are in : “\usr\qnx650\target\qnx6\x86\usr\lib” and they are definitly in this direction

That location is the “development” location… it should not be present in your .ifs.

On your CD install, the “runtime” location is “/usr/lib”. The environment variable “LD_LIBRARY_PATH” tells the loader where to look for libraries - and includes “/usr/lib”.

i tried to mount the usb stack and tried to connect a usb keyboard.
when i dont mount the usb stack, then the keyboard works (through a usb port), but when i mount the usb stack, the keyboard dont works

This should work - assuming a usb keyboard is attached…

display_msg “—> Starting USB services”
io-usb -duhci -dohci -dehci
waitfor /dev/io-usb/io-usb 3

display_msg "—> Starting console
io-hid -d usb /dev/io-usb/io-usb
devc-con-hid -n4 &
waitfor /dev/con1 4

reopen /dev/con1

You will need to include ‘devh-usb.so’ (in a LD_LIBRARY_PATH). The “-d usb” parameter to io-hid looks for this dll.

thanks four replies :slight_smile:

ok, now i’ve seen that the qt libs were also in /usr/lib.
but it doesn’t work :confused:
with the usb keyboard i made it.
My code is:

...
io-hid -dusb 
waitfor /dev/io-hid/io-hid
devc-con-hid -n4 
...
io-usb -duhci -dehci 
waitfor /dev/io-usb/io-usb 

this works :slight_smile:
@ denkelly: i will try your code later and give a feedback :slight_smile:

with best regards

nudels