• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Startup
2
3## Introduction
4
5The startup subsystem is responsible for starting key system processes and services after the kernel is started and before applications are started. The subsystem consists of the following modules:
6
7-   init
8
9    This module can be used on platforms powered by LiteOS Cortex-A or Linux kernel.
10
11    The module starts system service processes from the time the kernel loads the first user-space process to the time the first application is started. In addition to loading key system processes, it needs to configure their permissions during the startup and keep the specified process alive after sub-processes are started. If a key process exits abnormally, the module needs to perform a system restart. For details, see [init Module](../device-dev/subsystems/subsys-boot-init-cfg.md).
12
13
14-   appspawn
15
16    This module comes with the Lite and Standard editions. The Lite edition can be used on platforms powered by the LiteOS-A kernel, and the Standard edition can be used on platforms powered by the Linux kernel.
17
18    The module spawns application processes upon receiving commands from the application framework, configures permissions for new processes, and calls the entry function of the application framework.
19
20-   bootstrap
21
22    This module can be used on platforms powered by the LiteOS Cortex-M kernel.
23
24    The module provides entry identifiers for starting services and features. When SAMGR is started, the entry function identified by **bootstrap** is invoked and system services are started.
25
26-   syspara
27
28    This module obtains and sets system attributes.
29
30    The module can be used on all platforms. Supported system attributes consist of default, OEM-specified, and custom system attributes. OEM-specified system attributes provide only default values. The specific values need to be adjusted as required. For details, see [syspara Module](../device-dev/subsystems/subsys-boot-init-sysparam.md).
31
32
33## Directory Structure
34
35**Table  1**  Directory structure of the source code for the startup subsystem
36
37| Directory                      | Description                                                  | Applicable Platform                                 |
38| ------------------------------ | ------------------------------------------------------------ | --------------------------------------------------- |
39| base/startup/appspawn_lite     | appspawn module of the Lite edition for spawning application processes. It receives Ability Manager Service (AMS) messages via IPC, parses the messages, starts application processes based on the parsing result, and grants permissions to them. | Platforms using the LiteOS Cortex-A kernel          |
40| base/startup/appspawn_standard | appspawn module of the Standard version for spawning application processes. It receives Ability Manager Service (AMS) messages via IPC, parses the messages, starts application processes based on the parsing result, and grants permissions to them. | Platforms using the Linux kernel                    |
41| base/startup/bootstrap_lite    | bootstrap module for starting all services except core system services. | Platforms using the LiteOS Cortex-M kernel          |
42| base/startup/init         | init module for implementing the init process, which is the first user-space process loaded after the kernel is initialized. Upon startup, the process parses the configuration file in **/etc/init.cfg**. Based on the parsing result, the process then starts other key system processes and grants required permissions to them. | Platforms using the LiteOS Cortex-A or Linux kernel |
43| base/startup/syspara_lite      | syspara module that provides APIs to obtain device information, including the product name, brand name, category name, and manufacturer name. | All platforms                                       |
44
45
46
47
48```
49base/startup/
50├── appspawn_standard         # appspawn module for the standard system
51│   ├── include               # Header files
52│   ├── parameter             # System parameters
53│   ├── src                   # Source files
54│   └── test                  # Test cases
55├── appspawn_lite             # appspawn module for the mini system
56│   └── services
57│       ├── include           # Header files
58│       ├── src              # Source files
59│       └── test              # Test cases
60├── bootstrap_lite           # bootstrap module
61│   └── services
62│       └── source            # Source files
63├── init                 # init module
64│   ├── initsync              # Source files
65│   ├── interfaces            # External APIs
66│   └── services
67│       ├── include           # Header files
68│       ├── src               # Source files
69│       └── test              # Test cases
70└── syspara_lite              # syspara module
71    ├── adapter               # Adaptation code
72    ├── frameworks            # Source files
73    ├── hals                  # Header files for the hardware abstraction layer (HAL)
74    ├── interfaces            # External APIs
75    └── simulator             # Simulator adaptation
76```
77
78## Repositories Involved
79
80[Startup subsystem](../device-dev/subsystems/subsys-boot-overview.md)
81
82[startup\_appspawn\_lite](https://gitee.com/openharmony/startup_appspawn_lite)
83
84[startup\_appspawn](https://gitee.com/openharmony/startup_appspawn)
85
86[startup\_bootstrap\_lite](https://gitee.com/openharmony/startup_bootstrap_lite)
87
88[startup_init_lite](https://gitee.com/openharmony/startup_init_lite)
89
90[startup\_syspara\_lite](https://gitee.com/openharmony/startup_syspara_lite)