On Dec. 31, 2020, HybridOS Device Side 1.0 (R2012-DS) was released.

Actual Shooting Running Effect

Before understanding the specific technical details, let's take a look at the actual shooting video below.

The following video shows the effect of HybridOS running on two SoC development boards that support Linux. On these two development boards, several hiWebKit-based applications and two hiACEJS-based lightweight JS applications are integrated (similar mini program application).

These two development boards are respectively provided by FMSoft's two chip partners, Allwinner and Rockchip:

1.   Allwinner R818 AXP305 development board, main hardware configuration:

  • Quad-core ARM Cortex-A53 CPU 1.6GHz with GPU.
  • DDR3 1GB
  • 16GB eMMC
  • Screen resolution: 800x1280 (landscape)

2.   Rockchip PX30 mini EVB development board, main hardware configuration:

  • Quad-core ARM Cortex-A35 CPU 1.3GHz with GPU.
  • DDR3 2GB
  • 16GB eMMC
  • Screen resolution: 1280x800 (portrait)

If you want to try to compile the HybridOS for the above development board, please read Actual Shooting: HybridOS Runs on Two Domestic SoC Development Boards. Attention, please modify r2011 or r2010 included in all download links in this article to r2012.

The Key Component

HybridOS R2012-DS includes the following key components for embedded or smart IoT devices.

Graphics Stack of HybridOS

HybridOS graphics stack is based on mature open source basic software, and provides software or hardware accelerated 2D/3D implementation, including the following software packages:

  1. hiDRMDrivers: This library contains MiniGUI's Linux-based DRM hardware-accelerated graphics engine-level application-level drivers. Currently, it provides support for Intel integrated graphics chipsets, such as i915 and i965.
  2. hiCairo: This is Cairo's HybridOS derivative. It adds support for the MiniGUI platform on top of Cairo's latest version.
  3. hiMesa: This is a derived version of Mesa for HybridOS. It mainly adds EGL implementation for MiniGUI platform. With the implementation of EGL for MiniGUI platform, we can easily integrate the 2D/3D graphics applications which are based on OpenGL, OpenGL ES, and OpenVG on HybridOS.

For details, please read the article Components of Graphics Stack for HybridOS Released for a detailed introduction.

The above code repository is released under the FMSoftCN account on GitHub (note to use minigui-backend branch):

  1. hiDRMDrivers: https://github.com/FMSoftCN/hidrmdrivers
  2. hiCairo: https://github.com/FMSoftCN/hicairo/tree/minigui-backend
  3. hiMesa: https://github.com/FMSoftCN/himesa/tree/minigui-backend

The existing licenses of these open source software are inherited. For example, hiCairo continues to use LGPL /MPL, hiMesa continues to use MIT license, etc.

MiniGUI 5.0

HybridOS uses MiniGUI as the underlying windowing system. MiniGUI 5.0 brings three brand-new features to support developers in developing applications with better visual and interactive effects:

1. Compositing Schema

It brings the possibility of providing various visual effects and novel interactive effects for the window system. Before this, most window systems use shared buffer schema to realize multi-window management by managing and maintaining the cascading relationship of windows and cutting between each other. The traditional shared buffer schema is difficult to achieve irregular windows, semi-transparent or fuzzy overlay effects in a multi-process environment, while the composite schema can easily solve these problems, and it can also facilitate the realization of animation effects when switching windows.

2. Eight main window Z-order levels

In MiniGUI 5.0, we enhanced the window manager of MiniGUI Core to support some special main window types. This enhancement allows us to create a special app which acts as screen lock, docker, or launcher.

3. Virtual Window

MiniGUI 5.0 enhanced the message processing module, and MiniGUI programs running in independent mode or multi-process mode can also transmit messages across threads. In addition, we also introduced the concept of virtual window.

A virtual window is a special window object which does not have a visible window area. But after you create a virtual window in a different thread, you can use the MiniGUI messaging mechanism to post or send messages between the current main window thread and the new thread.

This enhancement provides a very useful facility for application development based on MiniGUI to develop well-designed multithreaded applications.

In addition to the above three main enhancements, MiniGUI 5.0 has also adjusted some low-level architecture and reconstructed some low-level modules. For interest,please read A NEW MILESTONE OF MINIGUI: VERSION 5.0.0 RELEASED for detailed introduction.

To get and build MiniGUI 5.0, please access the following code repository:

https://gitlab.fmsoft.cn/VincentWei/build-minigui-5.0

or

https://github.com/VincentWei/build-minigui-5.0

hiBus

In HybridOS, an important design idea is always implemented: data-driven. Regardless of whether it is a single app scenario or multiple apps scenarios, hiBus will act as the link between HybridOS app and the underlying functional modules; and even in the future, it will become the link between different device nodes in the LAN.

Some ideas of hiBus come from OpenWRT's uBus, such as passing data in JSON format. But compared to uBus, hiBus has the following important improvements:

  • Two types of underlying connection channels are provided: local Unix Domain Socket and Web Socket, so that modules developed in different programming languages can be easily connected to hiBus.
  • Providing a basic security mechanism to determine whether an application or a remote node can subscribe to a specific event or call a specific procedure.
  • Considering that in the future, hiBus can provide services to other IoT device nodes in the local area network through Web Socket, we include host name information when subscribing to events and calling remote procedures.
  • The redesigned hiBus protocol can avoid deadlock when the same app plays different roles.

For hiBus protocol and server and client interface design documents (Chinese version), please visit the following URL:

https://github.com/FMSoftCN/hybridos/blob/master/docs/design/hybridos-data-bus-zh.md

Source code repository for hiBus:

https://github.com/FMSoftCN/hibus

hiShell

hiShell is the shell program of HybridOS's device-side management application life cycle, mainly composed of the following functional modules:

1. The mginit server process of MiniGUI. This process runs as a window manager, developed in C/C++, including the following modules:

  • Customized window compositor, used to provide special effects for starting and closing the main window, displaying the main window and switching between the front and the back.
  • Input method (available in future versions)

2. Live wallpaper process of MiniGUI. The process dynamically displays a static or dynamic screen background.

3. APP agent. The program is responsible for creating applications and managing the life cycle of applications, and at the same time creating and managing the following system main window:

  • One is used as the main window of Docker Bar, used to call out the main function (or launcher), system settings, etc.
  • A main window used as the Status Bar to display the title (and icon), time, and system power status of the currently active main window.
  • Other applications, such as lock screen, launcher, notifications, etc. (available in future versions).

For the design document of hishell (Chinese version), please visit the following link:

https://github.com/FMSoftCN/hybridos/blob/master/docs/design/hybridos-app-shell-zh.md

Source code repository for hiShell:

https://github.com/FMSoftCN/hishell

hiWebKit

hiWebKit is a derivative version of the well-known open source browser engine WebKit, which includes many extensions made by the HybridOS development team on the basis of existing HTML/CSS standards and specifications in the past year:

  1. Extensible support for complex widgets. This feature is equivalent to providing a lightweight plug-in mechanism for the browser. Developers can take advantage of this feature to develop complex widgets that meet their needs and avoid using solutions that have a serious impact on performance, such as traditional Netscape plug-ins.
  2. Introduce new tags and CSS properties to support the spinning wheel widget. Developers can use this feature to easily write wheel widgets for selecting time, administrative divisions, etc.
  3. Introduce new tags and CSS properties to support rotating meter widgets. Developers can use this feature to easily write an interface that can show rotating progress, such as a car dashboard.
  4. Binding mechanism of attributes or content between elements. By defining the binding relationship between HTML elements, the user agent automatically completes the synchronization of attributes or content between the bound elements. Developers can use this feature to create content between two elements without using JavaScript.
  5. Local dynamic generation technology of HTML content. Through the data mapping technology, the dynamic adjustment of the DOM tree by the user agent can be realized without script intervention. Developers can take advantage of this feature to directly generate HTML document content based on JSON data without using JavaScript scripts or background scripts.
  6. Extended schema (LSQL and RSQL protocols) for direct access to a SQL database. Developers can use this feature to directly use SQL statements to access local or remote SQL databases without the need to develop background scripts.
  7. Extended schema (LCMD protocol) for executing local system commands. Developers can use this feature to directly call a local command line program in the browser, and use its output as the input of the web page to generate page content in place, without the need for background scripts.

Please read hiWebKit, the Key Component of HybridOS, Released Yesterday for the detailed introduction about hiWebKit .

The technical details of these extensions and the benefits to developers are introduced in the album Technical Breakthroughs in HybridOS (Chinese Version). Interested readers can click to read.

Source code repository for hiWebKi:

https://hybridos.fmsoft.cn/downloads/r2012/hiwebkit-1.0.tar.xz

hiACEJS

Derived from ACELite of OpenHarmony, hiACEJS is a lightweight application framework for HybridOS.  The developer has another choice for fast development. The storage requirement for hiACEJS is less than 64M. Linux kernel, basic libraries for HybridOS are all inclusively, and spare space is for other applications, daemons and so on.

Of course, as a lightweight development framework, there is great difference between hiACEJS and hiWebkit, especially in graphics render capability and interface effects.  So hiACEJS is fit for IoT devices, which is cost-sensitive.

For details, please read hiACEJS, the Key Component of HybridOS Released for detailed introduction.

Source code repository for hiACEJS:

https://github.com/FMSoftCN/hiACEJS

It should be noted that hiACEJS can run independently on MiniGUI 3.2 and later versions.

Code Repository

To try HybridOS, please visit the code repository on GitHub of HybridOS (Please light up the stars in the HybridOS project repository kindly):

https://github.com/FMSoftCN/hybridos

And build the code of HybridOS for device side as described in the following README document:

https://github.com/FMSoftCN/hybridos/tree/master/device-side


Loading Conversation