This example demonstrates Inter-Process Communication (IPC) in KasperskyOS using a parameter of the sequence data type. It implements a producer-consumer pattern where one application generates sequential data and transmits it through a predefined static IPC channel. The receiving application logs each obtained sequence to the standard error output.
For additional details on KasperskyOS, including its limitations and known issues, please refer to the KasperskyOS Community Edition Online Help.
Reader—Program that receives sequence data through IPC channel and logs received sequences to standard error output.Writer—Program that generates sequential data patterns and sends them through IPC channel to theReaderprogram at regular intervals with error handling and size validation.DCM—System program that lets you dynamically create IPC channels.
The solution initialization description file named init.yaml is generated during the solution
build process based on the ./einit/src/init.yaml.in template.
The macros in @INIT_*@ format contained in the template are
automatically expanded in the resulting init.yaml file. For more details, refer to
init.yaml.in template.
The ./einit/src/security.psl file describes the security policy of the
solution. The declarations in the PSL file are provided with comments that explain the purpose of
these declarations. For more information about the security.psl file, see
Describing a security policy for a KasperskyOS-based solution.
- Confirm that your host system meets all the System requirements listed in the KasperskyOS Community Edition Developer's Guide.
- Install the KasperskyOS Community Edition SDK version 1.4. You can download it for free from os.kaspersky.com.
- Copy the source files of this example to your local project directory.
- Set up the build environment by sourcing the SDK setup script in your terminal session:
source /opt/KasperskyOS-Community-Edition-<platform>-<version>/common/set_env.sh
- Build the necessary drivers from source only if you intend to run this example on Radxa ROCK 3A hardware. This step is not required for QEMU or Raspberry Pi 4 B.
The example is built using the CMake build system, which is provided in the KasperskyOS Community Edition SDK.
To build the example to run on QEMU, go to the directory with 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}where:
kos-qemu-imagecreates a KasperskyOS-based solution image for QEMU that includes the example;simcreates a KasperskyOS-based solution image for QEMU that includes the example and runs it.
After a successful build, the kos-qemu-image solution image will be located at the ./build/einit
directory.
To build the example to run on the target hardware platform, go to the directory with 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}where:
kos-imagecreates a KasperskyOS-based solution image that includes the example;sd-imagecreates a file system image for a bootable SD card.
After a successful build, the kos-image solution image will be located at the ./build/einit
directory. The hdd.img bootable SD card image will be located at the ./build directory.
To run the example on the target hardware platform:
-
Connect the SD card to the computer and copy the bootable SD card image to the SD card using the command:
$ sudo dd bs=64k if=build/hdd.img of=/dev/sd[X] conv=fsync
where
[X]is the final character in the name of the SD card block device. -
Connect the bootable SD card to the board.
-
Supply power to the board and wait for the example to run.
You can also use an alternative option to prepare and run the example:
-
Prepare the required hardware platform and a bootable SD card to run the example by following the instructions:
-
Run the example by following the instructions in the KasperskyOS Community Edition Online Help.
./reader/CMakeLists.txt—CMake commands for building the Reader program.
./writer/CMakeLists.txt—CMake commands for building the Writer program.
./einit/CMakeLists.txt—CMake commands for building the Einit program and
the solution image.
./CMakeLists.txt—CMake commands for building the solution.
Build and run the example. After running the example, the following actions will be executed:
- The KasperskyOS kernel runs the
Einitinitialization process. Einitinitializes static IPC channels and runs all processes.- The
Readerprogram will begin listening for sequence data on the IPC channel. - The
Writerprogram will start generating and sending sequences every 3 seconds. - On successful completion of work, programs print messages to standard error output.
The expected output is contained in the
./expected_output.txtfile.
© 2026 AO Kaspersky Lab