[RFC] Add support for OpenHarmony OS

Hi all,

We would like to contribute a new triples for the operational system OpenHarmony [1].

arm-liteos-ohos
arm-linux-ohos
riscv64-linux-ohos
aarch64-linux-ohos

OpenHarmony is an open-source project incubated and operated by the OpenAtom Foundation. It is an open-source operating system with a framework and platform applicable to smart devices in all scenarios of a fully-connected world. It aims to promote the development of the Internet of Everything (IoE).

OpenHarmony supports the following types:

  • Mini system

A mini system runs on the devices whose memory is greater than or equal to 128 KiB and that are equipped with MCU processors such as Arm Cortex-M and 32-bit RISC-V. This system provides multiple lightweight network protocols and graphics frameworks, and a wide range of read/write components for the IoT bus. Typical products include connection modules, sensors, and wearables for smart home.

  • Small system

A small system runs on the devices whose memory is greater than or equal to 1 MiB and that are equipped with application processors such as Arm Cortex-A. This system provides higher security capabilities, standard graphics frameworks, and video encoding and decoding capabilities. Typical products include smart home IP cameras, electronic cat eyes, routers, and event data recorders (EDRs) for smart travel.

  • Standard system

A standard system runs on the devices whose memory is greater than or equal to 128 MiB and that are equipped with application processors such as Arm Cortex-A. This system provides a complete application framework supporting the enhanced interaction, 3D GPU, hardware composer, diverse components, and rich animations. This system applies to high-end refrigerator displays.

For more technical details please refer [2]

The patch required for OpenHarmony triples support:

https://reviews.llvm.org/D138202

We are actively developing the OS support, and have other triples and many other changes in mind.

This OS is already used on a real world devices like [3,4] etc

Please leave code comments on the Phab patch, while discussing high-level comments about the triples and operational system on this thread.

  1. GitHub - openharmony/docs: OpenHarmony documentation | OpenHarmony开发者文档
  2. docs/OpenHarmony-Overview.md at master · openharmony/docs · GitHub
  3. https://support.hkvstar.com/file/Hi3516D.pdf
  4. 生态市场 - 应用软件_服务市场_建站_应用开发_众包平台-华为开发者联盟

If somebody has some questions about the topic, or concerns, or just commentaries, please do not hesitate to share them. :slightly_smiling_face:

I’m no expert on triples, and they aren’t the most logical of things to begin with. That said…

Why do the triples include linux when this OpenHarmony is an OS unto itself? Or is that because OpenHarmony can be run run on top of a Linux base? It looks like sometimes you’re putting the OS name in the place where the ABI would go.

From your patch:

  T = Triple("arm-unknown-linux-ohos");
  T = Triple("arm-unknown-liteos");

An Arm Linux triple would be something like arm-uknown-linux-gnueabihf. Where gnueabihf is the ABI. Would that mean arm-unknown-linux-ohos is Linux with an ohos ABI?
(perhaps that last part isn’t always an ABI, but for 32 bit Arm it usually is)

The liteos triple makes more sense to me.

Another example is arm-unknown-freebsd10.0. Presumably the ABI for this is set to some default value. I would expect something of that form for OpenHarmony.

Triples I’m used to are <architecture>-<vendor>-<operating system>-<ABI>. I’m sure one could find exceptions though.

Hi!

Why do the triples include linux when this OpenHarmony is an OS unto itself?
Would that mean arm-unknown-linux-ohos is Linux with an ohos ABI?

OpenHarmony is an operating system which uses modified version of Linux kernel, custom abi, etc. In LLVM same approach is used for Android


The liteos triple makes more sense to me.

I just want to add some notes about LiteOS - it is a lightweight kernel which is used for running OpenHarmony on IoT devices, details can be found here:

Yeah now I look I see hundreds of them.

I understand now, the linux in the triples I’m used to seeing is Linux Kernel plus the expected “linux” userspace so they don’t have linux-linux there.

It is a bit unfortunate that the kernel name includes “OS” but I see what you mean.

arm-liteos-ohos - OpenHarmony on the LiteOS kernel on Arm
arm-linux-ohos - OpenHarmony on the Linux kernel on Arm

Makes sense to me now!

arm-liteos-ohos - OpenHarmony on the LiteOS kernel on Arm
arm-linux-ohos - OpenHarmony on the Linux kernel on Arm

Yes, you are completely correct :slightly_smiling_face: