|
Name |
|
Date |
Size |
#Lines |
LOC |
| .. | | - | - |
| arch/ | | 12-May-2024 | - | 72,822 | 31,350 |
| components/ | | 12-May-2024 | - | 24,149 | 16,118 |
| drivers/ | | 12-May-2024 | - | 11 | 8 |
| figures/ | | 12-May-2024 | - | | |
| kal/ | | 12-May-2024 | - | 11,643 | 7,905 |
| kernel/ | | 12-May-2024 | - | 14,565 | 7,012 |
| targets/ | | 12-May-2024 | - | 34,341 | 17,570 |
| testsuites/ | | 12-May-2024 | - | 78,812 | 39,963 |
| tools/ | | 12-May-2024 | - | 353 | 296 |
| utils/ | | 12-May-2024 | - | 2,198 | 909 |
| .gitignore | D | 12-May-2024 | 246 | 22 | 20 |
| BUILD.gn | D | 12-May-2024 | 7.5 KiB | 310 | 271 |
| Kconfig | D | 12-May-2024 | 18 KiB | 668 | 543 |
| LICENSE | D | 12-May-2024 | 1.6 KiB | 29 | 23 |
| Makefile | D | 12-May-2024 | 4.1 KiB | 123 | 70 |
| NOTICE | D | 12-May-2024 | 782 | 9 | 7 |
| OAT.xml | D | 12-May-2024 | 6.3 KiB | 87 | 38 |
| README.md | D | 12-May-2024 | 7.9 KiB | 135 | 92 |
| README_zh.md | D | 12-May-2024 | 6.9 KiB | 136 | 92 |
| arch_spec.md | D | 12-May-2024 | 8.4 KiB | 99 | 97 |
| arch_spec_zh.md | D | 12-May-2024 | 8.1 KiB | 98 | 96 |
| bundle.json | D | 12-May-2024 | 1.4 KiB | 61 | 61 |
| liteos.gni | D | 12-May-2024 | 5.7 KiB | 172 | 156 |
README.md
1# LiteOS-M Kernel<a name="EN-US_TOPIC_0000001096757661"></a>
2
3- [Introduction](#section11660541593)
4- [Directory Structure](#section161941989596)
5- [Constraints](#section119744591305)
6- [Usage](#section3732185231214)
7- [Contribution](#section1371123476307)
8- [Repositories Involved](#section1371113476307)
9
10## Introduction<a name="section11660541593"></a>
11
12OpenHarmony LiteOS-M is a lightweight operating system kernel designed for the Internet of Things (IoT) field. It features small footprint, low power consumption, and high performance. It has a simple code structure, including the minimum kernel function set, kernel abstraction layer, optional components, and project directory. The LiteOS-M kernel is divided into the hardware layer and hardware-irrelevant layers. The hardware layer provides a unified hardware abstraction layer (HAL) interface for easier hardware adaptation. A range of compilation toolchains can be used with different chip architectures to meet the expansion of diversified hardware and compilation toolchains in the Artificial Intelligence of Things (AIoT) field.
13**Figure1** shows the architecture of the LiteOS-M kernel.
14
15**Figure 1** Architecture of the OpenHarmony LiteOS-M kernel<a name="fig0865152210223"></a>
16
17![](figures/architecture-of-openharmony-the-liteos-cortex-m-kernel.png "OpenHarmony-LiteOS-M Kernel Architecture")
18
19## Directory Structure<a name="section161941989596"></a>
20
21The directory structure is as follows. For more details, see [arch_spec.md](arch_spec.md).
22
23```
24/kernel/liteos_m
25├── arch # Code of the kernel instruction architecture layer
26│ ├── arm # Code of the ARM32 architecture
27│ │ ├── arm9 # Code of the ARM9 architecture
28│ │ ├── cortex-m3 # Code of the cortex-m3 architecture
29│ │ ├── cortex-m33 # Code of the cortex-m33 architecture
30│ │ ├── cortex-m4 # Code of the cortex-m4 architecture
31│ │ ├── cortex-m7 # Code of the cortex-m7 architecture
32│ │ └── include # Arm architecture public header file directory
33│ ├── csky # Code of the csky architecture
34│ │ └── v2 # Code of the csky v2 architecture
35│ ├── include # APIs exposed externally
36│ ├── risc-v # Code of the risc-v architecture
37│ │ ├── nuclei # Code of the nuclei system technology risc-v architecture
38│ │ └── riscv32 # Code of the risc-v architecture
39│ └── xtensa # Code of the xtensa architecture
40│ └── lx6 # Code of the lx6 xtensa architecture
41├── components # Optional components
42│ ├── backtrace # Backtrace support
43│ ├── cppsupport # C++ support
44│ ├── cpup # CPU percent (CPUP)
45│ ├── dynlink # Dynamic loading and linking
46│ ├── exchook # Exception hooks
47│ ├── fs # File systems
48│ ├── lmk # Low memory killer functions
49│ ├── lms # Lite memory sanitizer functions
50│ ├── net # Networking functions
51│ ├── power # Power management
52│ ├── shell # Shell function
53│ ├── fs # File systems
54│ └── trace # Trace tool
55├── drivers # driver Kconfig
56├── kal # Kernel abstraction layer
57│ ├── cmsis # CMSIS API support
58│ └── posix # POSIX API support
59├── kernel # Minimum kernel function set
60│ ├── include # APIs exposed externally
61│ └── src # Source code of the minimum kernel function set
62├── targets # Board-level projects
63├── testsuites # Kernel testsuites
64├── tools # Kernel tools
65├── utils # Common directory
66```
67
68## Constraints<a name="section119744591305"></a>
69
70OpenHarmony LiteOS-M supports only C and C++.
71
72Applicable architecture: See the directory structure for the arch layer.
73
74As for dynamic loading module, the shared library to be loaded needs signature verification or source restriction to ensure security.
75
76## Usage<a name="section3732185231214"></a>
77
78The OpenHarmony LiteOS-M kernel build system is a modular build system based on Generate Ninja (GN) and Ninja. It supports module-based configuration, tailoring, and assembling, and helps you build custom products. This document describes how to build a LiteOS-M project based on GN and Ninja. For details about the methods such as GCC+gn, IAR, and Keil MDK, visit the community websites.
79
80### Setting Up the Environment
81
82Before setting up the environment for a development board, you must set up the basic system environment for OpenHarmony first. The basic system environment includes the OpenHarmony build environment and development environment. For details, see [Setting Up Development Environment](https://gitee.com/openharmony/docs/blob/HEAD/en/device-dev/quick-start/quickstart-lite-env-setup.md).
83
84### Obtaining the OpenHarmony Source Code
85
86For details about how to obtain the source code, see [Source Code Acquisition](https://gitee.com/openharmony/docs/blob/HEAD/en/device-dev/get-code/sourcecode-acquire.md). This document assumes that the clone directory is `~/openHarmony` after the complete OpenHarmony repository code is obtained.
87
88### Example projects
89
90Qemu simulator: `arm_mps2_an386、esp32、riscv32_virt、SmartL_E802`. For details about how to compile and run, see [qemu guide](https://gitee.com/openharmony/device_qemu).
91
92Bestechnic: `bes2600`. For details about how to compile and run, see [Bestechnic developer guide](https://gitee.com/openharmony/device_soc_bestechnic).
93
94### Community Porting Project Links
95
96The LiteOS-M kernel porting projects for specific development boards are provided by community developers. The following provides the links to these projects. If you have porting projects for more development boards, you can provide your links to share your projects.
97
98- Cortex-M3:
99
100 - STM32F103 https://gitee.com/rtos_lover/stm32f103_simulator_keil
101
102 This repository provides the Keil project code for building the OpenHarmony LiteOS-M kernel based on the STM32F103 chip architecture. This code supports build in Keil MDK mode.
103
104- Cortex-M4:
105
106 - STM32F429IGTb https://gitee.com/harylee/stm32f429ig_firechallenger
107
108 This repository provides the project code for porting the OpenHarmony LiteOS-M kernel to support the STM32F429IGTb development board. The code supports build in Ninja, GCC, and IAR modes.
109
110- Cortex-M7:
111
112 - Nucleo-F767ZI https://gitee.com/harylee/nucleo_f767zi
113
114 This repository provides the project code for porting the OpenHarmony LiteOS-M kernel to support the Nucleo-F767ZI development board. The code supports build in Ninja, GCC, and IAR modes.
115
116## Contribution<a name="section1371123476307"></a>
117
118[How to involve](https://gitee.com/openharmony/docs/blob/HEAD/en/contribute/contribution.md)
119
120[Commit message spec](https://gitee.com/openharmony/kernel_liteos_m/wikis/Commit%20message%E8%A7%84%E8%8C%83)
121
122[Liteos-M kernel coding style guide](https://gitee.com/openharmony/kernel_liteos_m/wikis/OpenHarmony%E8%BD%BB%E5%86%85%E6%A0%B8%E7%BC%96%E7%A0%81%E8%A7%84%E8%8C%83)
123
124How to contribute a chip based on Liteos-M kernel:
125
126[ Board-Level Directory Specifications](https://gitee.com/openharmony/docs/blob/HEAD/en/device-dev/porting/porting-chip-board-overview.md)
127
128[Mini System SoC Porting Guide](https://gitee.com/openharmony/docs/blob/HEAD/en/device-dev/porting/porting-minichip.md)
129
130## Repositories Involved<a name="section1371113476307"></a>
131
132[Kernel Subsystem](https://gitee.com/openharmony/docs/blob/HEAD/en/readme/kernel-subsystem.md)
133
134[kernel\_liteos\_m](https://gitee.com/openharmony/kernel_liteos_m/blob/master/README.md)
135