This example demonstrates the mechanism for creating a crash dump in a KasperskyOS-based solution.
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/dump_collector
List of programs
Launcher – application that starts a process that will be terminated abnormally.ExecMgrEntity – system program that manages the life cycle of processes via IPC mechanisms.DumpCollector – system program that generates a dump when a process terminates abnormally.EntropyEntity – system program that implements random number generation.VfsSdCardFs – system program that supports the file system of SD cards.BlobContainer – system program that is designed to load binary data into memory and is used by the Execution Manager program to start processes.DCM – system program that provides functionality for dynamically creating IPC channels.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.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/xdl/application/Application.edl and ./resources/xdl/launcher/Launcher.edl files are EDL descriptions of programs.
Operating scenario
The Launcher program starts the process named application.Application by using the StartEntity() function from the IApplicationController interface of the Execution Manager component. Using the info input parameter, this function accepts process startup parameters in the StartEntityInfo structure. The mode field of the StartEntityInfo structure is set to Dump:
// Policy for handling abnormal termination of the process:
// CrashMode::None – do not perform any action;
// CrashMode::Dump – create a crash dump;
// CrashMode::Panic – shut down or restart the hardware platform.
info.mode = execution_manager::CrashMode::Dump;
The started process performs actions that lead to its abnormal termination. When the process terminates abnormally, a crash dump is generated automatically. This dump contains diagnostic data such as the stack trace, the state of processor registers, information about threads, and the memory map of the process. The generated crash dump is printed to the console using the LogRR component.
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