Building the examples

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}

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}

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