Einit initializing program
When a solution is started, the KasperskyOS kernel finds the executable file named Einit
(initializing program) in the solution image and runs this executable file. The initializing program performs the following operations:
A process of the initializing program belongs to the Einit
class.
Generating the source code of the initializing program
The KasperskyOS SDK includes the einit
tool, which generates the C-language source code of the initializing program. The standard way to use the einit
tool is to integrate an einit call into one of the steps of the build script, which generates the einit.c
file containing the source code of the initializing program. In one of the following steps of the build script, you must compile the einit.c
file into the executable file of Einit
and include it into the solution image.
You are not required to create formal specification files for the initializing program. These files are provided in the KasperskyOS SDK and are automatically applied during a solution build. However, the Einit
process class must be specified in the security.psl
file.
The einit
tool generates the source code of the initializing program based on the init description, which consists of a text file that is usually named init.yaml
.
Syntax of init.yaml
An init description contains data in YAML format. This data identifies the following:
This data consists of a dictionary with the entities
key containing a list of dictionaries of processes. Process dictionary keys are presented in the table below.
Process dictionary keys in an init description
Key |
Required |
Value |
---|---|---|
|
Yes |
Process class name (from the EDL description). |
|
No |
Process name. If this name is not specified, the process class name will be used. Each process must have a unique name. You can start multiple processes of the same class if they have different names. |
|
No |
Name of the executable file in ROMFS (in the solution image). If this name is not specified, the process class name (without prefixes and dots) will be used. For example, processes of the You can start multiple processes from the same executable file. |
|
No |
Process IPC channel dictionaries list. This list defines the statically created IPC channels whose client IPC handles will be owned by the process. The list is empty by default. (In addition to statically created IPC channels, processes can also use dynamically created IPC channels.) |
|
No |
List of program startup parameters ( |
|
No |
Dictionary of program environment variables. The keys in this dictionary are the names of environment variables. The maximum size of an environment variable value is 1024 bytes. |
Process IPC channel dictionary keys are presented in the table below.
IPC channel dictionary keys in an init description
Key |
Required |
Value |
---|---|---|
|
Yes |
IPC channel name, which can be defined as a specific value or as a link such as
|
|
Yes |
Name of the process that will own the server handle of the IPC channel. |