This example demonstrates how to include the virtual file system (VFS) provided in KasperskyOS Community Edition into KasperskyOS-based solution being developed.
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/embedded_vfs
List of programs
Client – application that fully encapsulates the VFS implementation from KasperskyOS Community Edition. This lets you eliminate the use of IPC for all the standard I/O functions (stdio.h, socket.h, etc.) for debugging or performance improvement purposes, for example.DCM – system program that lets you dynamically create IPC channels.EntropyEntity – system program that implements random number generation.SDCard – SD card driver.When you build an example for the target hardware platform, platform-specific drivers are automatically included in the solution:
BSP is a hardware platform support package (Board Support Package). Provides cross-platform configuration of peripherals for the Radxa ROCK 3A and Raspberry Pi 4 B.GPIO – GPIO support driver for the Radxa ROCK 3A.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 the solution security policy description and is generated based on the following template during the solution build process:
./einit/src/security.psl.in
During the solution build, the @INIT_EXTERNAL_ENTITIES@ macro in the security.psl.in template is replaced with a list of system programs that are included in the KasperskyOS SDK.
For more details, refer to security.psl.in template.
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.
Resources
The directory ./resources/xdl/hello contains the Client.edl file, which is the EDL description for the Client program.
Operating scenario
The Client program tests the following operations:
The hard disk image hdd.img for QEMU is created via the script /opt/KasperskyOS-Community-Edition-<platform>-<version>/common/prepare_hdd_img.sh and contains two partitions with the FAT32 and ext4 file systems.
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