b2g Introduction(Boot To Gecko)

来源:互联网 发布:淘宝卖男装 编辑:程序博客网 时间:2024/05/22 03:16


B2G是“Boot To Gecko”的缩写,是Mozilla公司基于Web标准开发的完全开放的移动操作系统,从系统本身到应用程序完全由HTML5、CSS和JS来写的。主要由3个部分组成,UI部分叫做Gaia,名字出自希腊语“大地”,也被称作“万物之母”;采用Mozilla引以为豪的Gecko引擎,Gecko就是上图中那只眼睛大大长的很萌的绿色小蜥蜴;底层部分叫做Gonk,名字来自一种在60年代盛行美国的毛绒玩具。


Gaia : The user interface of b2g. Everything drawn to screen after b2g starts up is some part of Gaia. Gaia implements a lock screen, home screen, telephone dialer, text-messaging application, camera app, ... and many more. Gaia is written entirely in HTML, CSS, and JavaScript. Its only interface to the underlying operating system is through Open Web APIs, which are implemented by Gecko. Gaia works well when run on top of b2g; however, since it only uses standard web APIs, it works on other OSes and in other web browsers (albeit with degraded functionality). Third-party applications can be installed alongside Gaia.

Gecko : The "application runtime" of b2g. At a high level, Gecko implements the open standards for HTML, CSS, and JS and makes those interfaces run well on all the OSes that Gecko supports. This means that Gecko consists of, among other things, a networking stack, graphics stack, layout engine, virtual machine (for JS), and porting layers.

Gonk : The lower-level "operating system" of b2g. Gonk consists of a linux kernel and userspace hardware abstraction layer (HAL). The kernel and several userspace libraries are common open-source projects: linux, libusb, bluez, etc. Some other parts of the HAL are shared with the android project: GPS, camera, among others. You could say that Gonk is an extremely simple linux distribution. Gonk is a porting target of Gecko; there is a port of Gecko to Gonk, just like there is a port of Gecko to OS X, and a port of Gecko to Android. Since the b2g project has full control over Gonk, we can expose interfaces to Gecko that aren't possible to expose on other OSes. For example, Gecko has direct access to the full telephony stack and display framebuffer on Gonk, but doesn't have this access on any other OS.

https://wiki.mozilla.org/B2G

https://wiki.mozilla.org/Main_Page