Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

FirefoxOS and its use of Linux (a deep dive into Gonk architecture)

9,216 views

Published on

Talk given at LinuxCon America in Chicago 2014 about FireFoxOS and its use of Linux Kernel

Published in: Internet

FirefoxOS and its use of Linux (a deep dive into Gonk architecture)

  1. 1. FireFoxOS and its use of Linux Aimee Maree Forsstrom mozillians.org/en-US/u/aimeemaree aimeemaree.info @aimee_maree
  2. 2. What is FireFoxOS Mobile Operating System developed by Mozilla to power mobile devices Utilises Linux, Android and Gecko (FireFox browser engine)
  3. 3. FireFoxOS Architecture Layers
  4. 4. Gaia User interface application for Firefox OS devices Web application running atop Firefox OS Comes with some standard applications Isolated from Gonk communicates through Gecko
  5. 5. Gecko Application run time Collection of API's for hardware access Renders Web Content ACLs and permissions are controlled in Gecko
  6. 6. Gonk Linux Kernel Device Drivers Hardware Abstraction Layer Isolated from Gaia Communicates through Gecko/B2G Magic Black Box
  7. 7. Lets dive deeper into Gonk
  8. 8. How Gonk handles a request
  9. 9. How the layers communicate
  10. 10. HAL http://mxr.mozilla.org/mozilla-central/source/hal/ Not exposed directly to JavaScript code C++ API accessible to higher levels of Gecko Gecko communicates with Gonk directly through the HAL This communication is run in a sandbox environment
  11. 11. init process Will execute processes defined in init.rc and the successor init.b2g.rc Launches userspace init process Once the init process is launched, Linux kernel handles system calls from userspace, and interrupts from hardware device Hardware features are exposed to userspace through sysfs
  12. 12. BootStrap
  13. 13. Inter-Process Communication Inter-process Communication Protocol Definition Language Developed by Mozilla C++ code to pass messages between processes or threads in a secure way Apps communicate with service-level daemons via IPC
  14. 14. IPC Architecture
  15. 15. IPC Parent <> Child relationship
  16. 16. Hardware Access Apps access hardware only via Web APIs Gecko is the sole gateway to mobile device No “native” API no other “back doors” Apps are ran in a sandboxed mode
  17. 17. Sandboxing and Security
  18. 18. Lets take another look
  19. 19. So what parts of the kernel? Derived from Android (ASOP) Uses libraries from Android (GPS, camera) Has extra Mozilla components These changes to ASOP are not upstreamed unique to FireFoxOS project Very basic Linux Kernel libusb, bluez and others OSS libraries
  20. 20. Basically, Gonk is a port of Gecko Gonk is a porting target of Gecko for FireFoxOS Gecko has full control over Gonk Difference in the exposure of interfaces Two examples telephony stack and display frame buffer where Gonk has full access This is not the same for FireFox Browser
  21. 21. Linux Kernel and OEMs Devices will have OEM drivers and firmware to address specific device hardware needs Vendors can modify the kernel and upstream those changes on their own schedule OEM's can also create device drivers and firmware which are not upstreamed
  22. 22. Implementing changes in GONK Due to unique nature of mobile devices custom components may/will be required Gonk can be extended in HAL and init and additional firmware/drivers added Anything added in HAL etc will need to have an inter-process communication channel between actors
  23. 23. Integrating with Gecko You might expose hardware functionality not currently accessible via Web APIs in Gecko You first expose functionality in Gonk then you modify Gecko Source to extend the Web APIs This allows access to the functionality required by the service-level daemon
  24. 24. Licensing Issues OEMs must sign licensing agreements with component suppliers Why? Due to proprietary components (drivers etc) specific to that hardware device
  25. 25. Who is responsible for Gonk Mozilla Maintains source repositories and support files Repositories include the base Linux kernel and hooks into Gecko Maintained under the Mozilla Public License https://www.mozilla.org/MPL/
  26. 26. Third Parties and Gonk OEMs and ODMs Building, compiling, testing, certifying, distributing Firefox OS device images Ensuring seamless Gonk to Web API (Gecko) integration calls Device hardware functionality
  27. 27. So the blockers, you say? Upstream process is not guaranteed There is proprietary drivers that will never see the light of the upstream Fragmentation starts to occur Each OEM, Device owner, person can maintain their own fork of FireFoxOS
  28. 28. Always limitations :/ Good example: mobile phones It's up to the telcos to push out an upgrade 1.1 is the main version in the wild yet Mozilla is at version 2 already :/ Hard to provide community support Frustrating to users they can see upgrades discussed online but not on their phone
  29. 29. Makes you want to... Flash your own device and maintain your own phone distro to stay ahead Annoying maybe? But hey at least with FireFoxOS you can if you so choose... https://developer.mozilla.org/en- US/Firefox_OS/Installing_on_a_mobile_device
  30. 30. Make it your own Based on Android kernel (ASOP) This (hopefully) makes it easier to port existing device drivers, firmware, service daemons, and other components Supported devices list can be found in the repo B2G/config.sh If yours is not there add it?
  31. 31. How to contribute The b2g process is defined in Gonk Modifications to b2g source code can be made https://github.com/mozilla-b2g/gonk-misc
  32. 32. Cool toys and future projects
  33. 33. So more Mobile Platforms? Choice is Good Being a Monopoly is bad for all Linux was made for embedded devices Go forth and play with FireFoxOS Roll your own distro with the Yocto Project Check out Tizen

×