Wednesday, May 18, 2011

I salute Fabrice Bellard

Recently the amazing hack of "boot Linux in a web page" has been circulating around. Bellard wrote a x86 emulator in JavaScript, then took the straight Linux binaries and was able to boot it. In a web page. At reasonable speeds. His distribution even includes a C compiler. This is amazing, but that's not all.

Bellard wrote the emulator QEMU, which lets you run one set of software "inside" another. It's mostly used for virtual machines, so you can run multiple operating systems inside a "host" OS. The guests can run Linux or Windows or whatever. The guest virtual machines can even be of different CPU types: ARM on a x86! This can be incredibly useful. But that's not all.

A large majority of video software uses the "ffmpeg" library. It's quite low level, but lets you do conversion of different screen sizes, bit rates, and codecs. Also written by Bellard, and now extended by a team for the last few years.

Among his other hacks are TCC, a tiny C compiler, which lets you use C as a scripting language. It's fast and complete enough to be used as a boot loader. That is, you can "boot" TCC, which then compiles and runs the Linux kernel. The entire thing. It recompiles on the fly.

Lastly he has some software to turn your computer into a TV transmitter. This is impossible, but he's found a way to do it by tweaking VGA video registers and timings and so forth.

I salute you, Fabrice Bellard.

Fabrice Bellard's Home Page