Wednesday, May 25, 2011

QEMU Dev Documentation

The one thing I've found lacking in the QEMU project is source code documentation. There are several papers on the technology behind the emulation features in QEMU, but not a lot of information is out there about how each piece is implemented except for the source code (which for the most part lacks useful comments). This creates a bit of a barrier to entry for new developers on the project, and is actually one of the reasons I did not start contributing to QEMU during the school year, as I didn't have the time to devote to get up to speed.

As I've begun to explore this myself, I decided that I'd make a list of links that I've found helpful in getting up to speed. Since I've found that there really are now good sources for organizational details of the source code other than the source code itself, I decided that I will do my part and contribute to some of that documentation later on in the summer. :
This is the official documentation for QEMU that mostly focuses on users, but also has a little bit of information for new developers and some useful links. :
These are some slides from a presentation given by Chad Kersey on QEMU Internals that focuses mainly on dynamic translation and basic block chaining. It also notes where some of those internal features are located in the source code, so it's easy to start browsing the code. :
This link is generated from the qemu-tech.texi file located in the source tree. While this copy may be up to date, it would be safer to generate this document yourself from the source code tree. The qemu-tech document describes the internals of QEMU, while the other .texi files in the source tree provide user documentation.
The QEMU source code. All the documentation is there in the form of source code.

A technical paper by Fabrice Bellard discussing the original internals of QEMU. This paper is from 2005, so the details may have changed significantly.**Edit: As noted in the comments below, this is extremely out of date, so don't read it unless you're interested in the project's history.

1 comment:

  1. The Bellard 2005 paper is now seriously out of date and perhaps two thirds of it are now
    actively misleading for modern QEMU. In particular:
    * dyngen is gone, and we now have a more conventional code generator backend (TCG)
    * system emulation always uses the software mmu, not mmap
    * we have a proper register allocator built in to TCG

    The Kersey presentation looks like a good overview that's still valid for the current sources.

    The qemu-tech document is actually shipped in the qemu git tree (as a .texi file that's
    built in to an HTML version.)