Quote from: Wonder Egg Plant on March 07, 2021, 12:52:21
I want an opinion from a Linux developer on this matter. I'm tired of Huawei fanboys and haters endlessly arguing over a topic neither of them have any clue what they are talking about and echo chambering their respective opinions without taking in knowledges from neutral outsiders. So someone, who has a real experience with developing an OS, please tell me, how does Harmony exactly work? Is it different from Android, and if so, how different are they? Is Ars Technica's report valid or is it inaccurate in some ways? How correct is Huawei's claim? Thanks in advance.
All right, I might be the person you're looking for. The biggest problem lying here is that Huawei gave us such vague descriptions about this OS that we ended up thinking what they are planning to provide their customers in the future is what they can provide them now, causing misconceptions and a lot of criticisms. In my opinion they definitely deserve it because they
really did poorly document it and avoid any kind of detailed explanations just to keep up the hype.
Before further reading, take a look at this slide they used during the presentation.
o.aolcdn.com/images/dimse/5845cadfecd996e0372f/9d527c680ccfb7738c722a5a06702b52e768a629/cmVzaXplPTIwMDAlMkMyMDAwJTJDc2hyaW5rJmltYWdlX3VyaT1odHRwcyUzQSUyRiUyRnMueWltZy5jb20lMkZvcyUyRmNyZWF0ci11cGxvYWRlZC1pbWFnZXMlMkYyMDE5LTA4JTJGNmE2OWM2ZjAtYmE4My0xMWU5LWIxZmYtZjEwYTg1YjBlZDM2JmNsaWVudD1hMWFjYWMzZTFiMzI5MDkxN2Q5MiZzaWduYXR1cmU9OTZlZTliOWI1ZjJjYjhkZjkxMmU4YzM3YzJlNzA4Zjk3OTc1ZmYzMg==
So what is Harmony OS? It's a microkernel based distributed OS...
except it's not, depending on how you implement it, at least for now. Surprised, right?
Harmony OS is capable of running on different kernels, and Huawei's marketing slide indeed shows Linux kernel, LiteOS kernel and HarmonyOS kernel placed alongside each other at the bottom left of the diagram. But as one person already mentioned below, Linux uses a monolithic kernel, hence if you use Linux kernel then the OS can no longer be called microkernel-based. What is happening here?
The answer is simple. HarmonyOS is only microkernel based
when you choose to use HarmonyOS kernel, which is
not Linux based.
Right under the system service layer, they use the abstraction layer to provide the service layer kernel capabilities, while shielding a difference in kernel implementation. This ensures that the upper layer of the OS will not be affected by whether the kernel is monolithic (Linux, LiteOS) or micro (HarmonyOS), but at the same time it indicates they made the "box" in the way that
*Linux/LiteOS kernel* and
*HarmonyOS microkernel + basic service layer that runs on top of it* would behave in a very similar way, effectively negating the advantage of microkernel architecture. The reason why they are forced to do this might be to attract people - not all parties interested in trying it out have a capability to develop the entirely different system optimised for the brand new kernel, so most probably Huawei included an option for them to use conventional Linux kernel that can run their old system without changing up its code significantly, just in a different container, then make a slow transition to HarmonyOS kernel whenever they feel ready for it.
The right hand side of the diagram shows Huawei's future visions on their new OS. There's no Linux nor LiteOS kernels at the bottom this time around, only HarmonyOS microkernel sitting there alone. Above it there are separate components that says "File system", "Power management", "RAM management", "Device driver". This is what Huawei
wants Harmony to become - no Linux kernel, no KAL, just their own microkernel being the base of the OS and everything above being freely configurable by the system developers at their own wills. But they are clearly not there yet at this point of time.
Now let's return to the Ars Technica article. Is HarmonyOS Android? Well, no, obviously.
But is Huawei's own specific implementation of HarmonyOS for mobile phones significantly different from AndroidOS? Actually we don't know because there is no way for you to tell from that article that the HarmonyOS beta emulator they used runs on Android kernel or HarmonyOS kernel. If the former is the case then the answer would be no because it's essentially Android but in a differently shaped box with a different compiler and a runtime library, otherwise it would be yes. If Anbox or WSL exist, then of course there's a possibility that Android subsystem could run on HarmonyOS as well.
Finally remember, nothing is factually proved,
including Huawei's own claims, until Huawei seeds the stable version of the HarmonyOS to their existing phones and devs take it apart on their real devices. All we can do, for now, is to wait until that happens. Probably xda will find out something if there is anything interesting, but we never know if it would be a good news or a bad one.