Create a bootable USB device (interactive method using VMware)
To boot QNX OS by BIOS mode on your x86_64 target, you need create and format an bootable QNX partition on the boot media and copy the QNX IFS image x86_64-generic-bios.bin to /.boot direction; To boot QNX OS by UEFI mode, you need create and format a DOS partition on the boot media and copy the x86_64-generic-uefi.efi to the DOS filesystem as the specific UEFI boot file EFI/BOOT/BOOTX64.EFI.
- Create a bootable USB device. Typically, this mechanism needs to be done once. For more information, see
Create a bootable USB device using a virtual machine running QNX OS.
- Copy the QNX IFS image to the bootable USB device. For more information, see
Copy the QNX IFS image to the bootable USB device.
Create a bootable USB device using a virtual machine running QNX OS
To complete the steps, you can start a VMware machine running QNX OS in QNX Momentics IDE (referred to as simply VMware here). You can use the VMware to create a bootable USB device, such as a USB memory stick or USB storage key. The size of the storage should be at least 4 GB.
The steps for creating a bootable USB device using the interactive method using a VMware are as follows:
- Start the VMware in QNX Momentics IDE. For more information,
see the Creating a QNX virtual machine.
After you boot the VMware, you're running a QNX OS environment.
- Insert a USB device into an unused USB port on your host PC. Your VMware software should detect the USB drive, and prompt you to connect it either to your host computer or to the VMware. In the prompt, select Connect to QNX VMware.
- In the VMware, start the devb-umass driver. This driver supports generic USB mass storage devices,
such as USB memory sticks and hard drives. When you run the driver, you should see output on your VMWare that's similar to
the following:
# devb-umass cam pnp disk name=umass # Path=0 – QNX USB Storage target = 0 lun = 0 Direct Access(0) – Kingston DataTraveler G3 #
For information about the devb-umass, see the QNX OS Utilities Reference.
- Run the following command to determine the drive number of the USB device.
Your USB drive is likely /dev/umass0. If the drive already has an existing filesystem partition on it, this partition will be represented as /dev/umass0tnn, where
nn
represents the type of partition (e.g. 11 or 12 is a DOS FAT32; 177, 178, or 179 is the QNX6 filesystem, etc.).Note:Don't worry if there's no partition there. Any existing partitions are deleted when the new partition is created in the next step.# ls /dev/umass* /dev/umass0 /dev/umass0t12 /dev/umass0t177 /dev/umass0t179 #
- Run the following commands to delete any existing partitions on the USB drive:
CAUTION:The first command below deletes all partitions on your USB drive!
# fdisk /dev/umass0 delete -a # fdisk /dev/umass0 show _____OS_____ Start End ______Number______ Size Boot name type Cylinder Cylinder Cylinders Blocks 1. ------ --- -------- -------- ------- -------- ----- 2. ------ --- -------- -------- ------- -------- ----- 3. ------ --- -------- -------- ------- -------- ----- 4. ------ --- -------- -------- ------- -------- ----- #
- Add a type 177 parition (1GB size) into slot 1, and make partition slot 1 bootable:
Note:The bootable type 177 partition is used for BIOS boot mode (Legacy boot mode).
# fdisk /dev/umass0 add -s1 -t177 -c2,1001 # fdisk /dev/umass0 boot -s1 # fdisk /dev/umass0 show _____OS_____ Start End ______Number______ Size Boot name type Cylinder Cylinder Cylinders Blocks 1. QNX6 177 2 1001 1000 2048000 1000 MB * 2. ------ --- -------- -------- ------- -------- ----- 3. ------ --- -------- -------- ------- -------- ----- 4. ------ --- -------- -------- ------- -------- ----- #
- Enumerate the type 177 partition that was created in the previous step:
# mount -e /dev/umass0 # # ls /dev/umass* /dev/umass0 /dev/umass0t177 #
- Format the type 177 partition with a QNX Power-Safe filesystem, using the mkqnx6fs utility,
as follows:
# mkqnx6fs /dev/umass0t177 All files on /dev/umass1t177 will be lost! Confirm filesystem re-format (y) or (n): y Format fs-qnx6: 255996 blocks, 32000 inodes, 4 groups #
- Add a type 12 parition (1GB size) and Format it with a DOS filesystem, using the mkdosfs utility,
and create the EFI boot directory as follows:
Note:The type 12 partition is used for UEFI boot mode.
# fdisk /dev/umass0 add -t12 -c1002,2001 # mount -e /dev/umass0 # ls /dev/umass0* /dev/umass0 /dev/umass0t12 /dev/umass0t177 # # mkdosfs /dev/umass0t12 Format complete: FAT32 (4096-byte clusters), 1021984 kB available. # # fdisk /dev/umass0 show _____OS_____ Start End ______Number______ Size Boot name type Cylinder Cylinder Cylinders Blocks 1. QNX6 177 2 1001 1000 2048000 1000 MB * 2. FAT32 12 1002 2001 1000 2048000 1000 MB 3. ------ --- -------- -------- ------- -------- ----- 4. ------ --- -------- -------- ------- -------- ----- # mount -t dos /dev/umass0t12 /dos # mkdir /dos/EFI # mkdir /dos/EFI/BOOT #
- Optionally add a type 179 QNX partition (1GB size) on the USB drive for the persistent storage:
# fdisk /dev/umass0 add -t179 -c2002,3001 # mount -e /dev/umass0 # ls /dev/umass0* /dev/umass0 /dev/umass0t12 /dev/umass0t177 /dev/umass1t179 # # mkqnx6fs /dev/umass0t179 All files on /dev/umass1t179 will be lost! Confirm filesystem re-format (y) or (n): y Format fs-qnx6: 255996 blocks, 32000 inodes, 4 groups # # fdisk /dev/umass0 show _____OS_____ Start End ______Number______ Size Boot name type Cylinder Cylinder Cylinders Blocks 1. QNX6 177 2 1001 1000 2048000 1000 MB * 2. FAT32 12 1002 2001 1000 2048000 1000 MB 3. QNX6 179 2002 3001 1000 2048000 1000 MB 4. ------ --- -------- -------- ------- -------- ----- #
You now have a bootable USB device for both BIOS and UEFI boot mode that you can transfer QNX IFS image to it.
Copy the QNX IFS image to the bootable USB device
After you've created a bootable USB device, you must transfer the QNX IFS image that you built using this BSP to the USB device:
- Remove and re-insert the USB device into a USB port on your Linux or Windows host that installed the QNX SDP 8.0
host environment and this BSP.
Warning:Ensure that the USB device is connected to the host machine instead of the virtual machine running QNX OS.
- For UEFI boot mode, copy the QNX IFS image (x86_64-generic-uefi.efi) from the
$BSP_ROOT_DIR/images/generic-uefi directory to the file BOOTX64.EFI
in /EFI/BOOT directory of the bootable USB device. For example, in Linux host, the command similar to
the following:
$ cp $BSP_ROOT_DIR/images/generic-uefi/x86_64-generic-uefi.efi /media/qnx/0A0C-1805/EFI/BOOT/BOOTX64.EFI
Note:Change the /media/qnx/0A0C-1805/ directory in command above to match your USB device in your host.You now have a bootable USB device with QNX IFS image for UEFI boot mode. Your USB drive is ready to boot QNX OS on your x86_64 target.
- For BIOS boot mode, you need copy the QNX IFS image (x86_64-generic-bios.bin) in
the $BSP_ROOT_DIR/images/generic-bios directory to the DOS filesystem of the USB device,
and then tranfer it to the QNX filesystem (type 177) by using the VMware.
- copy the QNX IFS image to the USB device on your host. For example, in Linux host, the command similar to the following:
$ cp $BSP_ROOT_DIR/images/generic-bios/x86_64-generic-bios.bin /media/qnx/0A0C-1805/x86_64-generic-bios.bin
Note:Change the /media/qnx/0A0C-1805/ directory in the command above to match your USB device in your host. - Remove and re-insert the USB device. When the prompt from your VMware software appears, connect the USB device to the VMware instead of the host machine
- In VMware, select menu to connect the USB device to the VMware, where name of your USB device is a string name matching your device. For example, Kingston USB device.
- After the USB device is connected to the VMware, you can tranfer the QNX IFS image
from the DOS filesystem to QNX filesystem using these steps (this example assumes that
the USB device has appeared as /dev/umass0):
# mount -t dos /dev/umass0t12 /dos # mount -t qnx6 -o sync=optional /dev/umass0t177 /qnx # cp /dos/x86_64-generic-bios.bin /qnx/.boot/x86_64-generic-bios.bin #
Note:Make sure that you have run the devb-umass command.
You now have a bootable USB device with QNX IFS image for BIOS boot mode. Your USB drive is ready to boot QNX OS on your x86_64 target.
- copy the QNX IFS image to the USB device on your host. For example, in Linux host, the command similar to the following: