Dual-Engine Graphics Bridge & Isolated Bionic Sidecar
On modern ARM64 hardware, OpenHarmony userland links against Musl libc, whereas vendor GPU and hardware HAL libraries from Android BSPs link against Bionic libc. UniOHOS solves these two cases with separate, cleanly isolated mechanisms: in-process dual-TLS bridging for latency-critical graphics, and an isolated mount/linker namespace Sidecar for non-GPU hardware services.
1. Dual-Engine Graphics & In-Process TPIDR_EL0 GPU Bridge
The ARM64 Musl vs Bionic TLS Conflict
ARM64 Bionic GPU drivers (EGL, GLES, Vulkan) inline mrs xN, tpidr_el0 instructions to read thread-local storage directly from fixed Bionic Thread Control Block (TCB) slot offsets. Invoking a vendor GPU symbol directly from an OpenHarmony Musl thread immediately reads the wrong memory layout and crashes.
How UniOHOS/core/hybris-bridge Resolves It
- Dual-Engine Router:
- In Approach A (pure open-source OpenHarmony) or when vendor GPU libraries are absent/disabled, the router selects open-source Mesa 3D (
PanVK/Panfrostfor Arm Mali/Immortalis,Turnip/Zinkfor Qualcomm Adreno,RADV/ANV/Iris/llvmpipeon x86_64/PC). - In Approach B when local vendor GPU libraries are present on read-only
/vendor, the router dispatches through static ARM64 dual-TLS trampolines.
- In Approach A (pure open-source OpenHarmony) or when vendor GPU libraries are absent/disabled, the router selects open-source Mesa 3D (
- Static ARM64
bti cTrampolines (ZeroTEXTREL):- Trampoline entry points live in immutable
.textwith ARMv9bti clanding pads; target function pointers live in.data.rel.ro, ensuring zeroTEXTRELand full PAC/BTI security compatibility. - On each call boundary, the trampoline saves the thread's Musl
TPIDR_EL0, switchesTPIDR_EL0to a lazily initialized per-thread Bionic TCB, executes the underlying GPU symbol in-process, and restores MuslTPIDR_EL0before returning.
- Trampoline entry points live in immutable
- Zero-Copy Display Composition (
composer_vdi&buffer_vdi):- Both Mesa and bridged GPU backends allocate and pass native Linux
DMA-BUFhandles andsync_filefences directly tocomposer_vdi(DRM/KMS Atomic Modesetting) with zero framebuffer copies.
- Both Mesa and bridged GPU backends allocate and pass native Linux
2. Isolated Bionic Sidecar & Typed Cross-Namespace IPC
Non-GPU vendor hardware stacks — video codecs (VPU), neural accelerators (NPU), multi-camera ISP pipelines, audio DSPs, and cellular RIL — expect Android Bionic runtime conventions that must never pollute OpenHarmony's Musl root filesystem.
- Mount & Linker Namespace Isolation (
UniOHOS/core/sidecar-runtime):- Launches a dedicated minimal Bionic mount and linker namespace where
/vendorand/odmstay strictlyMS_RDONLYand modem/calibration partitions remainro,norecovery.
- Launches a dedicated minimal Bionic mount and linker namespace where
- Typed IPC & Zero-Copy FD Passing:
- OpenHarmony HDI/VDI frontends communicate with Sidecar backends over
SOCK_SEQPACKETUnix domain sockets (preserving message boundaries), authenticated viaSO_PEERCRED, and transferring video/camera/audioDMA-BUFdescriptors zero-copy overSCM_RIGHTS.
- OpenHarmony HDI/VDI frontends communicate with Sidecar backends over
- Incremental Open-Source Replacement:
- Because every subsystem sits behind an explicit IPC or VDI interface, any single subsystem (for example audio, VPU, or camera) can transition to a native open-source implementation independently without disturbing the rest of the system.
3. AnCo Container Engine (UniOHOS/core/anco-engine)
For workloads needing an Android compatibility container alongside OpenHarmony:
- Renders container surfaces into OpenHarmony
XComponentviewports with zero-copy buffer handoff. - Uses kernel
FUSE_PASSTHROUGHfor native-speed shared file I/O. - Suspends idle background container cgroups on screen-off via
cgroup.freezeso standby wakeups remain minimal.