The examples are built using the CMake
build system that is included in KasperskyOS Community Edition.
The code of the examples and build scripts are available at the following path:
/opt/KasperskyOS-Community-Edition-<version>/examples
You need to build the examples in a directory in which you have write access, such as the home directory.
Building the examples to run on QEMU
To build an example, go to the directory with the example and run this command:
$ ./cross-build.sh
Running the cross-build.sh
script creates a KasperskyOS-based solution image that includes the example, and initiates startup of the example in QEMU. The kos-qemu-image
solution image is located in the <name of example>/build/einit
directory.
Building the examples to run on Raspberry Pi 4 B
To build an example, go to the directory with the example and run this command:
$ ./cross-build.sh --target {kos-image|sd-image}
The type of image that is created by the cross-build.sh
script depends on the value that you choose for the target
parameter:
kos-image
This creates a KasperskyOS-based solution image that includes the example. The kos-image
solution image is located in the <name of example>/build/einit
directory.
sd-image
This creates a file system image for a bootable SD card. The following is loaded into the file system image: kos-image
, U-Boot bootloader that starts the example, and the firmware for Raspberry Pi 4 B. The source code for the U-Boot bootloader and firmware can be downloaded from the website https://github.com. The file system image file rpi4kos.img
is saved in the directory <example name>/build
.