Software:HarmonyOS kernel

From HandWiki
HongMeng Kernel
HMOS Logo Icon.svg
DeveloperHuawei
Written inC, C++, Cangjie, Rust
OS familyOpenHarmony
Working stateCurrent
Source modelClosed, with open source components
Initial releaseAugust 2023; 11 months ago (2023-08)
|Final preview|Latest preview}}1.9.0.B100 / June 21, 2024; 21 days ago (2024-06-21)
PlatformsCurrent: ARM64
Kernel typeMicrokernel
LicenseCommercial software, Proprietary software except for open-source components
Preceded byOpenHarmony ChCore (Monolithic) kernel, LiteOS (RTOS) kernel

HarmonyOS Kernel (HongMeng Kernel), sometimes referred to as the Harmony kernel, is a computer operating system (OS) kernel developed by Huawei since August 2023. It is used in the HarmonyOS NEXT version of the proprietary HarmonyOS operating system, replacing previous versions that utilized the AOSP compatibility layer, the Linux kernel, and the LiteOS kernel.[1][2]

The HarmonyOS Kernel utilizes a microkernel architecture, which aims to improve security and performance by isolating critical components of the system.

Kernel design

HarmonyOS NEXT Architecture

HarmonyOS kernel is a microkernel at rich executed environment level for software outside hardware-based HarmonyOS TEE kernel, called tee_OS, enabling greater modularity and larger portions of the OS to benefit from memory protection at kernel mode. While retaining the speed of monolithic mainline Linux kernel compatibility subsystem of modular OpenHarmony standard system within its kernel abstraction layer as compatibility layer with POSIX APIs and third-party musl-libc integrated support for bigger advanced devices for some critical tasks at user mode of HarmonyOS operating system commercial distro. The kernel has Linux ABI compatibility by placing an ABI-compatible shim in IC0 (kernel space), which redirects Linux system calls to IPC and serves as a central repository for global state. The kernel also reuses Linux drivers through driver containers, which balances between compatibility and critical path performance, while having control plane and data plane separation to improve performance. HarmonyOS kernel capabilities in context switching, network, application startup time, load, frame loss, interrupt latency, etc., and also performance optimised in smart routers and smart vehicles.[3][4]

(As of June 2024), HarmonyOS kernel runs on ARM64 devices on Developer Beta 1 version with current version 1.9.0.B100.[5]

HarmonyOS kernel objects used as carriers for data transmission during IPC communication. The capability system ensures only the capability to read from or write to kernel objects can receive or send messages through these objects. As a result, the content of messages has inability to insert malicious processes.[6]

HarmonyOS kernel adopts a microkernel architecture that reduces the kernel TCB (Trusted Code Base). Compared to traditional monolithic kernels such as Linux kernel,[7] the kernel code in HarmonyOS kernel is less than one-fourth in size, significantly reducing occurrence of vulnerabilities on the kernel.[8]

On HarmonyOS kernel, the HKIP module provides various protection mechanisms. Other than code, the read-only data, and kernel page table, other critical structures within the kernel are not protected by HKIP. The finer-grained kernel module isolation featured in HarmonyOS kernel, which divides kernel resources into multiple types, different types are managed by corresponding modules, and modules communicate with each other through the IPC mechanism, which has a better effect on multiple modules defense against attacks. Then it divides the permissions between modules in a fine-grained manner and communicates between modules through IPC, making it difficult for attackers to evolve the attack results of one module into the attack results of the entire system. HarmonyOS kernel loads the driver in user mode, making it difficult to trigger an attack against drivers to an attack against the kernel EL1 layer by strictly obtaining only EL0 permissions.

HarmonyOS kernel has file system protection in place, using different keys for different contexts to protect the confidentiality and integrity of code and data files, and key management with the Secure Enclave (TrustZone, security chip) isolated from the kernel. Manufacturers and system developers can use hardware security primitives alongside third-party to first-party chip designs provided by processors to achieve a higher level of security privileges than the kernel. Even after an attacker compromises the HarmonyOS kernel, the system relies on a hypervisor or secure monitor that is lower than the kernel and has a smaller TCB. The TrustZone and security chip, which are isolated from the rich executed environment REE kernel, ensures the security of users’ sensitive data.[9][10]

HarmonyOS kernel offers core capabilities and security benefits to the upper layers, including process and thread management, memory management, file system management, network management and Peripheral management. Alongside, HarmonyOS kernel, the integrated Hardware Driver Foundation (HDF) underpins an open hardware ecosystem for HarmonyOS. It standardizes peripheral device access and streamlines I/O driver development and management. Other layers of the multi-layered operating system of OpenHarmony-based HarmonyOS that sits on top of HarmonyOS kernel includes the middle System Service Layer where the system service layer provides essential services enabling the framework layer to support application functionalities. It consists of several subsystems such as the Basic System Capability Subsystem set ensures seamless distributed operation across OpenHarmony devices by handling, Distributed app execution, Scheduling and migration, Core capabilities like Distributed Soft Bus (DSoftBus) around the Distributed Virtual framework across devices with distributed data management, Distributed Scheduler, Utilities, multimodal input, graphics, security, and AI. Also, Basic Software Service Subsystem Set: These subsystems offer universal software services such as for Common events and notifications, Telephony services, Multimedia handling and Design For X (DFX). Then, Enhanced Software Service Subsystem Set where these subsystems deliver specialized software services tailored for various device types, including Smart TVs, Wearables, IoT devices, personal computers, smartphones, smart car displays and other types of devices. Hardware Service Subsystem set provides hardware-related services such as, Location services, Identity and Access Management (IAM) and Services specific to wearables and IoT devices. These subsystems within the basic software, enhanced software, and hardware service sets can be adapted and extended to fit the deployment scenarios of different device forms. The framework layer equips developers with tools to create HarmonyOS applications. It includes, Application framework and ability framework, supporting multiple programming languages (e.g., C, C++, JS), ArkUI framework for user interface development, Multi-language APIs for integrating hardware and software services. These APIs can be customized to meet the requirements of different system components and devices. This upper level layer houses both system and third-party applications. Each native HarmonyOS HAP app that are interoperability with OpenHarmony user mode, utilizes one or more types of abilities: such as Feature Abilities (FAs) Provide user interfaces for interactive functionalities and Particle Abilities (PAs): Operate without a user interface, focusing on background processes and data access. Applications leveraging FAs and PAs offer distinct service features and enable cross-device scheduling and distribution, ensuring a consistent and efficient user experience.[11]

See also

Further reading

  • Haibo, Chen Huawei Central Software Institute and Shanghai Jiao Tong University (21 June 2024), Microkernel Goes General:

Performance and Compatibility in the HongMeng Production Microkernel from the original on June 21, 2024. Retrieved July 10, 2024. [12]

References

  1. Wu, Jessie (2024-06-24). "Huawei's HarmonyOS NEXT breaks away from Android" (in en-US). https://technode.com/2024/06/24/huawei-unveils-harmonyos-next-beta-version-for-developers-breaking-away-from-android-dependency/. 
  2. Matsui, Emiko (2024-01-19). "HarmonyOS NEXT is a true operating system with self-developed components: Huawei CEO" (in en-US). https://www.huaweicentral.com/harmonyos-next-is-true-operating-system-with-self-developed-components-huawei-ceo/. 
  3. GOSIM Foundation (2024-05-31). GOSIM 2024 Europe APP & WEB Jonathan Schwender: OpenHarmony for Next Gen Mobile. Retrieved 2024-07-08 – via YouTube.
  4. "Building on OpenHarmony: Navigating its Architecture and App Development Framework | HackerNoon" (in en). https://hackernoon.com/building-on-openharmony-navigating-its-architecture-and-app-development-framework. 
  5. Nick (2024-04-16). "HarmonyOS NEXT leak exposes the in-house kernel in the native HDC toolchain" (in en-GB). https://harmonyoshub.com/harmonyos-next-leak-exposes-the-in-house-kernel-in-the-native-hdc-toolchain/. 
  6. Kaur, Dashveenjit (2024-06-26). "HarmonyOS NEXT: Huawei's bold move to challenge Apple and Android" (in en-GB). https://www.telecomstechnews.com/news/2024/jun/26/harmonyos-next-huawei-challenge-apple-android/. 
  7. "Huawei Claims They Have Something Better Than The Linux Kernel" (in en). 2024-01-22. https://news.itsfoss.com/huawei-harmonyos-linux-kernel/. 
  8. Victor. "Huawei's HarmonyOS NEXT Beta launches officially" (in en-US). https://www.gsmarena.com/huaweis_harmonyos_next_beta_launches_officially-news-63397.php. 
  9. DARKNAVY (2024-06-11). "AVSS Report: System Security Adversarial Capability Preliminary Evaluation of iOS, Android, and HarmonyOS - Kernel" (in en). https://www.darknavy.org/blog/avss_report_kernel/. 
  10. "asplos24-slides/1-OH-Introduction-XYB.pdf at main · openharmony-research/asplos24-slides" (in en). https://github.com/openharmony-research/asplos24-slides/blob/main/1-OH-Introduction-XYB.pdf. 
  11. "docs/en/OpenHarmony-Overview.md at master · openharmony/docs" (in en). https://github.com/openharmony/docs/blob/master/en/OpenHarmony-Overview.md. 
  12. Swett C, Jr; Jia, Ning; Wang, Nan; Li, Yu; Liu, Nian; Liu, Yutao; Wang, Fei; Huang, Qiang et al. (10 July 2024). "Microkernel Goes General: Performance and Compatibility in the HongMeng Production Microkernel". This Paper is Included in the Proceedings of the 18th USENIX Symposium on Operating Systems Design and Implementation.. https://www.usenix.org/system/files/osdi24-chen-haibo.pdf. Retrieved 10 July 2024. ;

External links

Template:Distributed operating systems