dimanche, septembre 09, 2012

FreeBSD kernel for Nintendo Wii

Few months ago I've subsrcibed to the FreeBSD "svn-src-head" mailing-list for being notified of every change to the -current source tree.
And some weeks ago I've seen this message: Initial support for running FreeBSD on the Nintendo Wii.

What ??? FreeBSD is going running on Wii ???

I've looked for more information and found a small page that explain how to build it on the wiki: FreeBSD/Wii.
The commit message includes an important detail: "There are still some MMU problems and to get a working system you need to  patch locore32.S. Since we haven't found the best way yet to address that problem, we're not committing those changes yet."

  1. The -current code is incomplete, but meanwhile we can apply this locore32.S unofficial patch.
  2. The result is not usable: You will not obtain a shell prompt, it will hang before.
Here is the video of the boot process:

For building the kernel you need -current source tree, then the steps for building this kernel are pretty simple:

cd /usr/src
fetch http://gugus69.free.fr/freebsd/wii/locore32.diff
patch < locore32.diff
mkdir /tmp/WII
setenv MAKEOBJDIRPREFIX /tmp/WII ; make TARGET=powerpc TARGET_ARCH=powerpc buildworld
setenv MAKEOBJDIRPREFIX /tmp/WII ; make TARGET=powerpc TARGET_ARCH=powerpc KERNCONF=WII buildkernel

It will generate a kernel for WII here:

Then follow instructions from FreeBSD/wii wiki page for setup the SD card.

You can download my own FreeBSD/Wii archive (to be extracted on the root of your SD card).