Building the host
After you have installed a QNX hypervisor product, all of the components needed to build the hypervisor host should be on your development host. After you have configured your build environment and built one or more guests, you are now ready to build the hypervisor host into an IFS.
Building with a hypervisor buildfile variant
If the BSP you're using to build your hypervisor system provides a hypervisor buildfile variant, follow these steps to build the host:
- Unzip the archive that contains the BSP.
- Locate the hypervisor buildfile variant within your BSP. This buildfile is in the same directory as the generic buildfile but its name contains -hypervisor; for example, /images/mek/imx8qm-cpu-mek-hypervisor.build.
- If you want to use the shmem-host shared memory demonstration
application, you need to build it. For more information, go to
Adding the shmem-host demonstration application.
- Use the following command to make the BSP's prebuilt binaries available to the BSP's
build system:
make prebuilt - Navigate to the /images directory (e.g.,
cd images/), and then use the following command to build the host IFS:make hypNote:If you run simply make, the build utility uses the default buildfile that comes with the BSP and, thus, won't build a hypervisor host image. The command make hyp won't work if a QNX hypervisor product is not installed. - Use the following command to build the host disk
image:
make disk_image
Building without a hypervisor buildfile variant
If the BSP you're using does not provide a hypervisor buildfile variant, follow these steps to build the host:
- Unzip the archive that contains the BSP.
- If you want to include the shmem-host shared memory demonstration
application, you need to build it using source code you obtain from a BSP
provided with a QNX hypervisor product. For more information, go to
Adding the shmem-host demonstration application.
- Use the following command to make the BSP's prebuilt binaries available to the BSP's
build system:
make prebuilt - Navigate to the /images directory (e.g.,
cd images/). - Modify the buildfile to include the files you need for your hypervisor system at
the appropriate target locations. These include:
- The QNX virtual machine binary, qvm, and, optionally
for x86, the qvm-check utility. For example:
/sbin/qvm = qvm /bin/qvm-check = qvm-check - The configuration files (*.qvmconf) for each VM
that you will run in your hypervisor system:
infotainment_ubuntu.qvmconf - The shared object file (vdev-*.so) for every vdev
you want to make available for your guests. For example:
vdev-8259.so vdev-hpet.so vdev-ioapic.so ... vdev-virtio-console.so vdev-virtio-net.so - The smmuman service, architecture, and board support
libraries, and its configuration files. For example, for a QNX hypervisor
system on a supported x86 board:
/bin/smmuman = smmuman /bin/smmu-vtd.so = smmu-vtd.so /etc/smmuman/vtd.smmu = ./smmuman-config/vtd.smmu
- The QNX virtual machine binary, qvm, and, optionally
for x86, the qvm-check utility. For example:
- Modify the buildfile to include
-Q enablein the startup driver arguments, inside thevirtualattribute that specifies arguments to the startup driver and kernel. - Run make to build the host IFS using the host buildfile.
- If it's applicable in your environment, build a bootable disk image:
- Use the make disk_image command, if your BSP supports it.
- For other BSPs, you can create a system disk image using the diskimage utility (go to the diskimage entry in the QNX OS Utilities Reference).
- For an example of host disk image creation, in a QNX-supplied BSP that supports
the QNX hypervisor product that you're using, examine the Makefile located at
images/board_variant/Makefile.
The entry for the
disk_imagetarget illustrates which tools and scripts are called, and which configuration and buildfiles are used (some of which are found in the images/ folder). - For more information, go to
Hypervisor disk images
andTransferring the disk image.
Adding the shmem-host demonstration application
- If you are not using a host BSP provided with a QNX hypervisor product:
- Obtain a BSP that is provided with the hypervisor product that you're using to develop your QNX virtualized system, either QNX Hypervisor or QNX Hypervisor for Safety.
- Unzip the archive for this other BSP, then copy the source code from its src/apps/hypervisor/demos/shmem-host/ directory into the src/ directory of the BSP you're using to build your system.
(QNX-supplied BSPs that support QNX Hypervisor or QNX Hypervisor for Safety already have the source code—you just need to build the application.)
- Optionally, to modify the application, make the required changes to the source code in your BSP's src/apps/hypervisor/demos/shmem-host/ directory.
- Build and install the application. For example, in the new
src/apps/hypervisor/demos/shmem-host/ directory, run
make install to copy the revised binary to
install/.
The binary is ready to include in your buildfile.
The shmem-host application expects to communicate with a peer via the shared memory (shmem) vdev. In most cases, this peer is either shmem-guest or shmem-linux, running inside of a guest equipped with the appropriate vdev.
