Notas de un Peregrino

Shedding some light on Firefox OS

A few days ago Mozilla made an announcement about Firefox OS that got a whole lot of people excited (me included) about the possibilities of a new Mobile OS based on Gecko (Firefox's rendering engine) where everything is a webpage.

Even though what Mozilla did was only to make official and give a final name to what we have been calling B2G, it was great to see the reaction it caused on the media.

Along with that greater exposure, more people became interested in trying out Firefox OS, so I figured some clarification in how to test and what to expect of it could be of good use.

Firefox OS

B2G, Gaia, Firefox OS... uh, what?

You are confused? Don't worry, I know this is kind of confusing in the beginning. Before diving into how to test Firefox OS, there are some terms to understand:


This is the underlying system of the whole beast. It comprises the Linux Kernel, the device drivers, and Gonk (an intermediate layer, to glue things together).

Wevdev friendly advice:

This is mostly coded in C++, nasty low level stuff.


This is the UI you see and interact with. Where all the HTML5 magic sauce is in.

Wevdev friendly advice:

This is entirely coded in HTML/CSS/JS, rings any bell? :)

Firefox OS

This is the new name Mozilla gave to the entire ecosystem, consisting of the UI (Gaia) and the underlying OS (B2G).

Got it, now show me the OS!

So if you ask: How do I test this rocking new mobile OS? The answer will be: It depends. Currently these are the ways to try it out:

  • B2G Desktop
  • Use Firefox Nightly
  • B2G Emulator
  • Flashing it to a device

They all have their pros and cons, I'll try to summarize each.

B2G Desktop & Firefox Nightly

These are the preferred ways to try it out if you are a web developer. In a nutshell, what you get is a window that shows what you'd see in a device screen, without having to run an emulator.

Wevdev friendly advice:

The tradeof here is accuracy of behavior (Desktop B2G) vs. web developer tools (Firefox Nightly).

Going a bit deeper in details, B2G Desktop could be considered more like a runtime that let's you run Gaia without getting knee deep into emulators mud. You might ask "How is it possible to get something realistic enough to work with without using an emulator?", and the answer is: HTML. Remember the whole thing is powered by HTML/CSS/JS, so if you don't depend on things specific to a phone (like making calls) all you need is a browser :)

Firefox Nightly can also be used to test the OS. As this is the regular old Firefox Nightly without any magical B2G special ingredients (that Desktop B2G does have), you should expect it to behave somewhat differently than using Desktop B2G. The main reason to use this is to get the inspector and web developer tools that Nightly rocks and use them to debug Gaia and your apps.

Useful Links:

B2G Emulator

This is basically what the name says. It's running Firefox OS with a QEMU instance emulating an armv7 or x86 architecture and launching Firefox OS there. The tradeof here is speed (x86) vs accuracy of emulation (armv7), although it should be noted that this will be way slower than Desktop B2G/Nightly.

Useful Links:

Flashing Firefox OS to a device

For the most intrepid and adventurous, there is also flashing Firefox OS to a compatible device, and get The Real Thing. This is, build everything and flash it to a device, in a fashion much like flashing a custom Android mod to a device.

Besides this implying building and compiling lots of stuff, and having a fairly powerful machine, the list of compatible devices is currently very short: galaxy-s2, galaxy-nexus and nexus-s.

Also, a fair warning here is that while the Samsung Galaxy S II is the phone that enjoys the best support out of all those devices, the reality is that the devs are focusing on the prototype phones. You might hear/read about a device codenamed otoro (that I prefer calling the Mythical Otoro). Well, that is the prototype device. For some unfriendly Carrier/OEM reasons noone knows what phone actually it is, besides the lucky people who have one (Mostly Mozilla/Telefonica paid staff working on the project).

The main difference between the SGS2 and the Mythical Otoro is that the SGS2 has a 800x480 display and the other has a 480x320 one, so you might find some surprises in the big screen. (Like, a HUGE dialer :D)

Wevdev friendly advice:

You really want to avoid this, unless you are very brave, patient, and own a compatible device. I would at least wait until the Mythical Otoro stops being mythical and you can get one.

Useful Links:

Wait... can I avoid compiling stuff?

If I'm to be honest with you: Nope. Although there are some efforts underway to provide binaries of Desktop B2G and Emulator Builds, all of this is extremely new and in constant change. By that I mean that nothing has even reached an RC quality standard –not even an alpha– and anything can explode at any moment and stop working altogether. Remember that Firefox OS was just announced a week ago.

At the time I'm writing this, there is very active development in Gaia in order to get to the first v1 milestone, scheduled for the end of July 2012. Also, recently there has been quite a bunch of changes in the underlying Gecko, making the recent builds kind of inestable (yeah, I know, perfect timing...).

So, what should you expect out of this? Take a look:

  • If you want to test your site against Firefox OS:

If you want to test your existing website/webapp for compatibility on Firefox OS, you might well go ahead and try any of the aforementioned methods. Compatibility in Firefox OS should be the same as for regular Firefox Nightly, just that the viewport is reduced. Keep in mind the OS is targeted –at least for the time being- to HVGA display sizes.

  • If you want to start tinkering with webapps in Firefox OS:

You already know this is changing a lot and fast, in order to get to the first version. Tough not all the WebAPIs are fully implemented, it should be easy to spot wich are safe to use and wich not. You should head to this page in MDN to learn some more about web apps.

  • If you want to help out developing Firefox OS:

I salute you. The project is in dire need of contributors to bring in some community love here, as the volunteer/paid ratio is quite sad.

What you should first do is decide where you would like to help out, B2G (more like backend stuff) or Gaia (Frontend). Also, take a look at this wiki that lists the ways of contributing to Gaia. Basically is: Github + Mailing Lists + IRC.

Also, I encourage you to contact me (tweeting to @peregrinogris is quite effective) as I would love to help you out.