The example demonstrates how to set up a graphical user interface (GUI) in a KasperskyOS-based solution using a set of cross-platform libraries: SDL2 for managing the application window and processing user data input, Nuklear for building the graphical interface, Skia as a graphics rendering engine, and ZXing for generating QR codes.
Example directory in the SDK
The code of the example and build scripts are available at the following path:
/opt/KasperskyOS-Community-Edition-<platform>-<version>/examples/framebuffer_qr_writer
List of programs
QrWriter – application that converts user-entered text into a QR code and displays it in a graphical interface.EntropyEntity – system program that implements random number generation.VfsSdCardFs – system program that supports the file system of SD cards.BlobContainer – system program required for working with dynamic libraries in shared memory.DCM – system program that provides functionality for dynamically creating IPC channels.SDCard – SD card driver.FB – driver that facilitates interaction with the video card.Input – driver that facilitates interaction with USB input devices (mouse, keyboard).USB – driver for managing all types of USB devices.When you build an example for the target hardware platform, platform-specific drivers are automatically included in the solution:
GPIO – GPIO support driver for the Radxa ROCK 3A.PCIE – PCIe bus driver for Raspberry Pi 4 B.BSP – Board Support Package that provides cross-platform peripheral configuration for the Radxa ROCK 3A and Raspberry Pi 4 B.PinCtrl – low-level pin multiplexing (pinmux) configuration driver for the Radxa ROCK 3A.Bcm2711MboxArmToVc – driver for working with the VideoCore (VC6) coprocessor via mailbox technology for Raspberry Pi 4 B.Initialization description
The solution initialization description file named init.yaml is generated during the solution build process based on the ./einit/src/init.yaml.in template. 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.
Security policy description
The security.psl file contains a description of a security policy for a KasperskyOS-based solution and is located in the ./einit/src directory. The declarations in the PSL file are provided with comments that explain the purpose of these declarations.
The solution security policy description in this example allows any interaction between different processes and between processes and the kernel. This policy can be used only as a stub during the early stages of a solution development so that the security module does not interfere with interactions. It would be unacceptable to apply such a policy in a real-world KasperskyOS-based solution.
Resources
The ./resources/hdd/etc directory includes the ProggyClean.ttf file, which contains information about the font (name, size, style). This file is used to display text in the graphical user interface.
Operating scenario
The QrWriter program performs the following actions:
Building and running the example
The CMake system, which is included with KasperskyOS Community Edition, is used to build and run the example.
See Building and running examples section.
Page top