<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>HackMii &#187; hardware</title>
	<atom:link href="http://hackmii.com/tag/hardware/feed/" rel="self" type="application/rss+xml" />
	<link>http://hackmii.com</link>
	<description>Notes from inside your Wii</description>
	<lastBuildDate>Thu, 25 Aug 2011 18:53:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>DSi RAM tracing: camera</title>
		<link>http://hackmii.com/2009/09/dsi-ram-tracing-camera/</link>
		<comments>http://hackmii.com/2009/09/dsi-ram-tracing-camera/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 08:33:58 +0000</pubDate>
		<dc:creator>bushing</dc:creator>
				<category><![CDATA[dsi]]></category>
		<category><![CDATA[hardware]]></category>

		<guid isPermaLink="false">http://hackmii.com/?p=715</guid>
		<description><![CDATA[As we probe deeper into the DSi, we come across some neat stuff. Scanlime got a new FPGA board from Sparkfun, which gives him more GPIOs and the ability to run them at the 1.8v necessary to properly talk to the RAM. Sorting through the data we get from this setup is still a considerable [...]]]></description>
			<content:encoded><![CDATA[<p>As we probe deeper into the DSi, we come across some neat stuff.  Scanlime got a new <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=8458">FPGA board from Sparkfun</a>, which gives him more GPIOs and the ability to run them at the 1.8v necessary to properly talk to the RAM.</p>
<div class="wp-caption aligncenter" style="width: 510px"><a href="http://www.flickr.com/photos/micahdowty/3914795010/"><img alt="Scanlimes debugging setup with new FPGA" src="http://farm3.static.flickr.com/2493/3914795010_2f8ed9e117.jpg" title="Scanlimes debugging setup with new FPGA" width="500" height="375" /></a><p class="wp-caption-text">Scanlime&#39;s debugging setup with new FPGA</p></div>
<p>Sorting through the data we get from this setup is still a considerable challenge.   Here&#8217;s a trace taken while the video camera is actually capturing video:</p>
<p><a href="http://dl.getdropbox.com/u/1926728/dsi/camera-trace-20090914.raw.bz2">http://dl.getdropbox.com/u/1926728/dsi/camera-trace-20090914.raw.bz2</a></p>
<p>There&#8217;s some code for decoding this trace format in scanlime&#8217;s svn repo: <a href="http://svn.navi.cx/misc/trunk/nds/dsi/ram-tracer/decoder/">http://svn.navi.cx/misc/trunk/nds/dsi/ram-tracer/decoder/</a></p>
<p>If you&#8217;d like to play along, see if you can distinguish between:</p>
<ul>
<li>Instruction fetches from RAM</li>
<li>Reads/writes to RAM buffers (statically or dynamically allocated) by code running on either processor</li>
<li>Reads/writes to control flags, used for e.g. synchronization between the ARM7 and ARM9</li>
<li>DMA writes from the camera hardware to RAM of the video data</li>
</ul>
<p>The video data makes up the vast majority of the data in this dump; if you&#8217;re working on homebrew code to talk to the camera, this might be helpful.  For the rest of you &#8212; can you make a tool to visualize the data flows in these traces, or a tool to decode the video frames in scanlime&#8217;s dump?</p>
<p>There&#8217;s also a hidden message in the video =)</p>
]]></content:encoded>
			<wfw:commentRss>http://hackmii.com/2009/09/dsi-ram-tracing-camera/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>DSi: ram hax</title>
		<link>http://hackmii.com/2009/09/dsi-ram-hax/</link>
		<comments>http://hackmii.com/2009/09/dsi-ram-hax/#comments</comments>
		<pubDate>Sun, 06 Sep 2009 08:10:42 +0000</pubDate>
		<dc:creator>bushing</dc:creator>
				<category><![CDATA[dsi]]></category>
		<category><![CDATA[hardware]]></category>

		<guid isPermaLink="false">http://hackmii.com/?p=686</guid>
		<description><![CDATA[Some time has gone by, and we&#8217;ve made a little progress on the DSi &#8212; at least, enough for some people to notice &#8212; so maybe I should write a little bit about it. I personally haven&#8217;t had much luck with my DSi.  I tried to dump the flash on it, and managed to blow [...]]]></description>
			<content:encoded><![CDATA[<p>Some time has gone by, and we&#8217;ve made a little progress on the DSi &#8212; at least, enough for some people to notice &#8212; so maybe I should write a little bit about it.</p>
<p>I personally haven&#8217;t had much luck with my DSi.  I tried to dump the flash on it, and managed to blow a fuse in the process (it&#8217;s hard to keep that battery aligned with the case removed&#8230;).  I can&#8217;t run any of the savegame hacks, because there are no DSi-mode cartridge-based games for the Japanese DSi yet.  I decided to get a bit more aggressive and see if we could sniff the RAM:</p>
<div class="wp-caption aligncenter" style="width: 510px"><a href="http://www.flickr.com/photos/bushing/3890823956/"><img title="bushings DSi with RAM breakout" src="http://farm3.static.flickr.com/2591/3890823956_0923ef180b.jpg" alt="bushings DSi with RAM breakout" width="500" height="375" /></a><p class="wp-caption-text">bushing&#39;s DSi with RAM breakout</p></div>
<p><span id="more-686"></span>This didn&#8217;t actually end up working out so well.   The thing stopped powering on, and well, yeah.</p>
<p>I did have a little more luck dumping the SPI flash onboard the WiFi dongle:</p>
<div class="wp-caption aligncenter" style="width: 510px"><a href="http://www.flickr.com/photos/bushing/3890846008/"><img title="dumping SPI flash with GoodFET" src="http://farm3.static.flickr.com/2438/3890846008_2f00973d9e.jpg" alt="dumping SPI flash with GoodFET" width="500" height="375" /></a><p class="wp-caption-text">dumping SPI flash with GoodFET</p></div>
<p>I used <a href="http://travisgoodspeed.blogspot.com/" target="_blank">Travis Goodspeed</a>&#8216;s awesome <a href="http://goodfet.sourceforge.net/clients/goodfet.spiflash/" target="_blank">GoodFET</a> device (thanks Travis!).  Some of you may remember FlashMe on the older Nintendo DS &#8212; this was the program that let you reflash the &#8220;firmware&#8221; that was stored on the SPI flash on the WiFi daughtercard to e.g. bypass RSA verification of Wireless MultiBoot games.  The DSi has the same chip in the same place, but it only holds a small amount of configuration data, with the &#8220;firmware&#8221; being stored elsewhere.  Bummer.</p>
<p>Meanwhile, at least two people have successfully dumped the 256MB MMC NAND flash; in at least one case, an old SD card reader was just soldered to 4 vias on the PCB! We&#8217;ve learned that there is approximately 1MB of that flash chip dedicated to the &#8220;firmware&#8221; used to boot the DSi &#8212; more on that below &#8212; and that second-stage loader is encrypted with a key that is shared among all DSis and stored in ROM (much like boot1 on the Wii).  Of that 1MB, about 300K is actually used.  The remainder of the NAND flash is encrypted uniquely per console, so as with the Wii, you can&#8217;t take the contents of one flash chip and boot it on another console.  (However, like with the Wii, it IS possible to back up your encrypted flash, upgrade or modify it, and then reflash back your old image to restore the old state.  The nice part is that it only requires <a href="http://www.flickr.com/photos/bushing/3888788967/in/set-72157622126251277/" target="_blank">4 wires</a> to do so on the DSi, as compared to 16 on the Wii.)</p>
<p>Once it became clear that something was seriously wrong with my DSi and it was never going to be useful in its current form, it <a href="http://www.flickr.com/photos/bushing/sets/72157622250411648/" target="_blank">gave its life to science</a>.  From that, we were able to find points to solder to all of the address, data and control lines on the DSi&#8217;s Pseudo-SRAM chip without removing any chips, and a promising new member of our close-knit community was able to successfully wire up a working DSi to an FPGA:</p>
<div class="wp-caption aligncenter" style="width: 510px"><a href="http://www.flickr.com/photos/micahdowty/3869187499/"><img title="scanlimes RAM tracing setup" src="http://farm4.static.flickr.com/3441/3869187499_da1665050d.jpg" alt="scanlimes RAM tracing setup" width="500" height="375" /></a><p class="wp-caption-text">scanlime&#39;s RAM tracing setup</p></div>
<p>scanlime really does some excellent work; through a bit of EE cleverness, he was able to slow down the clock of the DSi enough such that he could sniff all of the RAM traffic and dump it over USB to his computer for analysis.</p>
<p>We have no grand master exploit, but have learned the following things:</p>
<ul>
<li>There is a considerable amount of ROM (128K+?) and RAM (1MB+?) inside the CPU</li>
<li>The internal ROM is quite sophisticated, compared to that of the Starlet (<a href="http://hackmii.com/2008/05/boot0/" target="_blank">boot0</a>) &#8212; it is able to initialize both LCD panels, read from the SPI flash and the MMC NAND flash, and decrypt the contents of the 2nd-stage bootloader from NAND into internal RAM.  If there is an error, it can display an error code on the top LCD.</li>
<li>The second stage bootloader is analogous to boot2 on the Wii &#8212; it can read the TMD for the System Menu from the NAND filesystem and load the contents into memory.   Like the Wii, the code seems to be stored in NAND unencrypted (inside an encrypted filesystem).  Unlike the Wii, it seems to actually verify the contents and signature of the TMD before executing it.</li>
<li>Most of the interesting keys seem to be stored inside internal RAM, safely out of reach from us.  They are cleared when a cartridge is loaded, and probably even when a DSiWare app is loaded.</li>
</ul>
<p>While this is a tremendous boon, there are still many challenges ahead.  We have not yet found keys to decrypt most of the system software, and even finding those will not be enough to actually let us execute code; that will require a further exploit.  Furthermore,  we are currently drowning in data &#8212; a full RAM trace from scanlime&#8217;s setup from startup to installation of a channel is over 10 gigabytes.  We have some software that can convert this into a RAM dump &#8212; please don&#8217;t even ask me for it &#8212; but most of the interesting bits are only stored in memory temporarily. Work is still ongoing to let us analyze the flow of memory accesses and pick out those interesting, ephemeral bits.</p>
<p>In some ways, this is similar to what happened with the Wii &#8212; fiddling with the RAM gave us much greater insight into how the system worked, but it still took several months of dedicated reverse-engineering before we had a usable exploit.  Maybe this one will be faster, or maybe Nintendo will have learned a thing or two from their previous mistakes.</p>
]]></content:encoded>
			<wfw:commentRss>http://hackmii.com/2009/09/dsi-ram-hax/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Timing is everything (the case of the &#8220;unsoftmoddable Wii&#8221;)</title>
		<link>http://hackmii.com/2009/08/timing-is-everything-the-case-of-the-unsoftmoddable-wii/</link>
		<comments>http://hackmii.com/2009/08/timing-is-everything-the-case-of-the-unsoftmoddable-wii/#comments</comments>
		<pubDate>Sun, 30 Aug 2009 04:53:35 +0000</pubDate>
		<dc:creator>bushing</dc:creator>
				<category><![CDATA[Wii]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[ios]]></category>

		<guid isPermaLink="false">http://hackmii.com/?p=654</guid>
		<description><![CDATA[note: If you haven&#8217;t already, you should probably go back and read these posts, because they were written in preparation for this one: Wii Hardware: a history IOS: history, build process A few months back, we started getting reports of &#8220;unsoftmoddable Wiis&#8221;, aka &#8220;LU64+&#8221; (among other things). Normally, I wouldn&#8217;t care, but we discovered that [...]]]></description>
			<content:encoded><![CDATA[<p><em>note: If you haven&#8217;t already, you should probably go back and read these posts, because they were written in preparation for this one:</em></p>
<ul>
<li><a href="http://hackmii.com/2009/08/wii-hardware-a-history/">Wii Hardware: a history</a></li>
<li><a href="http://hackmii.com/2009/06/ios-history-build-process/">IOS: history, build process</a></li>
</ul>
<p>A few months back,  we started getting reports of &#8220;unsoftmoddable Wiis&#8221;, aka &#8220;<a href="http://www.google.com/search?q=lu64+wii" target="_blank">LU64</a>+&#8221; (among other things).  Normally, I wouldn&#8217;t care, but we discovered that our <a href="http://bootmii.org/download/" target="_blank">HackMii Installer</a> would not work on any of those Wiis.  I started making the claim that this was due to an innocuous hardware change, coinciding with the release of boot2v4, but I never really explained why.   Here&#8217;s my explanation.<br />
<span id="more-654"></span><br />
&#8220;LU64+&#8221; is a really silly way to describe these Wiis &#8212; it refers to the first four characters in the serial number of the first Wiis seen to be like this &#8212; but I can&#8217;t really blame people, because the serial number is the only real visible marking as to when the console was manufactured.</p>
<p>Starting around early 2009 (?), the following statements were true about all new purchased Wiis:</p>
<ol>
<li>All versions of IOS have the <a href="http://debugmo.de/?p=61" target="_blank">strncmp() bug</a> fixed, access to <a href="http://wiibrew.org/wiki//dev/flash" target="_blank">/dev/flash</a> blocked, and &#8220;ES_Identify&#8221; was broken.</li>
<li>boot1 had strncmp() bug fixed</li>
<li>crap installed into the slots for IOS3, IOS4 and IOS254</li>
</ol>
<p>Beginning in March, a fairly well-defined set of symptoms of running some kinds of homebrew software emerged on &#8220;newish&#8221; Wiis:</p>
<ol>
<li>Old (but valid) versions of IOS would not run at all; they would hang if you tried, which prevented downgrading IOS.  This did not apply to the leaked <a href="http://wiibrew.org/wiki/IOS16" target="_blank">IOS16</a>.</li>
<li>Attempts at reloading IOS by libogc would sometimes fail; depending on the program, this would look like a hang or would just cause all IOS calls to fail</li>
</ol>
<p>There seemed to be no difference in the installed software on one of these &#8220;newish&#8221; Wiis, compared to what you would get by doing an update through the System Menu.<br />
People proposed theories such as &#8220;Nintendo added special hack-detection code into boot1 / boot2, but they put a &#8216;back-door&#8217; in for IOS16.&#8221;  As I&#8217;ve explained in the past, <a href="http://hackmii.com/2008/06/boot1/" target="_blank">boot1</a> and boot2 are finished executing long before you see anything on your screen, and certainly don&#8217;t affect anything past that.  Rather, boot2 is responsible for loading IOS, and IOS is responsible for loading the PowerPC code for the system menu or game.  If you insert a game disc that uses a different version of IOS, the currently running IOS is responsible for loading and running the new IOS, which then loads the PPC code, and maybe eventually another IOS to get back to the system menu, etc.   (This exact order of steps becomes important later.)</p>
<p>This was a curiosity I mostly ignored, because it didn&#8217;t affect any of our software &#8230; until we released the HackMii Installer.</p>
<p>The reason we created one common installer for <a href="http://bootmii.org/" target="_blank">BootMii</a>, the <a href="http://hbc.hackmii.com/" target="_blank">Homebrew Channel</a> and <a href="http://wiibrew.org/wiki/DVDx" target="_blank">DVDX</a> was that it became increasingly complicated to install software on updated Wiis.  Different approaches were required, depending on the configuration of the Wii, and it became apparent that duplicating our decision-making and exploit code across multiple installers would be silly.  We ended up coming up with some code that would examine the state of the Wii it was running on, pick an appropriate strategy, and then automatically install the desired software.</p>
<p>There are a couple of different possible paths for the Installer to use &#8212; if it can, it will just use an old IOS that still has the unpatched hash comparison function and unfettered access to /dev/flash (reloading to that IOS as necessary).  If not, it would choose one of a list of IOS exploits we had found, depending on the versions of IOS installed (each exploit needs to be customized to a specific major/minor version of IOS), and use it to load <a href="http://hackmii.com/2009/05/mini-source-code/" target="_blank">MINI</a> into memory and execute it.  From there, we could directly access the NAND flash and detect the installed version of boot1 and boot2.   Finally, having made the decision of whether or not we could allow BootMii to be installed as boot2, we would reload back into a normal IOS so that we could access the WiiMote.  Of course, reloading back into IOS isn&#8217;t exactly trivial; MINI has a function that launches an arbitrary title from NAND by reading boot2 from the beginning of NAND, patching the call to ES_LaunchTitle(1-2) to the desired title ID, and then executing the patched boot2.</p>
<p>All of this happened automatically and hopefully seamlessly, but it could take a few seconds.  Having been burned by the <a href="http://hackmii.com/2009/02/scam-homebreware-and-wiiunlocker/" target="_blank">pay-for-homebrew wankers</a>, we have an &#8220;anti-scam warning screen&#8221; that we make the user sit through before installing our software.  The delay there made for a great opportunity for us to do our leet haxIOS magic, so we ran that &#8220;in the background&#8221; while the user sat through our nag screen.</p>
<p>This didn&#8217;t work as well as we had hoped on some new Wiis &#8212; suspiciously, it would reboot in the middle of the nag screen on &#8220;unsoftmoddable Wiis&#8221;.  Suddenly this became an interesting problem to me!</p>
<p>Unfortunately, we&#8217;re all old farts with old Wiis.  None of us could reproduce the problem ourselves &#8211; we tried to get people with troubled Wiis to run test code for us, but you really need a <a href="http://hackmii.com/2009/08/open-sourced-usbgecko/" target="_blank">USBGecko</a> to be able to get debug output from low-level code.  People who were new to the Wii were the least likely to have a USBGecko for testing, so &#8230; the only way we could proceed was to track down one of these &#8220;unsoftmoddable&#8221; Wiis.</p>
<p>I finally did so, and ran a debugging version of the installer on it.  I was surprised to see that it was actually getting all the way through our set of exploits, and was actually dying when it tried to reload back to IOS by way of boot2.  It turned out that these new Wiis had a new version of boot2 &#8212; boot2v4 &#8212; and our &#8220;patch boot2 to reload IOS instead of the system menu&#8221; routine was failing to find the code to patch.  Instead of giving an error message, it was just executing the unmodified new boot2 &#8212; which then re-ran the system menu instead of proceeding with our installer.   Oops.</p>
<p>That was certainly easy enough to fix &#8212; I <a href="http://gitweb.bootmii.org/?a=commitdiff&amp;p=mini&amp;h=950adf002f9a7158f4daaaa16466ce98859cf2b3" target="_blank">added a patch for boot2v4</a> &#8212; and the installer seemed to successfully reload IOS, only to hang inside __IOS_InitializeSubsystems() in libogc (specifically, ios_open(&#8220;/dev/es&#8221;)).  This started to match the reported failures in libogc programs during IOS_Reload().</p>
<p>svpe said he had run into some timing problems when working on booting back and forth between IOS and MINI, and suggested I try adding a delay.  When I added a delay of 5 seconds into our code between when we asked MINI to reload IOS, and when we actually reinitialized libogc, then everything started work.  I found this rather odd, since the code had worked just fine with boot2v3, and it also worked on boot2v4 if we reloaded to the System Menu (since that&#8217;s what had been happening to people when our boot2 patch failed).</p>
<p>After another sleepless night or two, it became clear that boot2v4 actually took somewhat longer to load than boot2v2/3.  If I checked the IOS version number right before calling __IOS_InitializeSubsystem(), it would report back the correct IOS version on boot2v3, but 0 on the boot2v4 system.  This indicates that boot2 was still running &#8212; boot2 sets that version number to 0 when it starts.</p>
<p>The answer to this problem seemed to be simple enough &#8212; we just needed to add some code that would work like the following:</p>
<ol>
<li>Send IPC to MINI asking for it to boot into IOS</li>
<li>delay until IOS version number is set to 0 (meaning, boot2 has fully loaded and is now executing)</li>
<li>delay until IOS version is the expected IOS version</li>
<li>proceed to initialize IOS</li>
</ol>
<p>Again, doing this made a little difference, but not a good one.   Now we no longer froze inside of __IOS_InitializeSubsystems(), but all of our IOS called failed once we booted into the installer &#8212; and they failed with strange error codes like &#8220;-900074497&#8243;.   svpe then pointed out that the IOS load process looks something like this:</p>
<ol>
<li>boot2 starts</li>
<li>boot2 sets IOS version number to 0</li>
<li>boot2 executes es_main()</li>
<li>es_main calls ES_LaunchTitle(1-2) (or in our case, IOSxx since we patched this parameter)</li>
<li>ES_LaunchTitle recognizes that we are trying to load an IOS, and then sets up the IOS version number in memory so that the newly-loaded IOS will know what version it is</li>
<li>ES_LaunchTitle transfers control to the new IOS</li>
<li>IOS starts and sets up the IPC registers to talk to the PPC</li>
</ol>
<p>We were hitting a timing race between when ES_LaunchTitle changed the IOS version number, and when IPC actually started.  If we tried to make IPC calls to the Starlet before the version number changed, then we would actually be trying to make IPC calls to boot2 while it was in the middle of rebooting &#8212; so we&#8217;d never get a response and libogc would hang.  If we waited until after the version number was set, libogc would try to talk to the new IOS before IPC was initialized; as part of that initialization, IOS would send back a bogus &#8220;ack&#8221; message that made libogc think that the ios_open(&#8220;/dev/es&#8221;) call failed, and then it would never properly initialize ES and all later calls would fail.  If we waited in our own code for this &#8220;ack&#8221; message (as suggested by isobel), then everything else worked.</p>
<p>Armed with this knowledge, I was able to add some timing code to our installer, and get the following numbers:</p>
<pre>On old hardware:
Time to load boot2v3: 958 ms
Time to execute through boot2v3 and launch IOS: &lt;1 ms
Time to initialize IPC: &lt;1ms</pre>
<pre>On new hardware:
Time to load boot2v4: 134 ms
Time to execute through boot2v4 and launch IOS: 178 ms
Time to initialize IPC: 499 ms</pre>
<p>Thus, we had our solution &#8230; more or less &#8230; to the problem of boot2v4 and the HackMii Installer &#8212; we just needed to add some delays.  So why is the timing so much different on the new Wii, and why doesn&#8217;t this affect normal operations of the Wii?</p>
<p>Let&#8217;s summarize the facts:</p>
<ul>
<li>Wiis recently began shipping with a new boot2v4, which is<a href="http://hackmii.com/2009/06/ios-history-build-process/" target="_blank"> based on the same code</a> present in  the set of IOSes released last October</li>
<li>Reloading IOS is often &#8220;broken&#8221; on new Wiis &#8212; especially when trying to reload to an &#8220;older&#8221; version of IOS (pre-October, taken from an older Wii)</li>
<li>Launching PPC titles works just fine on new Wiis, even if that requires reloading to a different version of IOS (as happens when launching the Homebrew Channel</li>
<li>The same versions of IOS work differently on older Wiis, and have none of the problems noted above.  The only difference in the software loaded on these Wiis is in boot1 and boot2.</li>
<li>The &#8220;leaked IOS16&#8243; seems to be exempt from these problems</li>
</ul>
<p>I think I can explain all but the last point.</p>
<p>From previous research, we can add the following tidbits of knowledge:</p>
<ul>
<li>boot1 and bc have each gone through 4 revisions; of those, 1 was to fix the strncmp bug and 3 were to change low-level hardware initialization routines</li>
<li>The strncmp bug fix first appeared in IOS37 in March, 2008; IOS, bc, and boot1 all apparently were fixed internally at Nintendo / BroadOn in Feb-Mar. 2008, but not released until a few months later</li>
<li>bc (and presumably boot1) was rebuilt with more minor hardware init changes in June 2008</li>
<li>new versions of boot2 and all of the IOSes were built on July 11th, 2008</li>
<li>The new versions of IOS were put up on the Nintendo Update Servers in October</li>
<li>Wiis began shipping with the new IOSes (but with boot2v4) in late 2008</li>
<li>Two PCB revs were made at the end of 2008/beginning of 2009 &#8212; all of these Wiis shipped with the &#8220;new&#8221; IOSes and boot2v4, and do not seem to work well with older versions of IOS</li>
<li>The only <a href="http://hackmii.com/2009/08/wii-hardware-a-history/" target="_blank">substantial changes made in the PCB</a> were to power-supply circuitry;  Hollywood (where IOS runs) was unchanged (still at &#8220;Hollywood AA&#8221;), and there may have been some inconsequential changes made to the Broadway</li>
</ul>
<p>A scenario begins to emerge:</p>
<ol>
<li>Nintendo develops a new PCB design to reduce cost by simplifying circuitry in mid-2008; the resulting design has fewer parts but takes a few milliseconds longer for the power supply voltages to stabilize</li>
<li>The new hardware requires a more-tolerant IOS kernel, so BroadOn rebuilds boot2 and IOS for Nintendo do use in testing the new PCB design.  These IOS versions are still backwards-compatible with C/RVL-CPU-01.</li>
<li>Nintendo releases the new IOSes as an update in late 2008, to quash the strncmp() bug (as well as /dev/flash access and ES_Identify()</li>
<li>Nintendo starts producing C/RVL-CPU-01 boards with the new IOSes on them.  (boot2 is not updated, since there&#8217;s no benefit to doing so)</li>
<li>Nintendo eventually starts mass-producing C/RVL-CPU-20, which requires an updated boot2(v4) in order to work, along with the new IOS versions which are already well-tested by this point.</li>
<li>Consumers receive these new C/RVL-CPU-20 Wiis.  Some of them try installing old versions of IOS on them and then running libogc code that uses them</li>
<li>libogc doesn&#8217;t know that it needs to wait longer for IOS to reload; depending on the timing, this can either cause a hang or it can cause IOS initialization to fail.</li>
</ol>
<p>I imagine that Nintendo never even realized this would be a problem.   Here&#8217;s how the system normally boots:</p>
<ol>
<li>System turns on</li>
<li>boot0 / boot1 / boot2 run on Starlet</li>
<li>boot2 loads the TMD for the System Menu, reads the required IOS version, then chainloads to that version of IOS</li>
<li>Newly loaded version of IOS loads System Menu from NAND into memory, then turns on PPC and starts it executing</li>
<li>User selects channel or disc; IOS loads TMD, reloads into new IOS</li>
<li>IOS loads game from NAND or disc into RAM, then bootstraps PPC</li>
</ol>
<p>Here&#8217;s what happens when someone runs some USB loader crap from the Homebrew Channel:</p>
<ol>
<li>User selects HBC from system menu; menu calls ES_LaunchTitle(00010000-HAXX)</li>
<li>IOS reads HBC&#8217;s TMD from NAND, sees that it needs IOS61 (or whatever), and reloads to it</li>
<li>IOS61 initializes hardware, then loads the HBC content into RAM and bootstraps PPC</li>
<li>User selects warezloader from SD card</li>
<li>HBC loads ELF from SD into PPC, and then jumps to it directly</li>
<li>ELF calls (e.g.) IOS_Reload(249) to load patched version of IOS</li>
<li>libogc makes IPC calls to IOS to reload IOS, but does not wait long enough for the process to finish, and then becomes confused</li>
</ol>
<p>In the normal Nintendo scenario, IOS is always the one reloading itself, and then the new version of IOS loads the PPC and starts the code.  There is never any PPC code executing while that process happens, and the PPC code can&#8217;t possibly start until the ARM is ready.   In contrast, the process used by libogc is &#8220;backwards&#8221;, with the PPC reloading the ARM code; insuffcient synchronization code is used to prevent this race condition because the old Wiis reloaded so quickly that it was never an issue.</p>
<p>Here&#8217;s what happens when someone runs E.G. a &#8220;forwarder channel&#8221; from the System Menu &#8212; a banner with a dummy TMD that loads a (probably patched) older version of IOS, and then launches something else:</p>
<ol>
<li>User selects &#8220;forwarder channel&#8221; from system menu; menu calls ES_LaunchTitle() on title</li>
<li>IOS reads channel&#8217;s TMD from NAND, sees that it needs (old) IOS36 (or whatever), and reloads to it</li>
<li>(old) IOS36 fails to properly initialize the hardware, and the system hangs</li>
</ol>
<p>This is not a bulletproof explanation.  I can&#8217;t explain:</p>
<ul>
<li>Why the leaked IOS16 still worked</li>
<li>What specific functions are needed in an IOS for it to work properly on a new Wii &#8212; the bootup process of IOS is multithreaded and difficult to follow, and I no longer have a Wii to test this on, and honestly I don&#8217;t care THAT much</li>
<li>Why, specifically, the new code is necessary</li>
<li>Why the latest version of the HackMii Installer still doesn&#8217;t work on all boot2v4 Wiis, even with the added synchronization code in place</li>
</ul>
<p>Even still, I think this is much better explanation than &#8220;Nintendo did something magic to make unsoftmoddable Wiis&#8221;.   Don&#8217;t get me wrong &#8212; I&#8217;m sure there were some smiles at Nintendo when they saw that hacks stopped working &#8212; but Nintendo&#8217;s anti-hacker efforts are generally far less subtle &#8212; for example, blocking /dev/flash and fixing the IOS exploit we used before in the HBC installer.</p>
<p>If you, the reader, would like to play around with this, I wrote a little test program, which you can download source and binary for here: <a href="http://static.hackmii.com/reloadtest.zip">reloadtest.zip</a>.  It&#8217;s mostly a version of the libogc IOS_Reload code, but with some debugging output (to the TV) and some timing code.  It&#8217;s not exactly the same as the code I talked about above &#8212; boot2 is not involved with the process &#8212; but those of you with access to Wiis with boot2v4 (and for whom the HackMii installer doesn&#8217;t work) might be able to gain some insight as to what&#8217;s going wrong.  Feel free to change the two versions of IOS (&#8220;from&#8221; and &#8220;to&#8221;).</p>
<p>When I run it on my Korean Wii, I get numbers like:</p>
<pre>stats: id=0x06bcc32d boot2v3 IOS46-&gt;IOS22 IOSticks=32 IPCticks=475
stats: id=0x06bcc32d boot2v3 IOS46-&gt;IOS20 IOSticks=32 IPCticks=1041</pre>
<p>On my old NTSC Wii (which originally came with boot2v2), I get:</p>
<pre>stats: id=0x0408cafa boot2v3 IOS35-&gt;IOS22 IOSticks=32 IPCticks=497
stats: id=0x0408cafa boot2v3 IOS35-&gt;IOS20 IOSticks=32 IPCticks=1052</pre>
<p>I&#8217;d be interested to hear if people see substantially different results on different hardware.</p>
]]></content:encoded>
			<wfw:commentRss>http://hackmii.com/2009/08/timing-is-everything-the-case-of-the-unsoftmoddable-wii/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Wii Hardware: a history</title>
		<link>http://hackmii.com/2009/08/wii-hardware-a-history/</link>
		<comments>http://hackmii.com/2009/08/wii-hardware-a-history/#comments</comments>
		<pubDate>Sat, 29 Aug 2009 22:20:41 +0000</pubDate>
		<dc:creator>bushing</dc:creator>
				<category><![CDATA[Wii]]></category>
		<category><![CDATA[hardware]]></category>

		<guid isPermaLink="false">http://hackmii.com/?p=657</guid>
		<description><![CDATA[Manufacturers of consumer electronics are constantly revising their designs over the lifetime of each product, generally for four reasons: Yield improvements &#8212; fix flaws that caused lots of warranty returns Cost reduction &#8212; use cheaper or fewer parts, so that profit margin increases or the retail cost can be lowered (or both) Part refresh &#8212; [...]]]></description>
			<content:encoded><![CDATA[<p>Manufacturers of consumer electronics are constantly revising their designs over the lifetime of each product, generally for four reasons:</p>
<ol>
<li>Yield improvements &#8212; fix flaws that caused lots of warranty returns</li>
<li>Cost reduction &#8212; use cheaper or fewer parts, so that profit margin increases or the retail cost can be lowered (or both)</li>
<li>Part refresh &#8212; sometimes manufacturers stop making parts (for example, 64MB memory chips), so they&#8217;ll start using &#8220;better&#8221; chips because they are the only ones now available</li>
<li>Security &#8212; anti-modchip modifications</li>
</ol>
<p>Most people only think about the last one, but the first three are far more common.  I think Sony has most actively revised their designs &#8212; aren&#8217;t there something like 30+ revs of the PS1, 15+ revs of the PS2, and several of the PSP and PS3?   Microsoft had 5 or 6 revs of the Xbox1, and 3 of the Xbox360.   Nintendo has had relatively few &#8212; perhaps this is because they have never sold their consoles at a loss, so they have less incentive to retool their factories to bring their costs down.  (It&#8217;s rather expensive to redesign a PCB and then retool your factories to make new ones, and you add some risk of creating new hardware problems and increasing your failure rate.)</p>
<p>Focussing back on our Wii, we can consider the following things as being more or less independent:</p>
<ul>
<li>Updates to the disc drive</li>
<li>Updates to the &#8220;big chips&#8221; (Hollywood, Broadway)</li>
<li>Updates to the main PCB</li>
</ul>
<p><span id="more-657"></span>We&#8217;ve seen several updates to the disc drive; these are so well-known that people even put up entire websites that track them!  Off the top of my head, there was DMS/D2A, D2B (like D2A, but changed mask ROM on one of the chips &#8212; probably for reason #1), D2B with cut legs (reason #4), D2C (reason #4), D2C2 (reason #4), D2E (unknown &#8212; reason #1?), D2E + epoxy (reason #4), &#8220;D2nothing&#8221; (perhaps reason #2, but most likely reason #4).  Clearly, these were mostly motivated by anti-piracy concerns.</p>
<p>We have also seen a few revisions to the Broadway and Hollywood chips.  The oldest photo I can find online of these chips is this one, dated November 17, 2006:</p>
<p><img src="http://static.hackmii.com/images/wiitopsy_ss_14.jpg" alt="Wii chips" /></p>
<p>Note that this is the first revision of each chip &#8212; called simply &#8220;Broadway&#8221; and &#8220;Hollywood&#8221;.  Protip:  We can tell that the Hollywood chip was made in the 32nd week of 2006 (&#8220;0632&#8243;) and the Broadway chip was made in the 31st week (&#8220;0631&#8243;) &#8212; so, August or so.</p>
<p>Unfortunately, not many people share my same sick fascination with taking their expensive consoles apart and photographing them, so it&#8217;s hard to find photos of a wide range of chips online.  On the Korean Wii I bought, it had a &#8220;Hollywood AA&#8221; (date code 0812) and a &#8220;Broadway B&#8221; (0744).  I assume that there was a &#8220;Hollywood A&#8221;; if anyone has one of these, please send me a photo or at least give me the date code from the chip so I can build a proper timeline. (I also have a &#8220;Hollywood AA&#8221; (0801) with a &#8220;Broadway A&#8221; (0747)), and a &#8220;Hollywood&#8221; (0636) with a &#8220;Broadway A&#8221; (0641).</p>
<p>The chip differences aren&#8217;t really very meaningful to us.  All of the chips have to run the same code.  It&#8217;s likely that the revisions were done to fix minor glitches; for example, there are a few places in IOS where it checks to see if the Hollywood chip is older than some version, and if so, executes some additional code (redundant memory writes, presumably to work around a bug in the silicon).</p>
<p>Much more interesting to me are the PCB changes.  The first couple of years of the Wii saw only one PCB, &#8220;C/RVL-CPU-01&#8243;; within the past year, there have apparently been two more (-20 and -30, as shown below):</p>
<div class="wp-caption aligncenter" style="width: 561px"><a href="http://static.hackmii.com/images/wii_pcb_comparison.jpg" target="_blank"><img title="Wii PCB comparison - C/RVL-CPU-01 vs -20 vs -30" src="http://static.hackmii.com/images/wii_pcb_comparison_small.jpg" alt="Wii PCB comparison - C/RVL-CPU-01 vs -20 vs -30" width="551" height="301" /></a><p class="wp-caption-text">Wii PCB comparison - C/RVL-CPU-01 vs -20 vs -30</p></div>
<p>Note that the major difference between -01 and -20 seems to be that there are a few missing parts.  Segher says that this is probably simplified power-supply circuitry; this will be important later.  Leaving these parts off may have allowed them to save an extra dollar or so; I can&#8217;t think of much other reason for the change.  It&#8217;s also important to note that neither the Hollywood or Broadway seem to have changed &#8212; they are still at Hollywood AA and Broadway B.</p>
<p>The -30 PCB is what has me stumped.  This photo came from someone on IRC who bought a new (&#8220;unsoftmoddable&#8221;) Wii in Australia; he sent it to me as part of our efforts to debug the HackMii Installer.  The only difference between those two is &#8230; the Broadway chip package is much, much smaller.  I&#8217;m told that it&#8217;s not likely that they actually shrunk the die; rather, they probably just shrunk the metal package, and placed the balls of the BGA package closer together.   Unfortunately, I can&#8217;t read the writing on the Broadway chip in this photo; if anyone has a Wii with a small chip like that, please take me some pictures of the top and bottom of the PCB!</p>
<p>My theory is that the switch from -01 to -20 coincided with the switch from boot2v3 to boot2v4, and that is when we started seeing reports of &#8220;unsoftmoddable Wiis&#8221;.  I&#8217;ll cover the software aspects of this in a separate post.</p>
]]></content:encoded>
			<wfw:commentRss>http://hackmii.com/2009/08/wii-hardware-a-history/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>of TMDs and hardware</title>
		<link>http://hackmii.com/2009/08/of-tmds-and-hardware/</link>
		<comments>http://hackmii.com/2009/08/of-tmds-and-hardware/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 23:01:20 +0000</pubDate>
		<dc:creator>bushing</dc:creator>
				<category><![CDATA[Wii]]></category>
		<category><![CDATA[hardware]]></category>

		<guid isPermaLink="false">http://hackmii.com/?p=638</guid>
		<description><![CDATA[Most of you probably remember our infamous attempt to open a line of communication with Nintendo. We chose that bug because a previous attempt at communication had failed &#8212; we had thought that them fixing the strncmp bug in the System Menu&#8217;s IOS could cause the system menu to brick when it tried to load [...]]]></description>
			<content:encoded><![CDATA[<p>Most of you probably remember our infamous <a href="http://hackmii.com/2008/07/dear-nintendo/" target="_blank">attempt</a> to open a line of communication with Nintendo. We chose that bug because a previous attempt at communication had failed &#8212; we had thought that them fixing the strncmp bug in the System Menu&#8217;s IOS could cause the system menu to brick when it tried to load the banner for the Homebrew Channel.   I emailed them about that in March, 2008 (right after IOS37 was released), and never got a response.   Thinking maybe I&#8217;d failed to find the right email address, we tried again with <a href="http://hackmii.com/2008/07/dvd-access-library-no-modchip-required/" target="_blank">another bug</a>.  We chose that bug because</p>
<ol>
<li>We could position it as a piracy-related concern, and Nintendo has some channels for reporting piracy</li>
<li>We didn&#8217;t really care if they fixed the bug, since it wasn&#8217;t really that useful for legitimate homebrew</li>
<li>There was probably not much they could do to fix it, anyway, since it was more of a design flaw</li>
</ol>
<p>The bug (as we intended to report it) wasn&#8217;t so much that you could poke a register to enable DVD video mode:</p>
<pre> #define HW_DIFLAGS 0x0d800180

 set32(HW_DIFLAGS, 0x200000);</pre>
<p>&#8230; it was that you could just set a bit in the TMD (in the &#8220;access rights&#8221; field) and it would let you send DVD video commands.  You didn&#8217;t even need to patch IOS!  If you set that bit in your TMD, when your title gets launched, ES reads the &#8220;access rights&#8221; field (offset 0x1d8) and checks a couple of bits.   If bit 1 is set, it opens /dev/di and calls ioctl 0x8E, which in turns calls syscall 0&#215;50, which does the above register poke.  This seems to set some state in the DI controller chunk of the Starlet that allows DVD video commands to go through.  This is how <a href="http://hackmii.com/2008/08/libdi-and-the-dvdx-installer/" target="_blank">DVDX</a> works &#8212; that bit is set in the TMD for DVDX and that makes the magic happen.</p>
<p>All of this is more or less academic, because if you can forge a signature to modify the TMD, then you can just patch the content of IOS &#8212; and that&#8217;s what most people (everyone else) did.  We think our approach is cleaner, but oh well.</p>
<p><span id="more-638"></span></p>
<p>Looking through the IOS code, ES checks the TMD for two bits, not one &#8212; but we couldn&#8217;t really figure out what the other one did, so we ignored it and moved on to more pressing things.  I only discovered its purpose a year later when trying to work on a <a href="http://bootmii.org" target="_blank">BootMii</a> <a href="http://bugs.hackmii.com/72">bug</a> which prevented the front-panel buttons from working when we were booted from IOS instead of as boot2.</p>
<p>If you refer back to my <a href="http://hackmii.com/2008/06/wii-hw-architecture-diagram/" target="_blank">Wii Hardware Architecture diagram</a>, you&#8217;ll see that the PPC (where most code gets executed) has to communicate to all the peripherals through an I/O interface that&#8217;s built into the Starlet; this interface selectively bridges some address ranges to different peripherals on the AHB / APB busses.   (AHB and APB are two standard ways of connecting other devices to an ARM core &#8212; the first one is higher-performance and used for things like USB and NAND, and the latter is slower and used for things like buttons and joypads.)</p>
<p>Normally, you have to access peripherals on those busses by making calls to IOS, which always has access to everything.  I thought this acted as a &#8220;de facto&#8221; firewall &#8212; that there simply was no silicon pathway from the PPC to e.g. the NAND, but there was one for e.g. the EXI bus and gamepads.  I should have been suspicious, however, at the fact that shape of this firewall can change somewhat when <a href="http://hackmii.com/2008/06/genie-into-bottle-mios/" target="_blank">MIOS</a> runs.  In normal IOS, the PPC cannot talk to the optical drive interface (DI), but in GameCube mode it can &#8212; and it has to work this way in order for GameCube games to be run without patching the games on the fly.   (I wonder why Nintendo didn&#8217;t make MIOS trap those DI commands and then translate them into IOS ioctls &#8212; this may always be a mystery.)</p>
<p>Another reason I should have been suspicious was the wording of some of the tests we saw in the <a href="http://hackmii.com/2008/06/factory/" target="_blank">factory logs I scraped</a>:</p>
<pre>sdiIMemA "SDI IOP API MemRW (sort)" "use IOP API in this test. Need SDCd" 0x0B09 sdio_api_memrw.dol "-auto"
sdi0RegM "SDI Register Check for WP (manual)" 0x0B01 sdio_hcreg.dol "-sdiboth" sdi0MemS

NandChk "NandFlashTest" "NAND FLASH Phsycal layer test from BW access" 0xA088 NandManu.dol
NandIOS "NAND Flash Auto by IOS-API" "WAIKIKI output." 0x0CA2 NandIOS.dol</pre>
<p>Note that all of this code is running on the PPC.  Some of it specifically refers to talking to hardware via IOS (IOP API or IOS-API), and some of it specifically talks about accessing hardware directly from the PPC (&#8220;test from [Broadway] access&#8221;).</p>
<p>Well, we can now answer one of the mysteries from my <a href="http://hackmii.com/2008/07/factory2/" target="_blank">factory 2</a> post.   Towards the end of the manufacturing process, they insert a disk &#8212; 122E &#8212; into the Wii, which installs a &#8220;<tt>DataChk.wad</tt>&#8221; &#8212; title ID of <tt>00010000-30303032</tt> (&#8220;<tt>0002</tt>&#8220;), and then they run a bunch of DOLs from an SD card.  This seems unnecessary &#8212; why can&#8217;t the disk just run stuff?</p>
<p>As it turns out, the TMD for &#8220;<tt>0002</tt>&#8221; has a different bit set in its TMD &#8220;access rights&#8221; field &#8212; bit 0.  The code for this looks something like:</p>
<pre>#define HW_MEMMIRR 0x0d800060
#define HW_AHBPROT 0x0d800064 // defaults to 0xFFFFFFFF on boot

void check_tmd(struct TMD *tmd) {
    // stuff ...
    enable_dvd_video_mode(tmd.access &amp; 2);
    syscall_54(tmd.access &amp; 1);
    // more stuff ...
}

void syscall_54(int factory_mode) {
    if (factory_mode) {
        set32(HW_MEMMIRR, 8); // this probably enables access to Hollywood regs from PPC
        set32(HW_AHBPROT, 0x80000DFE); // re-enable PPC access to disabled hardware devices
        write16(0x0d8b4202, 0); // dunno what this does
     } else {
        clear32(HW_MEMMIRR, 8); // this probably disables to Hollywood regs from PPC
        clear32(HW_AHBPROT, 0x80000DFE); // disable access to some hardware devices from PPC
        write16(0x0d8b4200, 0x18); // dunno what this does
    }
}</pre>
<p>At normal boot, boot2 will read the System Menu (1-2)&#8217;s TMD, find a zero, and call <tt>syscall_54(0)</tt>.  Once it reloads into this &#8220;<tt>0002</tt>&#8221; title, IOS will call <tt>syscall_54(1)</tt>, which &#8212; get this &#8212; enables access to <strong>every single fucking piece of hardware, directly from the PPC</strong>.   This lets their factory tests access all of the hardware in the simplest way possible &#8212; you can access NAND, the SD card, WiFi, everything from a DOL running on the PPC.  This makes the tests much easier to write &#8212; many of them would have required IOS modifications, otherwise &#8212; and probably saved them a lot of time &#8212; also, it suggests that originally there was no restriction and that they went in and placed that artificial restriction towards the end of the Wii&#8217;s development cycle.</p>
<p>When I wrote the code to read the front panel buttons for BootMii, I did all of my testing using BootMii/boot2.   This meant that &#8212; although I didn&#8217;t realize it &#8212; I had full access to the normally-guarded hardware, including the GPIO pins that are connected to the front panel buttons.   If I had tested more with BootMii/IOS, I would have realized that the real boot2 and IOS both lock down those registers, which is why buttons didn&#8217;t work in BootMii/IOS.   That&#8217;s how I discovered the <tt>HW_AHBPROT</tt> register, and it reminded me of the above <tt>syscall_54()</tt>, and here we are today.</p>
<p>So you&#8217;ve read this far &#8212; what does this all mean?  Sadly, not too much.  We wrote MINI to act as a proxy so we could talk to hardware from the PPC which was normally locked out.  We still need it to boot up the PPC and start code executing there, but in theory the rest is redundant.  The simplest fix for the button problem was to just make MINI set that <tt>HW_AHBPROT</tt> register to 0xFFFFFFFF &#8212; it&#8217;s probably one bit per device &#8212; but there&#8217;s no real point in rewriting the rest of BootMii.</p>
<p>(Before anyone asks &#8212; no, this doesn&#8217;t really make it easier to access USB / Bluetooth from BootMii, because it just means that you could write your USB stack for PPC instead of for the ARM chip.)</p>
<p>The major winner here is <a href="http://www.gc-linux.org/wiki/MINI:KernelPreviewTwo#Solved_hardware_I.2FO_latency_issues_when_using_mini" target="_blank">gc-linux</a>, which can now reuse most of the normal MMIO Linux drivers to talk to hardware instead of proxying through MINI.   It&#8217;s not a functionality improvement, but more of a performance boost.   Nevertheless, I hope you found this interesting.</p>
]]></content:encoded>
			<wfw:commentRss>http://hackmii.com/2009/08/of-tmds-and-hardware/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
		</item>
		<item>
		<title>complete USBGecko source, schematics released</title>
		<link>http://hackmii.com/2009/08/open-sourced-usbgecko/</link>
		<comments>http://hackmii.com/2009/08/open-sourced-usbgecko/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 07:07:49 +0000</pubDate>
		<dc:creator>bushing</dc:creator>
				<category><![CDATA[Wii]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[usbgecko]]></category>

		<guid isPermaLink="false">http://hackmii.com/?p=635</guid>
		<description><![CDATA[This happened a couple of weeks ago, but I only found out about it recently. Nuke released the full kit-n-kaboodle of USBGecko as open-source at http://code.google.com/p/usbgecko/ &#8212; this includes not only the source code for the latest WiiRd and GeckoOS under GPL, but the full schematics and VHDL files for the USBGecko itself under the [...]]]></description>
			<content:encoded><![CDATA[<p>This happened a couple of weeks ago, but I only found out about it recently.  Nuke released the full kit-n-kaboodle of USBGecko as open-source at <a href="http://code.google.com/p/usbgecko/">http://code.google.com/p/usbgecko/</a> &#8212; this includes not only the source code for the latest WiiRd and GeckoOS under GPL, but the full schematics and VHDL files for the USBGecko itself under the BSD license.  Bravo!</p>
]]></content:encoded>
			<wfw:commentRss>http://hackmii.com/2009/08/open-sourced-usbgecko/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Wii Hardware: Photos needed!</title>
		<link>http://hackmii.com/2009/07/wii-hardware-photos-needed/</link>
		<comments>http://hackmii.com/2009/07/wii-hardware-photos-needed/#comments</comments>
		<pubDate>Mon, 06 Jul 2009 19:17:57 +0000</pubDate>
		<dc:creator>bushing</dc:creator>
				<category><![CDATA[Wii]]></category>
		<category><![CDATA[hardware]]></category>

		<guid isPermaLink="false">http://hackmii.com/?p=609</guid>
		<description><![CDATA[I&#8217;m working on another post about the history of hardware revisions on the Wii, but am having trouble collecting the data that I need. I&#8217;ll give more info about all of this in my next post, but in brief &#8212; I have only ever seen three PCB revisions on the Wii: C/RVL-CPU-01 vs C/RVL-CPU-30: C/RVL-CPU-20: [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on another post about the history of hardware revisions on the Wii, but am having trouble collecting the data that I need.</p>
<p>I&#8217;ll give more info about all of this in my next post, but in brief &#8212; I have only ever seen three PCB revisions on the Wii:</p>
<p>C/RVL-CPU-01 vs C/RVL-CPU-30:</p>
<table style="width: auto;" border="0">
<tbody>
<tr>
<td><a href="http://picasaweb.google.com/lh/photo/20iQM2vvDt7lwAWCdnUBIg?feat=embedwebsite"><img src="http://lh6.ggpht.com/_3mcarIZEm6w/Sg6Ayjcdt7I/AAAAAAAAA84/Xy_kib_ozoE/s144/dieshrink.jpg" alt="" /></a></td>
</tr>
</tbody>
</table>
<p>C/RVL-CPU-20:</p>
<table style="width: auto;" border="0">
<tbody>
<tr>
<td><a href="http://picasaweb.google.com/lh/photo/x5Mt4E3d70kEfJj5GfWTog?feat=embedwebsite"><img src="http://lh3.ggpht.com/_3mcarIZEm6w/Sj2EkboMaOI/AAAAAAAAA-0/780R5ZBleb0/s144/IMG_0325.jpg" alt="" /></a></td>
</tr>
<tr>
<td style="font-family:arial,sans-serif; font-size:11px; text-align:right">From <a href="http://picasaweb.google.com/bushing/CRVLCPU20?feat=embedwebsite">C/RVL-CPU-20</a></td>
</tr>
</tbody>
</table>
<p>The PCB revision ID is found in the lower-right of the PCB, below the &#8220;Nintendo&#8221; logo.  I would be interested in any photos people can give me of the PCBs of their Wii, particularly if</p>
<ol>
<li>The heatsink is removed, and all of the writing on the two large chips (Hollywood and Broadway) is readable</li>
<li>The Wii was purchased in 2009 and/or is &#8220;unsoftmoddable&#8221; / &#8220;LU64+&#8221; / has boot2v4</li>
</ol>
<p>Any more details you can provide along with the picture would be appreciated &#8212; specifically, console ID, boot1 and boot2 versions, approximate date of purchase, serial number printed on outside of Wii.  I won&#8217;t publish this info individually, but I&#8217;m trying to show how the progression over time matches up with the software changes in my previous post.</p>
<p>You can either post the info and photo links here as comments, or email them to me at bushing at gmail.</p>
<p>Thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://hackmii.com/2009/07/wii-hardware-photos-needed/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>48UXP (hw)</title>
		<link>http://hackmii.com/2009/02/48uxp_hw/</link>
		<comments>http://hackmii.com/2009/02/48uxp_hw/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 12:08:34 +0000</pubDate>
		<dc:creator>bushing</dc:creator>
				<category><![CDATA[Wii]]></category>
		<category><![CDATA[hardware]]></category>

		<guid isPermaLink="false">http://hackmii.com/?p=344</guid>
		<description><![CDATA[Back at 25C3, pytey handed me a rather intimidating piece of hardware. &#8220;It&#8217;s a flash programmer, but it doesn&#8217;t work; I think I broke it with a custom adapter I was working on for it. I don&#8217;t have any tools to try to fix it, you want to have a go?&#8221; Here&#8217;s the device: The [...]]]></description>
			<content:encoded><![CDATA[<p>Back at 25C3, <a href="http://hackerati.com/">pytey</a> handed me a rather intimidating piece of hardware.  &#8220;It&#8217;s a flash programmer, but it doesn&#8217;t work; I think I broke it with a custom adapter I was working on for it.  I don&#8217;t have any tools to try to fix it, you want to have a go?&#8221;</p>
<p>Here&#8217;s the device:<br />
<img src="http://www.aec.com.tw/images/BIG-LT-48UXP.gif" alt="Labtool 48UXP" /></p>
<p>The &#8220;Labtool-48UXP&#8221; is an &#8220;Intelligent Universal Programmer&#8221;, with an impressive list of features.  Some of the ones that caught my eye were &#8220;Four DACs for Vcc, Vpp1, Vpp2 and Vpp3 with 8-bit resolution. Software controllable rises time and current limit protection&#8221;, &#8220;Logic driver supports pull-up/ pull-down or high impedance on all 48 pins with 2.0V-5V level,&#8221; and &#8220;The LabTool-48UXP performs device insertion and contact checks before it programs each device. It can detect poor pin contact and devices inserted upside down or in the wrong position.&#8221;</p>
<p>I had high hopes for this device &#8212; maybe I could write a Mac client for it, or add support for the Wii&#8217;s NAND flash chips to it.   In any case, I could find virtually no info about this thing online; surely someone had hacked on one of these things before?  In any case, before any more fun could be had, I had to get it working, and that required understanding what&#8217;s inside.  Shall we take a look?</p>
<p><span id="more-344"></span><br />
When you open the thing up, you&#8217;re faced with 2 stacked boards and a dual-voltage power supply (12v/5v).</p>
<p>The lower board is marked &#8220;LabTool-48UXP Control Unit&#8221;.</p>
<p><a href="http://static.hackmii.com/images/control-unit-labelled.jpg" target="_blank"><img src="http://static.hackmii.com/images/control-unit-labelled-small.jpg" alt="48UXP Control Unit" /></a></p>
<p>In some order, here are the major parts on the board:</p>
<ol>
<li>DB25 connector for parallel port</li>
<li>USB connector</li>
<li><a href="http://www.cypress.com/products/?rpn=CY7C68013A">Cypress &#8220;EZ-USB&#8221; FX2</a> microcontroller, a common USB2.0 interface that is an 8051-derivative</li>
<li>Serial EEPROM to store USB VID/PID</li>
<li>Main processor &#8211; an Intel <a href="http://datasheets.name/datasheets/207932/N80C32.html">80C32</a>, another ROMless 8051 derivative.   This chip is as old as I am!</li>
<li>Firmware for the 80C32 &#8212; 64KB, only the first half is used</li>
<li>32KB <a href="http://pdf1.alldatasheet.com/datasheet-pdf/view/47149/SONY/CXK58257.html">SRAM</a> for the 80C32 &#8212; overlays the top 32KB of the address space.  Also, I think some of the address space is used for memory-mapped IO with the XC3030 (see below) and the parallel port / FX2</li>
<li>Lattice <a href="http://www.latticesemi.com/lit/docs/datasheets/cpld/ispm4a.pdf">CPLD</a> &#8212; possibly used for the MMIO mentioned above</li>
<li><a href="http://www.ec66.com/market/sheet/TLC7226C.pdf">TLC7226C</a> &#8212; 4-output 8-bit DAC.  Presumably used to drive the 4 power supplies (Vcc, Vpp1, Vpp2, Vpp3) mentioned in the marketing copy</li>
<li>Power supply section &#8212; what we have here is an LM317T (used as a general voltage regulator?), LT1170CT (used to boost the +12v to +30v), and then 4 power op-amps which are configured as non-inverting amplifiers with a gain of about 10.  Meaning, the DAC feeds each a voltage from 0-3.0v, and the opamp outputs 0-30v.</li>
<li><a href="http://www.allegromicro.com/en/Products/Part_Numbers/6833/6833.pdf">A6833</a> (x2) &#8212; these are 32-bit, high drive-capacity shift registers.</li>
<li>NEC B772 PNP power transistors.   There are 48 of them, but I don&#8217;t think that they necessarily map 1:1 with the output pins.  These seem to be driven by the output of the shift registers?</li>
<li>Reed relays &#8212; 10 of them.  Why 10? Dunno. They seem to connect to the voltage sources, although 3 of them seem to pull stuff down to ground.</li>
</ol>
<p>The chips marked with ? have the tops sanded off them.  The chips marked with * are standard 74HCT logic-series chips &#8212; from top to bottom, left to right (like reading a book) we have &#8217;373, &#8217;245, &#8217;373, &#8217;14A, &#8217;245, &#8217;244, &#8217;373, &#8217;374, &#8217;244, &#8217;244.</p>
<p>The upper board is marked &#8220;LabTool-48 Driver Unit&#8221;.<br />
<a href="http://static.hackmii.com/images/driver_unit.jpg" target="_blank"><img src="http://static.hackmii.com/images/driver_unit_small.jpg" alt="Labtool-48UXP driver unit" /></a></p>
<ol>
<li><a href="http://pdf1.alldatasheet.com/datasheet-pdf/view/29156/TI/TPIC6B259N.html">TPIC6B259</a> &#8220;Power Logic 8-bit Addressable Latch&#8221;.  This thing has 8 150ma open-drain outputs (wewt!) and only needs 4 control lines &#8212; 3 to specify 1 of 8 bits, 1 to actually set the bit.  6 of these, total, so one bit per pin.</li>
<li><a href="http://www.allegromicro.com/en/Products/Part_Numbers/2987/2987.pdf">UDN2987</a> &#8220;8-Channel Source Driver with Overcurrent Protections&#8221;.  This part has 8 buffers which are presumably used in combination with the open-drain latches (above) to form a push-pull circuit for each pin.  Each driver can source 100mA, and it has an overcurrent detection output, which is fed back into the controller circuitry and causes the device to give you an error message when you put your chips in backwards. <img src='http://hackmii.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   Again, 6 of these.</li>
<li><a href="http://www.fairchildsemi.com/ds/MM/MM74HC259.pdf">74HC259</a> &#8212; 8-bit addressable latch. There&#8217;s one of these for every UDN2987, so you can latch the state of the pull-up driver and latch the state of the pull-down driver for each pin.</li>
<li><a href="http://www.fairchildsemi.com/ds/MM/MM74HC138.pdf">74HC138</a> and <a href="http://www.unicornelectronics.com/ftp/Data%20Sheets/74hct273-hc273.pdf">74HC273</a>, presumably acting as glue logic for the &#8230;</li>
<li><a href="http://www.xilinx.com/support/documentation/data_sheets/3000.pdf">XC3030A</a> &#8212; Xilinx 3000-gate FPGA.  Digikey lists this as a $17 part, but that must just be because they are old and hard to find!  This was state-of-the-art, 10 years ago.  If nothing else, it provides the &#8220;software controllable rise time&#8221;.   I think it&#8217;s safe to say this drives the push-pull latches that cover the rest of this board.</li>
</ol>
<p>Still unclear is exactly how the transistors and relays on the first board interact with the latches on the second board.  My next post will talk about the software provided by the manufacturer to drive this thing.</p>
]]></content:encoded>
			<wfw:commentRss>http://hackmii.com/2009/02/48uxp_hw/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Dual NAND Flash hack</title>
		<link>http://hackmii.com/2008/06/dual-nand-flash-hack/</link>
		<comments>http://hackmii.com/2008/06/dual-nand-flash-hack/#comments</comments>
		<pubDate>Tue, 03 Jun 2008 13:50:20 +0000</pubDate>
		<dc:creator>bushing</dc:creator>
				<category><![CDATA[Wii]]></category>
		<category><![CDATA[hardware]]></category>

		<guid isPermaLink="false">http://hackmii.com/?p=39</guid>
		<description><![CDATA[ChipD has done a lot of work lately with the actual, physical NAND Flash chip on the Wii, and he just told me about his latest feat &#8212; two chips installed in one Wii, with a switch to toggle between them.  More pictures and info after the break. The goal: mount two full NAND Flash [...]]]></description>
			<content:encoded><![CDATA[<p>ChipD has done a lot of work lately with the actual, physical NAND Flash chip on the Wii, and he just told me about his latest feat &#8212; two chips installed in one Wii, with a switch to toggle between them.  More pictures and info after the break.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="wmode" value="transparent" /><param name="src" value="http://www.youtube.com/v/B8nqaysKwBI&amp;hl=en" /><embed type="application/x-shockwave-flash" width="425" height="355" src="http://www.youtube.com/v/B8nqaysKwBI&amp;hl=en" wmode="transparent"></embed></object><br />
<span id="more-39"></span></p>
<p>The goal:  mount two full NAND Flash chips at the same time inside a Wii, so that you can switch back and forth between them.</p>
<p><a href="http://static.hackmii.com/dualbootnand/001small.jpg"><img title="bare Wii board, chip removed" src="http://static.hackmii.com/dualbootnand/thumbs/001.jpg" alt="bare Wii board, chip removed" /></a><a href="http://static.hackmii.com/dualbootnand/002small.jpg"><img title="cloned flash chips, compared to original" src="http://static.hackmii.com/dualbootnand/thumbs/002.jpg" alt="cloned flash chips, compared to original" /></a><br />
<a href="http://static.hackmii.com/dualbootnand/003small.jpg"><img title="double-stacked clone chips, left side" src="http://static.hackmii.com/dualbootnand/thumbs/003.jpg" alt="double-stacked clone chips, left side" /></a><a href="http://static.hackmii.com/dualbootnand/004small.jpg"><img title="double-stacked clone chips, right side" src="http://static.hackmii.com/dualbootnand/thumbs/004.jpg" alt="double-stacked clone chips, right side" /></a><br />
<a href="http://static.hackmii.com/dualbootnand/005small.jpg"><img title="installed chip stack, right side" src="http://static.hackmii.com/dualbootnand/thumbs/005.jpg" alt="installed chip stack, right side" /></a><a href="http://static.hackmii.com/dualbootnand/006small.jpg"><img title="installed chip stack, left side" src="http://static.hackmii.com/dualbootnand/thumbs/006.jpg" alt="installed chip stack, left side" /></a><br />
<a href="http://static.hackmii.com/dualbootnand/007small.jpg"><img title="chip-enable wires added, close up" src="http://static.hackmii.com/dualbootnand/thumbs/007.jpg" alt="chip-enable wires added, close up" /></a><a href="http://static.hackmii.com/dualbootnand/008small.jpg"><img title="chip-enable wires added, wide view" src="http://static.hackmii.com/dualbootnand/thumbs/008.jpg" alt="chip-enable wires added, wide view" /></a></p>
<p>This isn&#8217;t exactly self-explanatory, so let me explain what&#8217;s going on here.   He&#8217;s found some extra chips (see below) that are the same as the ones inside a Wii &#8212; he then desoldered his System-Menu 3.1U Wii&#8217;s flash chip from the Wii, and cloned it onto the two extra chips using an Infectus chip and amoxiflash.  This way, if anything goes wrong, he can always desolder this hack from his Wii and go back to the normal one.   (All of this soldering and desoldering is difficult and risky, but hey &#8212; you do what you gotta do.  Carefully.)</p>
<p>NAND flash uses an 8-bit data bus and 7 control lines.  One of those is Chip Enable (CE) &#8212; if Chip Enable is deselected, then the chip almost acts as if it&#8217;s not connected it all (all input and outputs go to tristate).  Therefore, if we can make sure that only one of those two chips will have its CE pin active at any given time, we can just solder the rest of everything together.  Then, to switch between the two chips, you just write up a 2-way switch.   In one position, CE of one chip is connected back to CE from the Wii board.  In the other position, the other CE is connected.</p>
<p>A schematic may make this clearer:</p>
<p><a href="http://hackmii.com/wp-content/uploads/2008/06/dualnandsch.png"><img class="aligncenter size-thumbnail wp-image-41" title="dual nand schematic" src="http://hackmii.com/wp-content/uploads/2008/06/dualnandsch-150x150.png" alt="" width="150" height="150" /></a></p>
<p>Now, let me be perfectly clear here &#8212; this is a neat hardware hack, but this is not something most people will be able to pull off, nor is it something most people will find useful.  It will not help you fix a broken Wii, or downgrade a Wii, or anything of the sort.</p>
<p>In order to make use of this, you will need:</p>
<p> </p>
<ul>
<li>1 or 2 extra NAND flash chips.  You can take these from a dead Wii, or certain (very specific) flash-based devices.   (Think USB flash sticks, CompactFlash cards, shitty MP3 players.)</li>
</ul>
<div>We only know of one specific model that has the right chip:</div>
<div><a href="http://hackmii.com/wp-content/uploads/2008/06/sony_flash.jpg"><img class="aligncenter size-thumbnail wp-image-42" title="sony_flash" src="http://hackmii.com/wp-content/uploads/2008/06/sony_flash-150x150.jpg" alt="" width="150" height="150" /></a></div>
<div>If you find any others, please post and let us know!</div>
<div>
<ul>
<li>A complete and intact image of your encrypted NAND chip &#8212; either done via software or hardware</li>
<li>A NAND programmer of some sort &#8212; perhaps an Infectus &#8212; to use to write your NAND flash image to your blank chips.  You will also probably want this so that you can reprogram one or both of the chips when you fuck them up&#8211; which is, after all, the only point of this endeavor.</li>
<li>Excellent soldering skills, patience, etc</li>
</ul>
<div>And, most importantly:</div>
<div>
<ul>
<li>Something clever to try out with this.  This allows you to try making changes to your flash, and then have a way to recover if they don&#8217;t work.  However, you only get one shot at that, and then you have to go use a hardware programmer to fix it.  </li>
</ul>
<div>So, if you have any questions about what the usefulness of this hack is &#8230; you should probably move on.  However, if you do want to pull it off, let&#8217;s talk about it.  (If anyone out there actually has a good idea for a use for this and a victim Wii to try it on, but lack the programmer or the chips or the soldering skills, come find me or ChipD, and we might be able to work something out.</div>
</div>
</div>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://hackmii.com/2008/06/dual-nand-flash-hack/feed/</wfw:commentRss>
		<slash:comments>41</slash:comments>
		</item>
		<item>
		<title>amoxiflash binary for win32</title>
		<link>http://hackmii.com/2008/05/amoxiflash-binary-for-win32/</link>
		<comments>http://hackmii.com/2008/05/amoxiflash-binary-for-win32/#comments</comments>
		<pubDate>Tue, 06 May 2008 13:01:06 +0000</pubDate>
		<dc:creator>bushing</dc:creator>
				<category><![CDATA[Wii]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[unbrick]]></category>

		<guid isPermaLink="false">http://hackmii.com/?p=18</guid>
		<description><![CDATA[Just a quick post on my way to bed:   I did some hacking around, and was able to get amoxiflash to build under XP.  I&#8217;ve posted a binary for Windows here: amoxiflash-win32-02.   In order to run it, you will also need to install the libusb-win32 filter from here: libusb-win32 filter driver Of course, the [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick post on my way to bed:</p>
<p> </p>
<p>I did some hacking around, and was able to get amoxiflash to build under XP.  I&#8217;ve posted a binary for Windows here: <a href="http://hackmii.com/wp-content/uploads/2008/05/amoxiflash-win32-02.zip">amoxiflash-win32-02</a>.   In order to run it, you will also need to install the libusb-win32 filter from here: <a href="http://downloads.sourceforge.net/libusb-win32/libusb-win32-filter-bin-0.1.12.1.exe">libusb-win32 filter driver</a></p>
<p>Of course, the source is included there (for what I&#8217;m calling &#8220;Version v0.2&#8243;), and you can compile it under Mac OS X and Linux, too!  I&#8217;ve tested it a bit under Windows, but I make no promises.  On my MacBook Pro using VMWare and XP, it seems to run at about half speed under Windows as compared to natively under OS X.  Ideas for improving the speed would be greatly appreciated.</p>
<p>Here&#8217;s the current usage info:</p>
<p> </p>
<p> </p>
<p><code></p>
<pre>amoxiflash version 0.2, (c) 2008 bushing
Usage: ./amoxiflash command -[tvwdf] [-b blocksize] filename
          -t            test mode -- do not erase or write
          -v            verify every byte of written data
          -w            wait for status after programming
          -f            force: ignore safety checks. Dangerous!
          -d            debug (enable debugging output)
          -b blocksize  set blocksize; see docs for more info.  Default: 0x2c0
          -s blockno    start block -- skip this number of blocks
                        before proceeding

Valid commands are:
         check        check ECC data in file
         strip        strip ECC data from file
         dump         read from flash chip and dump to file
         program      compare file to flash contents, reprogram flash
                        to match file</pre>
<p></code></p>
<p> </p>
<p> </p>
<p>It seems to be a bit fragile under Windows &#8212; if you see something like this, then unplug the Infectus from your computer, power the Wii off, turn the Wii back on (shorting D0 while doing so), plug the USB cable back in, and try again:<br />
<a href="http://hackmii.com/wp-content/uploads/2008/05/picture-5.png"><img class="aligncenter size-full wp-image-20" title="amoxiflash bad" src="http://hackmii.com/wp-content/uploads/2008/05/picture-5.png" alt="amoxiflash bad" width="500" height="144" /></a></p>
<p>Here&#8217;s what you want to see:</p>
<p><a href="http://hackmii.com/wp-content/uploads/2008/05/amoxiflash-good.png"><img class="aligncenter size-full wp-image-21" title="amoxiflash-good" src="http://hackmii.com/wp-content/uploads/2008/05/amoxiflash-good.png" alt="amoxiflash good" width="500" height="147" /></a></p>
<p> </p>
<p>As always, the source is available <a href="http://code.google.com/p/amoxiflash/source/browse/trunk">in Subversion.</a></p>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://hackmii.com/2008/05/amoxiflash-binary-for-win32/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
	</channel>
</rss>

