x86 image on usbstick

My goal is to crate qnx image that I can put on usbstick and boot it using grub.
The image is not directly installed to /dev/usb but I want it to put raw file on a vfat formated pendrive.

Using in grub

title QNX_rtl
kernel /boot/memdisk.bin
initrd /boot/qnx.raw

I have tried with all this

and they all boot fine in QEMU but neither wants to boot in real PC from grub and pendrive

They boots almost fine but stops after

Hit Esc for .altboot…

What could be fix for booting qnx with my method?

None of these image are meant to boot off a USB flash disk, you need to write a custom image for that. All these images expect a bunch of files to be present on a QNX partition

You should also make sure that the perticular USB device is supporte by QNX.

As for the grub part I can’t help you.

the grub part
kernel /boot/memdisk.bin
initrd /boot/qnx.raw

makes that qnx.raw image is like floppy drive image for boot loader, so the OS thinks it is on fd not on pendrive

No, it makes the qnx.raw image look like a floppy driver to the loader,but once QNX starts, it takes over the machine completely.

Ok, you are right, but everything QNX needs to run is on qnx.raw (it is made from qemu-minimal.build example - I just commented out part with mounting, it does not make any different for QNX to boot in qemu) image so one it is loaded into ram I do not need to mount it under QNX. I do not need to load anything extra outside image for now I just need it to boot.

In your build file, try to change the line
[virtual=x86,bios +compress]
[virtual=x86,elf +compress]

(change “bios” to “elf”)

Also, since you are playing with usbstick, you should consider using “syslinux” tools. Here is the entry I have in my syslinux.cfg file:

LABEL qnx6
                KERNEL mboot.c32
                APPEND myown.ifs

Hi noc ,
What is the different between “bios” and “elf”?

Can you point me to documentation?

You need to use ELF/multi-boot format (keyword “elf” in boot build file) that is required by grub, pxeboot, syslinux, etc. boot loaders.

Here are some references:

openqnx.com/index.php?name=N … le&sid=324
openqnx.com/index.php?name=P … ic&p=25141

Hi noc,
Thx for your help, it works now, I have

[virtual=x86,elf +compress] bootstrap = { }
and in grub just

title QNX_elf kernel /boot/qnx.elf

It boot great

Now I need to find out what is different between
bootstrap =
boot =


#date 2008.08.26
#standard(full) self-hosted install qnx-6.3.0 SP3 on x86 system
#/dev/hd2 - usb-flash-drive
#dd if=/dev/zero of=/dev/hd2
#mount -e
#fdisk /dev/hd2 add
#eject /dev/hd2 #remove masstorage manually
#eject -t /dev/hd2 #load masstorage manually
#mount -e
#fdisk /dev/hd2 boot -t 77
#fdisk -B /usr/qnx630/target/qnx6/x86/boot/sys/ipl-diskpc1-flop /dev/hd2 loader
#dinit -h /dev/hd2t77
#dinit -8 -d 80 -b -B /usr/qnx630/target/qnx6/x86/boot/sys/ipl-diskpc2 /dev/hd2t77
#mount -t qnx4 /dev/hd2t77 /fs/hd2t77
#cp -Mqnx -pRf / /fs/hd2t77/ #except /proc /dev /fs
#umount /fs/hd2t77
This image was successfully booted on HP 6720s (console mode);
and unsuccessfully booted on intel-945.

Hello Marwooj
I have similar requirement, but I am newbie to QNX.
I found many default build file in /boot/build
I tried to modify qnxbasesmp-apic.build to change the keyword of bios to elf, and boot to bootstrap
and type:
mkifs qnxbasesmp-apic.build /root/qnx.elf
And write below in /boot/grub/grub.cfg in hd0(grub2 base)

set default=0
set timeout=10
set root=(hd0,1)
terminal console
menuentry “QNX 6.5” {
multiboot (hd0,1)/images/qnx.elf

The grub2 can show the menu of QNX 6.5, but it will show error when into the boot item
error: invalid arch-dependent ELF magic
I am not sure if the command(mkifs) is correct to generate elf or not, could you please share your step