Create and transfer a bootable disk image (offline method)

To boot QNX OS on your x86_64 target, you can create a bootable disk image that contains the IFS file. The disk image can be copied over to a USB device.

The offline method is the simplest approach to use the QNX IFS image from your BSP because it requires that you use the host tools provided with your QNX SDP 8.0 installation. This method requires that you do these tasks:
  1. Create a disk image, which builds a bootable BIOS and UEFI disk image file (e.g., disk.img). For more information, see Create a disk image.
  2. Transfer the disk image to a USB device, such as a USB memory stick. For more information, depending on your host environment, see Transfer the USB image using host tools on Linux, or Transfer the USB image using host tools on Windows.

Create a disk image

You can create a disk image for both BIOS and UEFI boot mode. For more information, see Transferring an OS image onto your board in the Working with a BSP chapter of the Building Embedded Systems guide.

Create a disk image for both BIOS and UEFI boot mode

To build a disk image for both BIOS and UEFI boot mode, in a terminal or Command Prompt on your host machine, navigate to the $BSP_ROOT_DIR/images/generic-bios or $BSP_ROOT_DIR/images/generic-uefi directory and run the make disk_image command. The mkdiskimage script does the following:
  • calls the mkqnx6fsimg utility and a buildfile named part_bios_boot.build to create a Power-safe filesystem image named part_bios_boot.img;
  • calls the mkfatfsimg utility with a buildfile called part_uefi_boot.build to create a DOS file system image called part_uefi_boot.img;
  • calls the mkqnx6fsimg utility and a buildfile named part_qnx_data.build to create a Power-safe filesystem image named part_qnx_data.img;
  • calls the diskimage utility using the configuration file called disk.cfg and the IPL binary called ipl-diskpc1 to create a bootable disk image named disk.img.
The buildfile part_bios_boot.build configures the QNX6 filesystem for BIOS boot mode and specifies the QNX IFS image as ./boot/primary_boot_image.bin. By default, the x86_64-generic-bios.bin file is used, which is provided with this BSP. If you want to use a different QNX IFS image in the disk image, modify this buildfile and specify the name of your BIN file.
Note:
For BIOS boot mode, The name of QNX IFS image you choose must be less than 27 characters in length and the QNX IFS image you specify can't be more than 16 MB in size.

The buildfile part_uefi_boot.build configures the DOS filesystem for UEFI boot mode and specifies the QNX IFS image as EFI/BOOT/BOOTX64.EFI. By default, the x86_64-generic-uefi.efi file is used, which is provided with this BSP. If you want to use a different QNX IFS image in the disk image, modify this buildfile and specify the name of your EFI file.

The steps to create a disk image using host tools (offline method) are as follows:

  1. Navigate to the $BSP_ROOT_DIR/images/generic-bios or $BSP_ROOT_DIR/images/generic-uefi directory. If you're in the BSP root directory ($BSP_ROOT_DIR):
    $ cd images/generic-bios
    or
    $ cd images/generic-uefi
                            
  2. Create the disk image (disk.img using the following commands:
    $ make disk_image

After you build your bootable disk images, transfer the image to a USB device. For more information, depending on your host environment, see Transfer the USB image using host tools on Linux , or Transfer the USB image using host tools on Windows.

Transfer the disk image using host tools on Linux

On a Linux system, you transfer the bootable disk image to your USB device from the commandline. Use these steps, where path is the path to your USB device, such as /dev/sdb:

  • If your version of Linux supports the sudo command, enter:
    $ sudo dd if=disk.img of=path
  • If your version of Linux does not support the sudo command, enter:
    $ su -c dd if=disk.img of=path

When the copy operation is complete, your USB device should be ready to boot QNX OS on your x86_64-based target.

Transfer the USB image using host tools on Windows

On a Windows system, to transfer the disk image to your USB device, use these steps:

  1. Download and install Win32 Disk Imager from http://sourceforge.net/projects/win32diskimager/
  2. Insert your USB device, such as a USB stick into your host computer.
  3. Run Win32 Disk Imager.
  4. In the Win32 Disk Imager, in the Image File box, browse to the location where your image file (disk.img) is located and click Open. The selected image file appears in the box.
  5. Select the letter representing your USB device.
  6. Click Write and click Yes to overwrite the contents on your USB device.

When the copy operation is complete, your USB device should be ready to boot QNX OS on your x86_64-based target.

Page updated: