Firefox OS 介紹
OutlineOverview體驗How to build
Requirements for LinuxSupported devicesEmulator
開發build systemboot processhardware module
市場的可能性結論參考資料
Overview
Firefox OS 是一個由 Mozilla 所主導的新移動作業系統,專案代號是 Boot to Gecko (B2G) 。和 Android 一樣,它也是用 Linux 的核心,然後開機到以 Gecko 引擎為基礎的環境裡,使用者可以在這個平台上執行完全以 HTML 、 JavaScript 和其他的開放網路應用程式介面所開發的應用程式。
體驗Mozilla 現在提供了一個最快的體驗方式,就是安裝 Firefox ,然後搭配 Firefox OS Simulator 這個附加元件就可以了。
體驗
體驗
How to build - Requirements
An installed 64 bit GNU/Linux distribution (we recommend Ubuntu 12.04). At least 4 GB of RAM/swap space. At least 20 GB of available hard disk space.
How to build - Requirements
需要預先安裝的套件基本上跟 Android 非常相似autoconf 2.13 bison bzip2 ccache curl flex gawk git gcc / g++ / g++-multilib (4.6.3 or older) make OpenGL headersX11 headers 32-bit ncurses 32-bit zlib yasm…
How to build – Supported devices
目前支援的裝置分為 3 個 Tier , Tier 1 是主力開發的部分, Tier 2 是比較多人使用,而 Tier 3 是不保證能順利運作的Tier 1: Unagi, Otoro, Pandaboard, Emulator (ARM/x86), Desktop (Firefox + addon )Tier 2: Samsung Nexus S, Samsung Nexus S 4GTier 3: Samsung Galaxy S2, Samsung Galaxy Nexus
How to build - Emulator
下載 Build systemgit clone git://github.com/mozilla-b2g/B2G.git
列出可支援的裝置: ./config.sh 要編譯 Emulator ,所以輸入 ./config.sh emulator-x86漫長的等待…
How to build - Emulator
sudo ln –s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.sosudo ln –s /usr/lib/i386-linux-gnu/libX11.so.6 /usr/lib/i386-linux-gnu/libX11.so編輯 gecko/nsprpub/pr/src/Makefile.in 將 133 行的 OS_LIBS += -lrt 註解掉。build system 基本上是採用 Android 的機制,輸入 ./build.sh ,這個 script 會載入必要的環境變數,並用 lunch 設置要編譯的 product ,然後開始編譯。又是一段漫長的過程。
How to build - Emulator
編譯完成以後,就可以輸入 ./run-emulator.sh模擬器跟 Android 一樣是使用 QEMU
開發 – build systemBuild system 基本上與 Android 一致,使用 lunch 來決定要編譯出哪個產品,這部分可以參考 config.sh 與 setup.sh 。主要的差異在於 gecko , gecko 是 Mozilla browser 的引擎,原來是用 C++ 開發,以 autoconf/automake 來編譯。因此這邊並不是以 Android.mk 來編譯,事實上這個檔案也是空的。應該要看的是 client.mk ,編譯時是在同層的 objdir-gecko 進行編譯。
開發 – boot process從 bootloader 到 kernel 到 init/init.rc ,這部分都跟 Android 相同。在 Android 的 init.rc 裡,原來是執行 zygote 的, Firefox OS 則是改為 b2g.sh
service b2g /system/bin/b2g.sh class main onrestart restart media
開發 – user space 架構
圖片取自 Mozilla developer 網站
開發 – Hardware moduleGraphics: Gecko -> GLES 2.0 + EGL -> screen Audio: 使用 Android 的 mediaserver像 sensor/陀螺儀…等走的路子是沿用 Android 的機制,也就是在 hardware 目錄下去修改。這裡有一份追蹤手機振動的文章,從 gaia 層 navigator.vibrate() 到 gecko/HAL ,寫的很清楚。 http://j.mp/UVG92M很大一部分都沿用自 Android
市場的可能性目前已經公開有合作的對象是大陸的 ZTE 中興移動,而通訊商是巴西的 Telefonica更多的消息可能在今年二月底於 Barcelona 舉辦的 MWC 被公布…
結論在架構與 Android 相去不遠的情況下,或許可以吸引系統組裝廠商投入這個 OS 市場。Firefox OS 提供了不少方便的工具,像是 rilproxy 等,或許可以拿來在 Android 開發環境下使用。 http://tech.mozilla.com.tw/posts/1231/hacking-firefox-os-emulator-for-ril
參考資料Mozilla Firefox OS謀智台客https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Architectureraspberry pi + firefox os http://eva-quirinius.blogspot.nl/2012/08/running-firefoxos-b2g-on-raspi-with.html
Recommended