The examples are built using the CMake build system that is included in KasperskyOS Community Edition.
Prior to building the examples, make sure that you set the values of the environment variables required for use of the SDK. For more details, refer to Installation and removal.
The code of the examples and build scripts are available at the following path:
/opt/KasperskyOS-Community-Edition-<platform>-<version>/examples
You need to build the examples in a directory in which you have write access. For example, you can do so by copying the directory containing the example into the home directory.
Building the examples to run on QEMU
To build an example, go to the directory containing the example and run the following commands:
$ cmake -B build -D CMAKE_TOOLCHAIN_FILE="$KOSCEDIR/toolchain/share/toolchain-aarch64-kos.cmake"
$ cmake --build build --target {kos-qemu-image|sim}
kos-qemu-image target is selected, an image of the KasperskyOS-based solution including the example is created. The kos-qemu-image solution image is located in the <name of example>/build/einit directory.sim target is selected, startup of the example in QEMU is also initiated after the solution image is built.Building the examples to run on Raspberry Pi 4 B or Radxa ROCK 3A
To build an example, go to the directory containing the example and run the following commands:
$ cmake -B build -D CMAKE_TOOLCHAIN_FILE="$KOSCEDIR/toolchain/share/toolchain-aarch64-kos.cmake"
$ cmake --build build --target {kos-image|sd-image}
kos-image target is selected, an image of the KasperskyOS-based solution including the example is created. The kos-image solution image is located in the <name of example>/build/einit directory.sd-image target is selected, a bootable SD card file system image is created. 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 or Radxa ROCK 3A. The source code for the U-Boot bootloader and firmware can be downloaded from the website https://github.com. The file system image file hdd.img is saved in the directory <example name>/build.Before running the examples on Radxa ROCK 3A, you also need to build the drivers provided as a source code in the SDK.
Page top