├── arch # Code of the kernel instruction architecture layer
│ ├── arm # Code of the ARM32 architecture
│ │ ├── arm9 # Code of the ARM9 architecture
│ │ ├── cortex-m3 # Code of the cortex-m3 architecture
│ │ ├── cortex-m33 # Code of the cortex-m33 architecture
│ │ ├── cortex-m4 # Code of the cortex-m4 architecture
│ │ ├── cortex-m7 # Code of the cortex-m7 architecture
│ │ └── include # Arm architecture public header file directory
│ ├── csky # Code of the csky architecture
│ │ └── v2 # Code of the csky v2 architecture
│ ├── include # APIs exposed externally
│ ├── risc-v # Code of the risc-v architecture
│ │ ├── nuclei # Code of the nuclei system technology risc-v architecture
│ │ └── riscv32 # Code of the risc-v architecture
│ └── xtensa # Code of the xtensa architecture
│ └── lx6 # Code of the lx6 xtensa architecture
├── components # Optional components
│ ├── backtrace # Backtrace support
│ ├── cppsupport # C++ support
│ ├── cpup # CPU percent (CPUP)
│ ├── dynlink # Dynamic loading and linking
│ ├── exchook # Exception hooks
│ ├── fs # File systems
│ ├── lmk # Low memory killer functions
│ ├── lms # Lite memory sanitizer functions
│ ├── net # Networking functions
│ ├── power # Power management
│ ├── shell # Shell function
│ ├── fs # File systems
│ └── trace # Trace tool
├── drivers # driver Kconfig
├── kal # Kernel abstraction layer
│ ├── cmsis # CMSIS API support
│ └── posix # POSIX API support
├── kernel # Minimum kernel function set
│ ├── include # APIs exposed externally
│ └── src # Source code of the minimum kernel function set
├── testsuites # Kernel testsuites
├── tools # Kernel tools
├── utils # Common directory
```
## Constraints<a name="section119744591305"></a>
OpenHarmony LiteOS-M supports only C and C++.
Applicable architecture: See the directory structure for the arch layer.
As for dynamic loading module, the shared library to be loaded needs signature verification or source restriction to ensure security.
## Usage<a name="section3732185231214"></a>
The 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.
### Setting Up the Environment
Before 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](../quick-start/quickstart-lite-env-setup.md).
### Obtaining the OpenHarmony Source Code
For details about how to obtain the source code, see [Source Code Acquisition](../get-code/sourcecode-acquire.md). This document assumes that the clone directory is `~/openHarmony` after the complete OpenHarmony repository code is obtained.
### Example projects
Qemu 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).
Bestechnic: `bes2600`. For details about how to compile and run, see [Bestechnic developer guide](https://gitee.com/openharmony/device_soc_bestechnic).
### Community Porting Project Links
The 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.
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.
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.
├── apps # User-space init and shell application programs
├── arch # System architecture, such as ARM
│ └── arm # Code for ARM architecture
├── bsd # Code of the driver and adaptation layer module related to the FreeBSD, such as the USB module
├── compat # Kernel API compatibility
│ └── posix # POSIX APIs
├── drivers # Kernel drivers
│ └── char # Character device
│ ├── mem # Driver for accessing physical input/output (I/O) devices
│ ├── quickstart # APIs for quick start of the system
│ ├── random # Driver for random number generators
│ └── video # Framework of the framebuffer driver
├── fs # File system module, which mainly derives from the NuttX open-source project
│ ├── fat # FAT file system
│ ├── jffs2 # JFFS2 file system
│ ├── include # Header files exposed externally
│ ├── nfs # NFS file system
│ ├── proc # proc file system
│ ├── ramfs # RAMFS file system
│ └── vfs # VFS layer
├── kernel # Kernel modules including the process, memory, and IPC modules
│ ├── base # Basic kernel modules including the scheduling and memory modules
│ ├── common # Common components used by the kernel
│ ├── extended # Extended kernel modules including the dynamic loading, vDSO, and LiteIPC modules
│ ├── include # Header files exposed externally
│ └── user # Init process loading
├── lib # Kernel library
├── net # Network module, which mainly derives from the lwIP open-source project
├── platform # Code for supporting different systems on a chip (SOCs), such as Hi3516D V300
│ ├── hw # Logic code related to clocks and interrupts
│ ├── include # Header files exposed externally
│ └── uart # Logic code related to the serial port
├── platform # Code for supporting different systems on a chip (SOCs), such as Hi3516D V300
├── security # Code related to security features, including process permission management and virtual ID mapping management
├── syscall # System calling
└── tools # Building tools as well as related configuration and code
```
## Constraints<a name="section119744591305"></a>
- Programming languages: C and C++
- Applicable development boards: Hi3516D V300
- Hi3516D V300 uses the FAT file system by default.
## Usage<a name="section741617511812"></a>
OpenHarmony LiteOS Cortex-A supports the [Hi3516D V300](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-introduction-hi3516.md). You can develop and run your applications based on this development board.
You need to set up the compilation environment on Linux.
-[Setting Up Ubuntu Development Environment](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-env-setup.md)
- For Hi3516D V300, see [Setting Up the Hi3516 Development Environment](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-steps-hi3516-setting.md).
Download and decompress a set of source code on a Linux server to acquire the [source code](https://gitee.com/openharmony/docs/blob/master/en/device-dev/get-code/sourcecode-acquire.md).
### Compilation and Building<a name="section2081013992812"></a>
For details about how to develop the first application, see:
-[Developing the First Example Program Running on Hi3516](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-steps-hi3516-running.md)