HarmonyOS NEXT leak exposes the in-house kernel in the native HDC toolchain

Getting your Trinity Audio player ready...

A Chinese developer has confirmed that the kernel of the HarmonyOS NEXT system is indeed a new microkernel called “hmkernel”. However, an additional Linux compatibility module has been included to support Linux system calls on top. How does this work? The compatibility module within user mode in the system level of OpenHarmony. Similar to Fuchsia manages it’s OS layers with Starnix, Linux syscalls APIs inherited from the standard system that carries Linux kernel with POSIX compatibilities which POSIX itself, is also present in LiteOS kernel this structure of the system and kernel architecture makes it easy for developers to port rich applications and libraries to native pure HarmonyOS NEXT system for HarmonyOS platform. This has been explored in the leaked unfinished compiled Developer Preview 2 builds that showcases the pre-G2 curvature shown on canary builds of HarmonyOS NEXT Galaxy Edition on default OpenHarmony GUI build system of icons in the native HarmonyOS NEXT launcher system with the status bar.

Explained OpenHarmony User Mode and Kernel Mode at seaxiang.com:

The OpenHarmony kernel uses the musl libc library and supports standard POSIX interfaces, so developers can develop components and applications on top of the kernel based on the POSIX standard interfaces.

The musl libc library supports the POSIX standard, and the interfaces involved in system calls are adapted and supported by the OpenHarmony kernel to meet the functional requirements of the external description of the interfaces.

Explained via Difference Between User Mode and Kernel Mode at GeeksforGeeks.org:

User Mode: When a Program is booted up on an Operating system let’s say Windows, then it launches the program in user mode. When a user-mode program requests to run, a process and virtual address space (address space for that process) are created for it by Windows. User-mode programs are less privileged than user-mode applications and are not allowed to access the system resources directly. For instance, if an application under user mode wants to access system resources, it will have to first go through the Operating system kernel by using syscalls.  
Kernel Mode: The kernel is the core program on which all the other operating system components rely, it is used to access the hardware components and schedule which processes should run on a computer system and when, and it also manages the application software and hardware interaction. Hence it is the most privileged program, unlike other programs, it can directly interact with the hardware. When programs running under user mode need hardware access for example webcam, then first it has to go through the kernel by using a syscall, and to carry out these requests the CPU switches from user mode to kernel mode at the time of execution. After finally completing the execution of the process the CPU again switches back to the user mode.

Source: Weibo, HC Newsroom