Firefox OS architecture analysis (1)

Source: Internet
Author: User
Tags home screen

Reprinted from http://www.lupaworld.com/article-219681-1.html

This site reported the Mozilla B2G system for the first time 10 months ago. Now it has grown into Firefox OS, and it's time to look at its architecture.

This document was originated from the official B2G wiki page and skipped the sample code section. For ease of understanding, some of the descriptions will be compared with the current popular Android operating system.

Goddess, Gecko and doll


In terms of architecture, Firefox OS has three layers:

Gaia (Goddess of the Earth):Firefox OS user interface, Including all the parts that users can see after the boot, such as screen lock, home screen, app starters, Dialers, text messages, cameras, and so on. Gaia is fully written in HTML, CSS, and JavaScript and becomes a standard
The interface of the web API is associated with the underlying device. Therefore, Gaia can run on any device that implements Web APIs, such as a desktop browser. Third-party programs on Firefox OS run in a similar way and coexist with Gaia.

Gecko):Runtime Environment of Firefox OS applicationsUsing C ++ (I don't know if it will be switched to rust later ).
Web APIs are used by applications including Gaia and can be run on the target hardware platform of Firefox OS. Therefore, Gecko includes the necessary network layer, image layer, layout management, JavaScript virtual machine, and porting layer.

Gonk):Underlying operating system of Firefox OSIt is also a target porting platform of Gecko, including the Linux kernel and the user State Hardware Abstraction Layer. This part shares many components and drivers with Android and embedded Linux, such as bluez and libusb. It is a target porting platform because Gecko
In theory, the abstraction layer can also run on Android or desktop operating systems. However, because the Firefox OS project leads gonk development, it can provide interfaces not available on other systems for gecko, for example, the complete telephone communication layer.

Light, signal and Origin


Like most Android phones, Firefox OS pre-installed phones will first be minimized after startup.bootloaderImplement the initial boot operation, then chain the boot loader to a higher level and more complex, and finally implement kernel loading. How is the process related to the device manufacturer? The corresponding bootloader operations are likely to be reused by various manufacturers.
PrivatefastbootProtocol implementation. This means that you only need to adjust the pilot used by Firefox OS as needed,There is no technical obstacle in using existing Flash tools on Android phones to fl Firefox OS.

Because the embedded field is still relatively closed, this process may also loadDevice-related private Modem firmware. At this level, Firefox OS and Android are not open.

The next story is the Linux kernel loading and PID 1.initThe process is generated, which is not much different from the initialization of General Embedded Linux. The Linux Kernel used here will be followed by the upstream, but it will also attract manufacturers to use android
Some unmerged device Code submitted by the open source project. After the kernel is loaded, most devices accesssysfsFor user State programs to access.

Crawling animal age


Here,b2gThe INIT process is activated as the main system process and communicates with other processes responsible for functions such as network and radio through RPC or socket. In addition,b2gWill also passdbus-daemonAnd
Ipdl implements communication between user-mode processes.

Users who have used any modern Desktop Linux release are familiar with it. Recently, systemd has been merged into it, but it can still be run independently. Ipdl isMozilla
Unique inter-process communication protocol Definition Language
Allows secure and organized message transmission between C ++ processes. Runninglibxul.soOfb2gThe process will start a seriesContent sub-processThe upper-layer Webpage Programs and other webpage content will run in the independent content sub-process, technically and now
The processing of tabs in Firefox is similar.

In the face of multimedia files, Gecko provides Ogg Vorbis Audio, Ogg theora video, and webm video.Open format will provide native supportIt is also entirely possible to introduce opus support for WebRTC in the future official release. The private format accesses the private decoder and implements hardware acceleration through libstagefright.

Feeling, expression, and tail


Gecko is responsible for parsing various input events from gonk into DOM events available for standard web applications, including buttons, touch screen operations, etc., derived from the standard Linux input device input-device. These Dom APIs from gecko are composed of external function interfaces and object models between C ++ and JavaScript, using the common rules of IDL.

Network Communication is deliveredwpasupplicantAnd rIL (radio interface layer. Like the Desktop Linux release, WPASupplicant is responsible for access in the WiFi environment, and gecko developed a subsidiaryWifiWorker.jsFor Webpage Programs
WiFi connection status. RIL is responsible for communication over the wide area network, and is responsible for communication with the modulation and demodulation components.rildProbably the private code from the manufacturer,rildproxyIt is an intermediate proxy set for security consideration and serves as a linkrildAndb2g. Similarlyril_worker.jsThe exposure status and operation interface are used by upper-layer programs.

Similar to Android 4.0 +,Gecko uses OpenGL ES 2.0 to implement hybrid. Gecko draws areas of the page into the memory buffer, and then calls the OpenGL command to mix and render the content on the screen. Compared with the early software mix implemented by Android with skia, firebox OS was dependent on GPU rendering capability from the very beginning, and its effect is worth looking forward.

The bottom layer of gecko is the transplantation layer responsible for interacting with the target system. This section contains the platform-related code (such as gonk, Android, and OS X) for different target systems, and unifies the code into C ++ APIs available for the upper-layer subsystems of Gecko.

More content coming soon

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.