Differences between revisions 1 and 2
Revision 1 as of 2010-04-20 08:10:12
Size: 2086
Editor: ppp118-208-226-158
Revision 2 as of 2010-04-20 08:15:17
Size: 2184
Editor: ppp118-208-226-158
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
== What is an MMIO Trace == = What is an MMIO Trace =
Line 6: Line 6:
== Tracing the binary nVidia drivers == = Tracing the binary nVidia drivers =
Line 10: Line 10:
=== Prerequisites === == Prerequisites ==
Line 15: Line 15:
=== Setup === == Setup ==
Line 20: Line 20:

From here we will ensure that the {{{nvidia}}} driver is not loaded, enable the mmio tracer, load the

What is an MMIO Trace

MMIO (Memory Mapped I/O) tracing is a technique that can be used to reverse-engineer hardware drivers. It works by intercepting all the reads and writes by a driver to memory, recording how the driver is poking the hardware and what hardware state it reads. This tool was partially written, has been extensively used, by the Nouveau project to reverse-engineer the nVidia binary drivers.

Tracing the binary nVidia drivers

Some bugs in the Nouveau drivers can best be solved by working out what the binary nVidia drivers do and adapting that. This is particularly true for new hardware support and where the nouveau drivers fail to activate a monitor correctly.


  • Kernel 2.6.32-17 or newer. The mmiotrace kernel framework was enabled in the 2.6.32-17-generic kernel in the Lucid development cycle. You'll need to be running a kernel at least as new as this. An appropriate kernel is included in Lucid Beta 1 and later.
  • Working nVidia restricted drivers. We'll be tracing how the binary drivers interact with the graphics card, so we need the nVidia drivers to be working. You can enable the nVidia drivers through the Hardware Drivers configuration applet in System→Administration→Hardware Drivers. Boot at least once normally to check that the nVidia drivers are working correctly.


The initial set up for an MMIO trace needs to be done [i]before[/i] the driver is loaded. This means that we need to do it outside of X.

Boot your system in “recovery mode”. You can select this from the GRUB boot menu. If the GRUB menu is not shown by default you can bring it up early in your boot process by pressing the “shift” key. Select “Drop to a root shell prompt” from the recovery menu to bring up a terminal.

From here we will ensure that the nvidia driver is not loaded, enable the mmio tracer, load the

X/MMIOTracing (last edited 2010-04-21 00:28:37 by ppp118-208-223-175)