QEMU and open hardware: SPEC and FMC TDC

Posted by berto on November 28, 2012

Working with open hardware

Some weeks ago at LinuxCon EU in Barcelona I talked about how to use QEMU to improve the reliability of device drivers.

At Igalia we have been using this for some projects. One of them is the Linux IndustryPack driver. For this project I virtualized two boards: the TEWS TPCI200 PCI carrier and the GE IP-Octal 232 module. This work helped us find some bugs in the device driver and improve its quality.

Now, those two boards are examples of products available in the market. But fortunately we can use the same approach to develop for hardware that doesn’t exist yet, or is still in a prototype phase.

Such is the case of a project we are working on: adding Linux support for this FMC Time-to-digital converter.


This piece of hardware is designed by CERN and is published under the CERN Open Hardware Licence, which, in their own words “is to hardware what the General Public Licence (GPL) is to software”.

The Open Hardware repository hosts a number of projects that have been published under this license.

Why we use QEMU

So we are developing the device driver for this hardware, as my colleague Samuel explains in his blog. I’m the responsible of virtualizing it using QEMU. There are two main reasons why we want to do this:

  1. Limited availability of the hardware: although the specification is pretty much ready, this is still a prototype. The board is not (yet) commercially available. With virtual hardware, the whole development team can have as many “boards” as it needs.
  2. Testing: we can test the software against the virtual driver, force all kinds of conditions and scenarios, including the ones that would probably require us to physically damage the board.

While the first point might be the most obvious one, testing the software is actually the one we’re more interested in.

My colleague Miguel wrote a detailed blog post on how we have been using QEMU to do testing.

Writing the virtual hardware

Writing a virtual version of a particular piece of hardware for this purpose is not as hard as it might look.

First, the point is not to reproduce accurately how the hardware works, but rather how it behaves from the operating system point of view: the hardware is a black box that the OS talks to.

Second, it’s not necessary to have a complete emulation of the hardware, there’s no need to support every single feature, particularly if your software is not going to use it. The emulation can start with the basic functionality and then grow as needed.

The FMC TDC, for example, is an FMC card which is in our case connected to a PCIe bridge called SPEC (also available in the Open Hardware repository).

We need to emulate both cards in order to have a working system, but the emulation is, at the moment, treating both as if they were just one, which makes it a bit easier to have a prototype and from the device driver point of view doesn’t really make a difference. Later the emulation can be split in two as I did with with TPCI200 and IP-Octal 232. This would allow us to support more FMC hardware without having to rewrite the bridging code.

There’s also code in the emulation to force different kind of scenarios that we are using to test if the driver behaves as expected and handles errors correctly. Those tests include the simulation of input in the any of the lines, simulation of noise, DMA errors, etc.


And we have written a set of test cases and a continuous integration system, so the driver is automatically tested every time the code is updated. If you want details on this I recommend you again to read Miguel’s post.

Igalia at LinuxCon Europe

Posted by berto on November 05, 2012

I came to Barcelona with a few other Igalians this week for LinuxCon, the Embedded
Linux Conference
and the KVM Forum.

We are sponsoring the event and we have a couple of presentations this year, one about QEMU, device drivers and industrial hardware (which I gave today, slides here) and the other about the Grilo multimedia framework (by Juan Suárez).

We’ll be around the whole week so you can come and talk to us anytime. You can find us at our booth on the ground floor, where you’ll also be able to see a few demos of our latest work and get some merchandising.

Igalia booth

IndustryPack, QEMU and LinuxCon

Posted by berto on October 03, 2012

IndustryPack drivers for Linux

In the past months we have been working at Igalia to give Linux support to IndustryPack devices.

IndustryPack modules are small boards (“mezzanine”) that are attached to a carrier board, which serves as a bridge between them and the host bus (PCI, VME, …). We wrote the drivers for the TEWS TPCI200 PCI carrier and the GE IP-OCTAL-232 module.


My mate Samuel was the lead developer of the kernel drivers. He published some details about this work in his blog some time ago.

The drivers are available in latest Linux release (3.6 as of this writing) but if you want the bleeding-edge version you can get it from here (make sure to use the staging-next branch).

IndustryPack emulation for QEMU

Along with Samuel’s work on the kernel driver, I have been working to add emulation of the aformentioned IndustryPack devices to QEMU.

The work consists on three parts:

  • TPCI200, the bridge between PCI and IndustryPack.
  • The IndustryPack bus.
  • IPOCTAL-232, an IndustryPack module with eight RS-232 serial ports.

I decided to split the emulation like this to be as close as possible to how the hardware works and to make it easier to reuse the code to implement other IndustryPack devices.

The emulation is functional and can be used with the existing Linux driver. Just make sure to enable CONFIG_IPACK_BUS, CONFIG_BOARD_TPCI200 and CONFIG_SERIAL_IPOCTAL in the kernel configuration.

I submitted the code to QEMU, but it hasn’t been integrated yet, so if you want to test it you’ll need to patch it yourself: get the QEMU source code and apply the TPCI200 patch and the IP-Octal 232 patch. Those patches have been tested with QEMU 1.2.0.

And here’s how you run QEMU with support for these devices:

$ qemu -device tpci200 -device ipoctal

The IP-Octal board implements eight RS-232 serial ports. Each one of those can be redirected to a character device in the host using the functionality provided by QEMU. The ‘serial0‘ to ‘serial7‘ parameters can be used to specify each one of the redirections.


$ qemu -device tpci200 -device ipoctal,serial0=pty

With this, the first serial port of the IP-Octal board (‘/dev/ipoctal.0.0.0‘ on the guest) will be redirected to a newly-allocated pty on the host.

LinuxCon Europe

Having virtual hardware allows us to test and debug the Linux driver more easily.

In November I’ll be in Barcelona with the rest of the Igalia OS team for LinuxCon Europe and the KVM Forum. I will be talking about how to use QEMU to improve the robustness of device drivers and speed up their development..

Some other Igalians will also be there, including Juan Suárez who will be talking about the Grilo multimedia framework.

See you in Barcelona!


Posted by berto on July 28, 2012

Third day of GUADEC already. And in Coruña!


This is a very special city for me.

I came here in 1996 to study Computer Science. Here I discovered UNIX for the first time, and spent hours learning how to use it. It’s funny to see now those old UNIX servers being displayed in a small museum in the auditorium where the main track takes place.

It was also here where I learnt about free software, installed my first Debian system, helped creating the local LUG and met the awesome people that founded Igalia with me. Then we went international, but our headquarters and many of our people are still here so I guess we can still call this home.

So, needless to say, we are very happy to have GUADEC here this time.

I hope you all are enjoying the conference as much as we are. I’m quite satisfied with how it’s been going so far, the local team has done a good job organising everything and taking care of lots of details to make the life of all attendees easier. I especially want to stress all the effort put into the network infrastructure, one of the best that I remember in a GUADEC conference.

At Igalia we’ve been very busy lately. We’re putting lots of effort in making WebKit better, but our work is not limited to that. Our talks this year show some of the things we’ve been doing:

We are also coordinating 4 BOFs (a11y, GNOME OS, WebKit and Grilo) and hosted a UX hackfest in our offices before the conference.

And we have a booth next to the info desk where you can get some merchandising and see our interactivity demos.


In case you missed the conference this year, all talks are being recorded and the videos are expected to be published really soon (before the end of the conference).

So enjoy the remaining days of GUADEC, and enjoy Coruña!

And of course if you’re staying after the conference and want to know more about the city or about Galicia, don’t hesitate to ask me or anyone from the local team, we’ll be glad to help you.


FileTea now available in Debian

Posted by berto on November 10, 2011

In the past few weeks I’ve been preparing the Debian packages of FileTea and its companion EventDance. They’re finally available.

FileTea is a free, web-based file sharing system that just works. It only requires a browser, and no user registration is needed. If you want to know more about it, you can read my previous blog post. For a more detailed description, read Nathan Willis’s excellent article on LWN.net. There have been a few changes since that article (HTTPS support in particular) but it’s still the best one you can find on the net.

Igalia still provides a FileTea server at http://filetea.me/, that you can use to share your files and see how it works. We plan to keep offering this service, but you don’t need to trust it/depend on it anymore: now you can apt-get install filetea and have your own.

FileTea: a simple file sharing system

Posted by berto on September 08, 2011

FileTea is a simple way to send files to other people: drag a file into your web browser, give the link to your friends and they can start downloading it right away.


This is not a substitute for DropBox and the like. FileTea is not a file hosting service: the web server is only used to route the traffic, no data is stored there.

You can see it as a web-based P2P file sharing system, or a replacement for good ol’ DCC SEND. You don’t need to worry about firewalls or redirections: if you can surf the web, you can send the file. The only client that you need is your browser.

FileTea is a project developed by my fellow Igalian Eduardo Lima, and you can see more details about it here. It was written on top of EventDance, a peer-to-peer inter-process communication library based on GLib and also written by him (see also The Web jumps into D-Bus).

FileTea is free software and you can download it and install it in your machine.

We have also set up a server at http://filetea.me/.

Important: this is still an alpha release and our bandwith is limited so bear with us if you find any problem :)

Happy sharing!

Vagalume 0.8.5

Posted by berto on July 01, 2011

Dear Last.fm fellows, I’ve just released Vagalume 0.8.5.

Vagalume 0.8.5

These are the most important changes since the previous version:

  • Improved proxy support.
  • Support for low-bitrate streams, to save bandwidth.
  • GTK+ 3 support.
  • New Catalan translation.

This makes 0.8.5 the first Vagalume to support GTK+ 3, and this without even needing to break backwards compatibility. So now it compiles with any GTK+ version from (at least) 2.6 till 3.0 :-)

Source code, as usual, here. Binaries very soon in your favourite distro.


Posted by berto on June 23, 2011

The Nokia N9 is out.

Yes, after all what happened lately there are many reasons to be sad, cynic or pessimistic, particularly considering all the excitement and hopes that many people (including me) had when the N900 came out.

But still, even if this is a dead-end product and this team’s swan song, it’s a hell of a beautiful one.

Nokia N9

I’m happy to see the N9 out. Philip is damn right, and Urho is damn right. I think this is a great achievement, I’m personally proud of all the work we’ve put into it and also very glad for all the good reviews it’s getting.

Free software can produce amazing things, and this is just one more proof. Our hopes will not die here. No pasarán.

9 years of Igalia

Posted by berto on December 02, 2010

Last weekend almost all of us gathered together in what we call an Igalia Summit: a 2-day event where we discuss new ideas, relax, play music, and basically have fun and the opportunity to meet each other in person, something which is increasingly more difficult as Igalia becomes more and more global.

Claudio and API rehearsing

This time we also used the summit to invite some friends and celebrate our 9th anniversary dinner.

Although it sometimes feels like yesterday we started, 9 years is already a lot of time, and the feeling of looking back at our beginnings it not something that can be easily expressed with words. Of course things were very different back then and the company has changed a lot during all these years.

The core ideas, however, remain unchanged. One of them is our passion for free software, and that’s what we’re known for to most people. But there’s another key value that is equally important for us, and that is our flat structure.

Democracy begins in the workplace

For Igalia democracy is an essential value so we take it seriously. We think our people are the most important thing that we have, and thus deserve our highest respect. That’s why we not only like to hear their opinions: we also want them to propose, decide and participate in all affairs, so we give everyone a voice and a vote in all decisions.

If there’s something we have learnt during all these years is that when people can decide for themselves they are much happier and more committed to what they do. And when people are happy and committed we take the next logical step: we make them shareholders. Everyone who stays in the company long enough and is willing to continue can become a partner. We make no exceptions.

Group picture

In November, 4 Igalians became partners of the company: Alejandro Piñeiro (API), Xabier Rodríguez Calvar (Calvaris), Javi Muñoz and Mario Sánchez. They’re all good friends and I’m very happy to have them with us.

2010 has been a good year for Igalia, and we’ll hopefully be celebrating our 10th anniversary soon. Free software has evolved a lot in these 9 years. We tried to make our contributions and we met lots of friends on the way.

We’re glad to be here for 9 years already and we’re also very proud to be part of this vibrant community.

Twitter sharing plugin for the N900

Posted by berto on August 25, 2010

These days I’ve been playing with a sharing plugin for the Nokia N900. You can use it to upload pictures to Twitter, using a variety of services. Right now it supports Twitpic, Twitgoo, Mobypicture, img.ly and Posterous, but it can be easily extended to support other services.

Twitter sharing plugin for the N900

Right now it’s in extras-testing, so if you find it useful you can vote to help it reach the Maemo extras repository.

Click to install

As usual, feedback is appreciated.