同步操作将从 OpenHarmony/docs 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
The chip architecture adaptation process is optional. If the particular chip architecture is supported in the liteos_m/kernel/arch directory, you can directly implement the board adaptation. Otherwise, chip architecture porting is required.
The kernel used by module chips is LiteOS Cortex-M, which consists of four modules, namely kernel abstraction layer (KAL), components, kernel, and utils.
KAL: provides APIs exposed externally and depends on the components and kernel modules.
Components: is pluggable and relies on the kernel module.
Kernel: stores hardware-related code in the arch directory and other code. The implementation of kernel function sets (such as task and sem), for example, task context switching and atomic operations, depends on the hardware-related code in the arch directory.
Utils: functions as a basic code block where other modules rely.
Figure 1 Architecture of the LiteOS Cortex-M kernel
The directory structure of the kernel is described as follows:
.
├── components --- Components available for porting and header files exposed externally
├── kal --- APIs exposed externally, including CMSIS APIs and part of POSIX APIs
├── kernel --- Code for defining the minimum kernel function set
│ ├── arch --- Code of the kernel instruction architecture layer
│ │ ├── arm --- Code of the ARM32 architecture
│ │ │ ├── cortex-m3 --- Code of the Cortex-M3 architecture
│ │ │ │ ├── iar --- Implementation of the IAR toolchain
│ │ │ │ ├── keil --- Implementation of the Keil toolchain
│ │ │ │ └── xxx --- Implementation of the particular toolchain
│ │ │ └── cortex-m4 --- Code of the Cortex-M4 architecture
│ │ │ ├── iar --- Implementation of the IAR toolchain
│ │ │ ├── keil --- Implementation of the Keil toolchain
│ │ │ └── xxx --- Implementation of the particular toolchain
│ │ ├── include --- Header files that declare the APIs required, kernel-independent
│ │ └── risc-v --- RISK_V architecture
│ │ └── gcc --- Implementation of the IAR toolchain
│ ├── include --- Code for defining the minimum kernel function set
│ └── src --- Code for implementing the minimum kernel function set
└──utils --- Basic code
As shown in the Directory Specifications, the arch/include directory defines the functions that need to be implemented on the common chip architecture. The code related to the chip architecture contains assembly code, which varies based on building toolchains. Therefore, the code for adapting to different toolchains (for example, IAR, Keil, GCC, etc.) must be implemented in a specific chip architecture.
The arch/include directory defines common files and functions. All functions in this directory need to be implemented to adapt to a newly added architecture. For details, refer to the following header files.
los_arch.h --- Defines the functions required for initializing the chip architecture.
los_atomic.h --- Defines the atomic operation functions required by the chip architecture.
los_context.h --- Defines the context functions required by the chip architecture.
los_interrupt.h --- Defines the interrupt and exception functions required by the chip architecture.
los_timer.h --- Defines the timer functions required by the chip architecture.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。