Architecture Overview
UniOHOS uses a modular, cross-platform architecture to run OpenHarmony userland on ARM64 and x86_64 devices while preserving strict license boundaries, avoiding proprietary binary hosting, and supporting both open-source drivers (Approach A) and local read-only firmware reuse (Approach B).
1. Layered System & Dual-Organization Boundary
Why Two Organizations and Four Layers?
- Cross-Silicon Core (
UniOHOS/core,recovery,builder,gki-sdk,devices):- Houses silicon-independent C/C++/ArkTS runtime code, graphical recovery core, build schema, and GKI verification tools.
- Device repositories never copy files from
UniOHOS/*; they declare minimum compatibility versions (compatibility.core_min_version,builder_min_version) indevice.yaml.
- Per-Silicon Hardware Adaptation (
UniOHOS-Devices/<vendor>-<soc>-bsp,Apache-2.0):- Shared silicon adapters live once under
common/(display-vdi,gpu-hdr-opencl,vpu-bridge,npu-bridge,camera-daemon,ril-bridge,audio-bt-dac,power-typec,peripherals,security-fingerprint,perf-standby,recovery-platform). - Board-level differences (panel geometry, speaker amps, modem presence, sensor lists) live under
profiles/<vendor>/<codename>/onmainwithout per-device Git forks.
- Shared silicon adapters live once under
- Linux Kernel UAPI Boundary (
Linux-syscall-note):- All userland components (
Apache-2.0/MIT) interact with the Linux kernel (GPL-2.0-only) strictly through standard kernel UAPI interfaces (ioctl, DRM/KMS,DMA-BUF,sysfs,procfs,netlink).
- All userland components (
- Pure-Source Kernel & DeviceTree (
UniOHOS-Devices/<vendor>-<soc>-kernel,GPL-2.0-only):- Stores only OpenHarmony / HarmonyOS kernel patches, incremental pure-text
.dts/.dtsi/.asloverlays, defconfig fragments, and open-source out-of-tree.koC sources.
- Stores only OpenHarmony / HarmonyOS kernel patches, incremental pure-text
- Optional Multi-License Plugins (
UniOHOS/plugin):- Independent feature plugins with copyleft or mixed upstream licenses (such as
cb1-hdrunderGPL-2.0-or-later) live underplugins/<id>/via repository-level mere aggregation (GPLv2 Section 2), without statically linking intoUniOHOS/coreor*-bsp.
- Independent feature plugins with copyleft or mixed upstream licenses (such as
2. Architecture Deep Dives
Explore each subsystem in detail:
| Topic | Key Components Covered | Page |
|---|---|---|
| Boot Chain & Storage | Stage-1 PID1 (early-bringup), misc+0x1000, usb-udc-guard, super/dm-linear, switch_root, 64KB PTE_CONT EROFS, F2FS HMFS ioctl | Boot Chain & Storage |
| Graphics & Sidecar | ARM64 TPIDR_EL0 static bti c GPU bridge, Mesa PanVK/Turnip fallback, composer_vdi/buffer_vdi, isolated Bionic Sidecar IPC, AnCo | Graphics Bridge & Sidecar |
| Security & Standby Power | SELinux Day-0 / staged Enforcing=1, neverallow == 0, hardware Fail-Closed, epoll/netlink daemons, cgroup.freeze, deep sleep | Security, SELinux & Standby |
| Recovery & Plugins | UniOHOS/recovery LVGL v9.2 core vs recovery-platform, external f2fs-tools, UniOHOS/plugin mere aggregation vs runtime license rules | Recovery & Plugin Isolation |
3. Reference Validation Scope
Current real-hardware verification across the full stack has been conducted primarily on Xiaomi 15S Pro (dijun / Xiaomi XRING O1, Stage 3), with Huawei Qingyun L420x (qingyun-l420x / HiSilicon Kirin 9000C, Stage 1) bootstrapped as the first PC/laptop target. Cross-device generalization PRs and additional SoC test reports are tracked in UniOHOS/core and UniOHOS/devices.