<?xml version="1.0" encoding="utf-8"?>

<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
<title type="text">diary of a window system hacker</title>
<subtitle type="html"><![CDATA[
can't think of a clever byline
]]></subtitle>
<id>http://www.fooishbar.org/blog/2007/Mar/12</id>
<link rel="alternate" type="text/html" href="http://www.fooishbar.org/blog" />
<link rel="self" type="text/xml" href="http://www.fooishbar.org/blog/2007/Mar/12" />

<author>
<name>Daniel Stone</name>
<uri>http://www.fooishbar.org/blog/2007/Mar/12</uri>
<email>daniel@fooishbar.org</email>
</author>
<rights>Copyright 2004-2009 Daniel Stone, licensed under Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License</rights>
<generator uri="http://pyblosxom.sourceforge.net/" version="1.3.2 2/13/2006">
PyBlosxom http://pyblosxom.sourceforge.net/ 1.3.2 2/13/2006
</generator>

<updated>2007-03-12T22:39:00Z</updated>
<!-- icon?  logo?  -->

<entry>
<title type="html">valgrinding x</title>
<category term="/tech/x" />
<id>http://www.fooishbar.org/blog/2007/03/12/valgrind-2007-03-12-22-39</id>
<updated>2007-03-12T22:39:00Z</updated>
<published>2007-03-12T22:39:00Z</published>
<link rel="alternate" type="text/html" href="http://www.fooishbar.org/blog/tech/x/valgrind-2007-03-12-22-39" />
<content type="html">Have been feeling rather unwell for the past couple of days, so I decided,
while I feel like death warmed up, how could hacking at Valgrind possibly
make it worse?
&lt;br /&gt;&lt;br /&gt;
I took Tilman Sauerbeck&apos;s &lt;a
href=&quot;http://code-monkey.de/articles/2007/01/08/hacking-up-valgrind-mmt&quot;&gt;extended
version&lt;/a&gt; of Dave Airlie&apos;s valgrind-mmt, and cleaned up a couple of minor
bits -- changed the offset to be specified in hex, added support for
repetitions (e.g. &apos;repeated 255 times&apos;, instead of the same line 256 times
over), and also added support for the in*/out* family on AMD64, which was
quite entertaining as I&apos;ve not really touched either assembly or Valgrind
before.  Got it working in the end, despite libVEX&apos;s best efforts to
frustrate me, and ended up feeling slightly better as well.  Huzzah.
&lt;br /&gt;&lt;br /&gt;
Anyway, &apos;&lt;tt&gt;sudo valgrind --tool=mmt --offset=0xc1000000[0] /usr/bin/Xorg
:0 -ac &gt; x.log 2&amp;gt;&amp;amp;1&lt;/tt&gt;&apos; will trap all MMIO accesses made by X or
its VBIOS, provided you run the BIOS through x86emu instead of lrmi.
&lt;br /&gt;&lt;br /&gt;
Postscript: spent a few minutes after writing this trying to figure out if
there was anything I should&apos;ve said, and didn&apos;t.  Now, hours later, I realise
there was one minor detail omitted: &lt;a
href=&quot;http://gitweb.freedesktop.org/?p=users/daniels/valgrind.git;a=summary&quot;&gt;the
URL&lt;/a&gt;.  gitweb is just there, and the anonymous clone URL is
&lt;tt&gt;git://people.freedesktop.org/~daniels/valgrind&lt;/tt&gt;.
&lt;br /&gt;&lt;br /&gt;
[0]: Get the base address with lspci -v.  Your video card should have two
     PCI regions, of which one is big (your main video memory), and the other
     one is 32 or 64kB (the MMIO space, i.e. the bit you want).
</content>
</entry>
</feed>
