creating a bootable qnx 6.6 image

Hi, im trying to create a bootable qnx image using qnx momentics on windows. I’ve tried reading the various guides on the qnx website but none of these make sense to me. I don’t even understand where to start.

As far as i understood a program called mkifs is used to build the iso images, and this tool is run from the command line. When trying to run it from the command line however windows says this command doesnt exist… Is there some sort of error in my SPD installation? Is there any guide to building a bootable image file with step by step instructions?

Thanks

EDIT: no commands that ive tried to run over the command line seems to work… for example qconfig also isnt recognized as a command.

Please understand about bootable QNX 6.6 images

  • QNX 6.6 images are “targets” only - you cannot develop programs (run compiler/linker) - for that you use a “host”

  • Photon does not run in QNX 6.6 targets

  • If you want to use the new “screen” graphics, the pc must contain “intelHD” integrated graphics (BayTrail, IvyBridge, Haswell, etc)

  • You can install qnx 6.6 to boot from HDD/SSD but you will need to create bootable media (i.e. usbstick) containing the QNX tools for creating, formatting and installing bootstraps.


Some windows-based resources…

  1. A bootable usbstick image that will run graphics on intelHD hardware. Image must be created using the supplied tool. Can be customized by modifying shell scripts. Contains a script to install the usbstick image to an attached HDD/SSD.

PDF: drive.google.com/file/d/0B-H5B1 … sp=sharing
Archive: drive.google.com/file/d/0B-H5B1 … sp=sharing

  1. Basic windows tools for creating bootable FAT32 usbsticks. See included “usbstick.txt” regarding instructions for creating bootable usbsticks.
    Archive: drive.google.com/file/d/0B-H5B1 … sp=sharing

  2. A document providing windows instructions for using QNX 6.6 ‘mkqnx6fsimg’ utility to create bootable qnx6fs filesystem usbsticks.
    PDF: drive.google.com/file/d/0B-H5B1 … sp=sharing

Claude,

Normally in Windows you build your QNX bootable images from inside the Eclipse development environment. It’s probably easier to do there than from the command line.

If you do want to from the command line you need to make sure the path is set correctly. If you type ‘path’ in your command window does it show a path to the installed QNX development suite (I don’t think it sets one at install time)? You should be able to search for a file called ‘mkifs’ on your C drive (assuming you installed on C of course). That gives you the path you need to add (if it’s not there).

Tim

Thank you both for your replies.

I understand that development occurs on a system seperate from the QNX target, in my case i develop on windows. I would however like a test target system running on a seperate PC, for this i require some sort of installation/boot media which i cannot find/do not understand how to generate.

mkifs indeed exists and the error was with the path, thanks for that. I assumed command line was the only way to create images, i would much prefer to be able to use the IDE instead, though documentation seems to be rather sparse. What I would like is a way to generate a bootable image similar to the VM Image provided by QNX, no graphics, a terminal windows is fine. A basic QNX6.6 RTOS installation media for a PC.

I find such images for qnx version 6.4 on the qnx website, there doesnt seem to be anything for qnx6.6 however.

I find such images for qnx version 6.4 on the qnx website, there doesnt seem to be anything for qnx6.6
That is because those iso images (pre-6.6) were “self-hosted” and installed a desktop plus dev tools - which don’t exist in 6.6.

bootable image similar to the VM Image provided by QNX, no graphics, a terminal windows
That is why I suggested using a pre-built usb image - or building your own usb image with mkqnx6fsimg or with fat32 tools.

i would much prefer to be able to use the IDE instead
You can use the IDE to run mkifs by switching to “system builder” perspective and creating a project. You will ether have to “import” or create a “build file”. An example workspace with a system builder project is contained on the prebuilt image (#1 in my original post) - and described in the pdf.

Hi again. I have now successfully built an image using the x86 BSP provided by QNX.
I followed the guide

“BSP User Guide Generic x86 BIOS and APIC”
community.qnx.com/sf/frs/do/view … _generic_x

to create a bootable USB stick.
During boot i can choose the drive/partition i wish to boot from. After this selection “QNXv1.2b Boot Loader” appears but nothing else happens. Any help as to why this could be?

If all you get is “QNXv1.2b Boot Loader”, most likely the ifs is “bad”… i.e. it loaded the ifs and jumped to it - but nothing good happened.

You might try using the “prebuilt” ifs - rather than the one you built.

If that doesn’t work, try a different method …
drive.google.com/file/d/0B-H5B1 … sp=sharing

I wish to use the prebuilt image, which is supposed to be in the BSP’s “prebuilt” folder. But there doesnt actually seem to be any image file inside this folder…

I’ll try your other method and report how it went.

EDIT: the other method requires an IFS as well. this is what i’m missing to begin with…

Just to be clear, your target machine that you are trying to install on is an x86 right? If it’s not then building an x86 ifs isn’t what you want to do.

I am not surprised there are no ifs files in the prebuilt folder. To save on space in an archive it makes more sense to just ship the project file in the IDE and have users build the ifs file from an existing project. If you switch to the ‘system builder’ perspective are there any projects there other than the one you created? If not, you should be able to import an existing one for the prebuilt image.

Tim

an update: the method i tried previously worked when a colleague tried it. We are not sure exactly what went wrong. The next step is to go from a USB-boot to a fix installation on the hard drive. How would we go about this?

EDIT: and yes the target is an x86 machine

You need to make sure the fdisk utility is in your USB image.

I’ll assume the image on your USB drive boots QNX and you get a command shell / prompt. From that prompt if you type ‘fdisk’ does it run the fdisk utility? If it doesn’t you need to modify the boot image to include fdisk.

Fdisk allow you to see all the drives in your target. You’ll select the Harddrive and turn it into a QNX partition (it’s probably a Windows one by default). It will also allow you to install a loader and make the QNX partition the default boot partition (if you decide on more than 1 partition).

Once it’s a QNX partition you ‘mount’ it with the mount command (this also must be in your USB image) and use ‘dinit’ (in USB image too) to initialize it etc.

qnx.com/developers/docs/6.4. … fdisk.html

Once all this is done you can copy the boot image to the hard drive and it will boot.

Tim

Note: The exact bootimage you used to boot from the USB won’t boot your Harddrive. That’s because the disk driver in the image is going to be for USB instead of IDE/Sata. So you’ll need a second boot image to copy to the HD that has the right driver in it (or put both USB and HD drivers in your boot image).

I did the following:
fdisk hd0 delete -a (delete all other partitions)
fdisk hd0 add -t 77 -p 100 (create a QNX4 partition using 100% of available space)

mount -e hd0
mount hd0t77 folder (mount the qnx4 partition to dir “folder”)

this is where i get the error:
mount: cant mount folder (type qnx4)
mount: Possible reason: Corrupted file system detected

Ive tried this on various pc’s now. so it doesnt seem likely its a hardware problem. Any tips on how to proceed?
and as for the actual copying of the image, can i use something like:" cp /dir /dev /etc /destinationfolder"

cheers

thanks for all the help!

EDIT: tying something like dinit -h hd0t77 also is not working. i get the same errror: corrupted file system detected…

mount hd0t77 folder (mount the qnx4 partition to dir “folder”)
You have to “dinit” before you can mount.

Also the parameters to dinit are:

dinit -h /dev/hd0t77

qnx.com/developers/docs/6.4. … dinit.html

Tim

thanks, I have it mounted under “/hd” now. Now how do i copy the image?

btw I have now created a QNX6 filesystem not QNX4 (hd0t177)

I tried copying the “ifs-x86-generic.bin” to the ./boot directory on my harddrive.

This doesnt however let me boot. Could this be the driver issue you meant?
Would i have to change this in the build file?

this is my current build file: x86-generic.build

[image=0x1400000]
[virtual=x86,bios +compress] boot = {
# This build file uses startup-apic by default; if you wish to use startup-bios instead, comment out the following line, and uncomment the one below it

	startup-apic -v  
	# startup-bios -v
	PATH=/proc/boot:/bin:/usr/bin:/opt/bin/sbin:/usr/sbin LD_LIBRARY_PATH=/proc/boot:/lib:/usr/lib:/lib/dll:/opt/lib procnto-smp-instr -v
}

[+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 Welcome to QNX Neutrino 6.6 on x86! 


#-------------------------------------------------------------------------------
	display_msg "Starting slogger..."
	slogger &
	waitfor /dev/slogf

#-------------------------------------------------------------------------------
	display_msg "Starting serial server..."
	devc-ser8250 -e -b115200 &
	waitfor /dev/ser1 

#-------------------------------------------------------------------------------
	display_msg "Starting PCI server..."
	pci-bios &
	waitfor /dev/pci

#-------------------------------------------------------------------------------
	display_msg "Starting network..."
	io-pkt-v6-hc -de1000 &
	waitfor /dev/socket
	dhcp.client

#-------------------------------------------------------------------------------
	display_msg "Starting USB services..."
	io-usb -duhci -dohci -dehci &
	waitfor /dev/io-usb/io-usb 4
	waitfor /dev/io-usb/devu-uhci.so 4
	waitfor /dev/io-usb/devu-ohci.so 4
	waitfor /dev/io-usb/devu-ehci.so 4

#-------------------------------------------------------------------------------
	display_msg "Starting AHCI drivar..."
	devb-ahci &
	waitfor /dev/hd0t179
	mount -t qnx6 /dev/hd0t179 /hd

#-------------------------------------------------------------------------------
	display_msg "Starting Input services..."
	io-hid -d usb /dev/io-usb/io-usb &

	# some systems require the command below instead...
	# io-hid -d ps2ser kbd:kbddev:ps2mouse:mousedev -d usb /dev/io-usb/io-usb &
 	
#-------------------------------------------------------------------------------
	display_msg "Starting some common servers..."
	pipe
	devc-pty &
	qconn

#-------------------------------------------------------------------------------
	display_msg "Starting Intel HD Audio driver..."
	io-audio -dintel_hda &

#-------------------------------------------------------------------------------

	display_msg "Starting some consoles..."
	devc-con-hid -n4 &
	reopen /dev/con1
	
# These env variables inherited by all the programs which follow
       SYSNAME=nto
       TERM=qansi

        # start a serial debug shell
        on -t /dev/ser1 /proc/boot/ksh &

	# start a console shell
	[+session] sh /proc/boot/.console.sh &
}

[type=link] /tmp=/dev/shmem
[type=link] /bin/sh=/proc/boot/ksh

# Shared libraries
libc.so
libm.so
libz.so
libtracelog.so.1
libaudio_manager.so.1
libpps.so.1


###########################################################################
## uncomment for Networking
###########################################################################
libsocket.so
devnp-e1000.so

###########################################################################
## uncomment for BLOCK driver
###########################################################################
libcam.so
io-blk.so
cam-disk.so
fs-qnx4.so
fs-qnx6.so
fs-dos.so
fs-ext2.so
cam-cdrom.so
fs-cd.so

###########################################################################
## uncomment for USB driver
###########################################################################
libusbdi.so
libhiddi.so
devu-ehci.so
devu-ohci.so
devu-uhci.so
devu-xhci.so

###########################################################################
## uncomment for Intel HD Audio Support
###########################################################################
deva-ctrl-intel_hda.so
deva-mixer-hda.so
libasound.so.2

###########################################################################
## uncomment for io-hid
###########################################################################
devh-usb.so
devh-ps2ser.so

[data=c]

###########################################################################
## general commands
###########################################################################
cp
mkdir
ls
pipe
pidin
rm
mv
ksh
uname
slogger
sloginfo
slay
sync
on
mount
umount
shutdown
less
setconf
getconf
login
qconn
rtc
date
fdisk

###########################################################################
## uncomment for serial
###########################################################################
devc-con
devc-con-hid 
devc-ser8250

###########################################################################
## uncomment for audio
###########################################################################
io-audio
wave
waverec

###########################################################################
## PCI support
###########################################################################
# uncomment this line if you are using startup-bios
# pci-bios

# uncomment this line if you are using startup-apic 
pci-bios=pci-bios-v2
pci

###########################################################################
## uncomment for network support
###########################################################################
io-pkt-v6-hc
nicinfo
ifconfig
ftp
ping
fs-nfs3
dhcp.client
inetd

###########################################################################
## uncomment for BLOCK driver
###########################################################################
devb-ahci
devb-eide
dcheck

###########################################################################
## uncomment for USB
###########################################################################
io-usb
usb
devb-umass
io-hid
hidview

###########################################################################
## uncomment for inetd support
###########################################################################
devc-pty
/usr/sbin/ftpd=ftpd
/usr/sbin/inetd=inetd
/bin/login=login
/bin/passwd=passwd
/usr/sbin/telnetd=telnetd
/etc/hosts=${QNX_TARGET}/etc/hosts
/etc/services=${QNX_TARGET}/etc/services

/etc/passwd = {
root::0:0:Superuser:/:/bin/sh
user:x:100:100:User:/hd/home/user:/bin/sh
}

/etc/shadow = {
user:68qCI1lS3Sz9w:1412120627:0:0
}

/etc/inetd.conf = {
ftp        stream tcp nowait root  /usr/sbin/ftpd           in.ftpd -l
telnet     stream tcp nowait root  /usr/sbin/telnetd        in.telnetd
}

/etc/ftpusers = {
/* Allow all users to connect to the ftp server */
* allow
}

/etc/ftpd.conf = {
/* Make things a+rw by default */
umask all 0000
}


###########################################################################
## Set environment and start the main shell
###########################################################################
[perms=0744] .console.sh={

# These environment variables are inherited by all the programs that follow.
echo Setting environment variables...
export SYSNAME=nto
export TERM=qansi
export HOME=/
export PATH=:/proc/boot:/bin:/usr/bin:/opt/bin:/sbin
export LD_LIBRARY_PATH=:/proc/boot:/lib:/usr/lib:/usr/lib/graphics:/usr/lib/graphics/intel-drm:/lib/dll:/opt/lib
export GRAPHICS_ROOT=/usr/lib/graphics/intel-drm
echo done.

#start graphics-sample if it exists
graphicsScript=/proc/boot/.start-graphics-sample
if [ -e "$graphicsScript" ]; then
   #graphics-sample uses dhclient instead of dhcp.client
   . "$graphicsScript"
else
   #######################################################################
   ## USB umass driver - must be started after USB-Ethernet bridge driver
   #######################################################################
   echo Starting USB mass storage driver...
   devb-umass cam pnp
   echo done.

fi

   #######################################################################
   ## Momentics remote target service
   #######################################################################
   echo Starting inetd service...
   inetd

   ksh -l
}

as far as i can tell the ahci driver is started:

#------------------------------------------------------------------------------- display_msg "Starting AHCI drivar..." devb-ahci & waitfor /dev/hd0t179 mount -t qnx6 /dev/hd0t179 /hd

UPDATE: success!

i remade the partition as a qnx6 filesystem with -b to make it bootable. copying ifs-x86-generic.bin into the ./boot directory on my qnx6 partition now works!

Thanks alot for the support guys

One last issue: im trying to ping the qnx PC from my developmet PC.

using ifconfig I see a wm0 and a wm1 with ips 192.168.1.10 and .11 respectively. both are enabled = 0.
plugging an ethernet cable into the pc shows one with media:Ethernet autoselect(blabla) the other with media: Ethernet none. Im assuming this means it recognizes at least one of the network cards?

when i ping from my PC with IP 192.168.1.21 i dont receive a response and also when pinging from my QNX machine to my PC’s IP i dont get a response. Any reason why this is? I checked /dev and i dont see io-net anywhere. Does this mean I’m missing drivers for my ethernet cards?¨

EDIT: the two PCs are connected over a switch.

EDIT2: I tried the following:

io-pkt-v6- -de1000 & waitfor /dev/socket
dhcp.client

still no success

io-pkt replaced io-net in QNX 6.5 and later.

This is your start call

io-pkt-v6-hc -de1000 &

Assuming you have a de1000 type Ethernet card in your PC then I’d suggest adding the -ptcpip option to the driver to tell it you want to do TCPIP protocol (supposed to do this by default but I don’t trust that).

I will assume you can ping the loop back address (127.0.0.1)…

What else does ifconfig report?

You might want to run Wireshark on your PC and see what network traffic there is when you try pinging to your QNX machine.

Tim