startup.md 5.6 KB
Newer Older
1
# Startup
L
liudongmiao 已提交
2

3
## Introduction
W
wenjun 已提交
4

S
shawn_he 已提交
5
The 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:
W
wenjun 已提交
6

S
shawn_he 已提交
7
-   init
W
wenjun 已提交
8

S
shawn_he 已提交
9
    This module can be used on platforms powered by LiteOS Cortex-A or Linux kernel.
W
wenjun 已提交
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).
W
wenjun 已提交
12 13


S
shawn_he 已提交
14
-   appspawn
W
wenjun 已提交
15

S
shawn_he 已提交
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.
W
wenjun 已提交
17

S
shawn_he 已提交
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.
W
wenjun 已提交
19

S
shawn_he 已提交
20
-   bootstrap
W
wenjun 已提交
21

S
shawn_he 已提交
22
    This module can be used on platforms powered by the LiteOS Cortex-M kernel. 
W
wenjun 已提交
23

S
shawn_he 已提交
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.
W
wenjun 已提交
25

S
shawn_he 已提交
26
-   syspara
W
wenjun 已提交
27

L
liudongmiao 已提交
28
    This module obtains and sets system attributes.
W
wenjun 已提交
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).
W
wenjun 已提交
31 32


33
## Directory Structure
W
wenjun 已提交
34

L
liudongmiao 已提交
35
**Table  1**  Directory structure of the source code for the startup subsystem
W
wenjun 已提交
36

37 38 39 40 41 42 43 44 45
| Directory                      | Description                                                  | Applicable Platform                                 |
| ------------------------------ | ------------------------------------------------------------ | --------------------------------------------------- |
| 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          |
| 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                    |
| base/startup/bootstrap_lite    | bootstrap module for starting all services except core system services. | Platforms using the LiteOS Cortex-M kernel          |
| base/startup/init_lite         | init_lite 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 |
| 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                                       |


W
wenjun 已提交
46

S
shawn_he 已提交
47

W
wenjun 已提交
48
```
L
liudongmiao 已提交
49
base/startup/
S
shawn_he 已提交
50
├── appspawn_standard         # appspawn module for the standard system
M
mamingshuai 已提交
51 52 53 54
│   ├── include               # Header files
│   ├── parameter             # System parameters
│   ├── src                   # Source files 
│   └── test                  # Test cases 
S
shawn_he 已提交
55
├── appspawn_lite             # appspawn module for the mini system
L
liudongmiao 已提交
56
│   └── services
M
mamingshuai 已提交
57 58 59
│       ├── include           # Header files 
│       ├── src              # Source files 
│       └── test              # Test cases
S
shawn_he 已提交
60
├── bootstrap_lite           # bootstrap module
L
liudongmiao 已提交
61
│   └── services
M
mamingshuai 已提交
62
│       └── source            # Source files 
S
shawn_he 已提交
63
├── init_lite                 # init module
M
mamingshuai 已提交
64 65
│   ├── initsync              # Source files
│   ├── interfaces            # External APIs
L
liudongmiao 已提交
66
│   └── services
M
mamingshuai 已提交
67 68 69
│       ├── include           # Header files 
│       ├── src               # Source files 
│       └── test              # Test cases
S
shawn_he 已提交
70
└── syspara_lite              # syspara module
M
mamingshuai 已提交
71 72 73 74 75
    ├── adapter               # Adaptation code
    ├── frameworks            # Source files
    ├── hals                  # Header files for the hardware abstraction layer (HAL)
    ├── interfaces            # External APIs
    └── simulator             # Simulator adaptation
W
wenjun 已提交
76 77
```

78
## Repositories Involved
L
liudongmiao 已提交
79

S
shawn_he 已提交
80
[Startup subsystem](../device-dev/subsystems/subsys-boot-overview.md)
L
liudongmiao 已提交
81

S
shawn_he 已提交
82
[startup\_appspawn\_lite](https://gitee.com/openharmony/startup_appspawn_lite)
M
mamingshuai 已提交
83

S
shawn_he 已提交
84
[startup\_appspawn](https://gitee.com/openharmony/startup_appspawn)
L
liudongmiao 已提交
85

Mr-YX's avatar
Mr-YX 已提交
86
[startup\_bootstrap\_lite](https://gitee.com/openharmony/startup_bootstrap_lite)
L
liudongmiao 已提交
87

S
shawn_he 已提交
88
[startup_init_lite](https://gitee.com/openharmony/startup_init_lite)
W
wenjun 已提交
89

90
[startup\_syspara\_lite](https://gitee.com/openharmony/startup_syspara_lite)