Feature Articles

Deep dive: Is Huawei’s HarmonyOS the one OS to rule them all?

By Zachary Chan - 1 Sep 2019

HarmonyOS

Ever since the US trade ban news surfaced back in May, there has been a flurry of activity surrounding Huawei and their future in the smartphone business; chief amongst them being possibility of being cut off from Google services. From there, we’ve seen conflicting rumours and reports about Huawei building their own OS, but nobody seemed to be able to confirm anything about it, from its name (Hong Meng, Ark, Oak), to its readiness (readynot ready, and more flip-flopping), or even what it’s used for (Android replacement; not designed for phones). As you can see, it's been a real juicy few months of reporting. But, whatever it is, it hasn't seemed to stop Huawei from selling phones or launching more phones (Nova 5T, Mate 30).

Source: Huawei

It was only during the Huawei Developer Conference earlier this month that more concrete facts about Huawei's OS surfaced. Huawei officially unveiled the HarmonyOS for smart devices, the first of which would be an Honor Vision TV. In the past week, I've also had the opportunity to sit down with James Lu, a Senior Manager for EMUI Product Marketing and previous Head of AI Product Management at Huawei to talk about HarmonyOS.

Now, developing an independent device operating system isn’t that far-fetched an idea. For example, Samsung’s smartphones may run Google Android, but all of their other smart devices, from smartwatches to TVs and home appliances actually run on Samsung’s own Tizen OS. Today, you can even find Tizen in cars.

Source: Huawei

The development journey of HarmonyOS is very much similar to Tizen. Huawei realised that as their smart devices ecosystem grew, they needed an operating system they could use to control and manage these devices more effectively.  Things like headphones, activity trackers, smart scales and other IoT devices do not need to run apps or be overly complicated. According to Huawei, Android has grown too large, with over 100 million lines of code, to effectively adapt for such devices, and that’s where HarmonyOS comes in.

 

What is HarmonyOS?

Huawei’s official description is “A microkernel-based distributed OS for all scenarios”.

 

What is a "microkernel-based distributed OS"?

To unpack that sentence into something more palatable, a microkernel is a very small and lightweight core of the OS that contains just the bare minimum to support any one particular function you’d normally expect from a device. So, each function, such as audio, or camera, or display is its own microkernel. How finely segmented each of these functions are, is also determined by the developer. For instance, audio can be further split into speaker and mic microkernels.

A distributed OS is then the sum of all these microkernels that form together—like Voltron—to make up the full functionality of any particular device. This allows Huawei to scale HarmonyOS from kB to GB in size and complexity as the device it’s running on requires. For example, a Bluetooth speaker has no need to run any display or camera code, so only the speaker, mic and connectivity microkernels need to be used.

Source: Huawei

HarmonyOS also supports distributed hardware virtualisation. Basically, this means that apps that run on HarmonyOS can tap into all the different hardware that’s connected on the network as one big virtual pool. So if an app needs a display, a mic, a speaker, and a camera, it can choose from any device in the pool that has those functionalities.

Source: Huawei

This is like how you can stream YouTube from your phone, but you’re casting the display to your TV, while playing the audio from a connected Bluetooth speaker, except theoretically on HarmonyOS, what you can connect to and what function the can be virtualised is unlimited. Huawei claims that the lightweight, distributed architecture of HarmonyOS allows it run faster, with lower latencies and higher throughput than classic monolithic kernel designs. 

Source: Huawei

Source: Huawei

 

Unified app development

Because of its highly virtualised environment that supports such a diverse hardware mix, HarmonyOS will have a single unified software development kit. Supposedly, app developers only need to create one version of an app that can be deployed on multiple devices: TV, car dashboard, smartphone or smartwatch. The app can detect which device is running it and choose the best widgets and layout for it. In comparison, developers have to create three separate apps for Apple iOS, watchOS and tvOS.

Source: Huawei

Source: Huawei

HarmonyOS’ compiler, call the ARK Compiler, will also support unified compilation of multiple programming languages (C/C++, Java, JS, Kotlin, etc.) into a unified runtime.

Source: Huawei

 

Smaller code, better security?

Another aspect of HarmonyOS’ microkernel design is its supposed enhanced security.

Let’s look at the slide below, which basically shows how many modern smartphones are segmented today. The main OS kernel, in this case Android (which is based on Linux runs in an open zone known as REE (Rich Execution Environment). Then there is also a secure zone called TEE (Trusted Execution Environment) that runs on its own TEE OS that is completely separated from the REE zone. Examples of this include Android Trusty OS, Samsung Knox and Huawei iTrustee OS.

Source: Huawei

From the slide, it would seem that the HarmonyOS microkernel will sit within the TEE, making the entire OS secure. Not only that, Huawei will be using Formal Verification for even higher security, and this is only possible due to the smaller microkernel design, which has less code. And because the microkernels are modular, Huawei claims that devices that incorporate any HarmonyOS components will inherently become more secure overall.

Source: Huawei

 

The road to HarmonyOS

So, where are we now and what can we expect from HarmonyOS?

Huawei will be releasing HarmonyOS as an open-source project, so anyone can pick it up to use; and because of its microkernel design, incorporate only the parts of it they need into their existing software and devices. As you can see from the slide below, even Huawei is following this path. While the eventual goal is to have a full HarmonyOS kernel that runs everything, current devices will only have parts of it, while still utilizing traditional Linux (Android).

Source: Huawei

And thus we come to the big tl;dr question. Is HarmonyOS an Android replacement? 

No, because that vision is too narrow. HarmonyOS was not designed specifically to be a smartphone OS to replace Android. It’s a scalable OS that should, theoretically work on any device, from IoT sensors to TVs.

Yes, because when push comes to shove, it can be used for smartphones. However, the big caveat here is that then it’s not really about the OS anymore, but apps. Even by Huawei's own roadmap, it will be at least 2020 before their app development IDE is ready for mass deployment. And that’s why it’s in the best interest for Huawei to keep using Android for as long as they can while building up the HarmonyOS ecosystem. 

Source: Huawei