HarmonyOS kernel

From WikiProjectMed
Jump to navigation Jump to search

HongMeng Kernel
DeveloperHuawei
Written inC, C++, Cangjie, Rust
OS familyHarmonyOS NEXT (OpenHarmony)
Working stateCurrent
Source modelClosed, with open source components
Initial releaseAugust 2023; 11 months ago (2023-08)
Latest preview1.9.0.B100 / June 21, 2024; 18 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 mentioned as Harmony kernel is the computer operating system (OS) kernel developed at Huawei since August 2023 for use in the HarmonyOS NEXT iterative versions of HarmonyOS proprietary operating system replacing previous versions of HarmonyOS with AOSP compatibility, Linux kernel and LiteOS kernel legacies.[1][2]

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.[3][4]

As of June 21, 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

References

  1. ^ Wu, Jessie (June 24, 2024). "Huawei's HarmonyOS NEXT breaks away from Android · TechNode". TechNode. Retrieved July 8, 2024.
  2. ^ Matsui, Emiko (January 19, 2024). "HarmonyOS NEXT is true operating system with self-developed components: Huawei CEO". Huawei Central. Retrieved July 8, 2024.
  3. ^ GOSIM Foundation (May 31, 2024). GOSIM 2024 Europe APP & WEB Jonathan Schwender: OpenHarmony for Next Gen Mobile. Retrieved July 8, 2024 – via YouTube.
  4. ^ "Building on OpenHarmony: Navigating its Architecture and App Development Framework | HackerNoon". hackernoon.com. Retrieved July 8, 2024.
  5. ^ Nick (April 16, 2024). "HarmonyOS NEXT leak exposes the in-house kernel in the native HDC toolchain". HarmonyOSHub. Retrieved July 8, 2024.
  6. ^ Kaur, Dashveenjit (June 26, 2024). "HarmonyOS NEXT: Huawei's bold move to challenge Apple and Android". Telecoms Tech News. Retrieved July 8, 2024.
  7. ^ "Huawei Claims They Have Something Better Than The Linux Kernel". It's FOSS News. January 22, 2024. Retrieved July 8, 2024.
  8. ^ Victor. "Huawei's HarmonyOS NEXT Beta launches officially". GSMArena.com. Retrieved July 8, 2024.
  9. ^ DARKNAVY (June 11, 2024). "AVSS Report: System Security Adversarial Capability Preliminary Evaluation of iOS, Android, and HarmonyOS - Kernel". DARKNAVY. Retrieved July 8, 2024.
  10. ^ "asplos24-slides/1-OH-Introduction-XYB.pdf at main · openharmony-research/asplos24-slides" (PDF). GitHub. Retrieved July 8, 2024.
  11. ^ "docs/en/OpenHarmony-Overview.md at master · openharmony/docs". GitHub. Retrieved July 8, 2024.

External links