wii-linux Proof of Concept 0.2
4 March 2008, Albert "isobel" Herranz


1. INTRODUCTION

  This is a small proof of concept gc-linux distro contained in an ELF file
  which runs in a unmodified Nintendo Wii console with the help of the
  twilight-hack-v0.1-alpha2 loader.


2. REQUISITES

  These are the requisites to load this PoC using the twilight-hack:

  - a Nintendo Wii
  - a SD card
  - a SD card adapter for the Nintendo GameCube
  - (recommended) a USB Gecko adapter


2. PREPARATIONS

  Follow the twilight-hack instructions to install the linux.elf file into
  your "loading" SD card at sector 2048. If you have doubts read the README
  bundled with the twilight-hack.

   $ sudo umount /dev/your_device
   $ sudo dd if=linux.elf of=/dev/your_device bs=512 seek=2048
   4235+1 records in
   4235+1 records out
   2168658 bytes (2.2 MB) copied, 1.96411 seconds, 1.1 MB/s
   $ sync

  Before booting linux.elf, make sure your "loading" SD card is inserted into
  memcard slot A.
  If you own an USB Gecko adapter, make sure it is inserted into
  memcard slot B and connected through a USB cable to your PC. You can use a
  terminal program to connect via USB Gecko to your wii-linux :)
  I've tested it with minicom under Linux (/dev/ttyUSB0, 115200 8N1).
  It is recommended to activate linewrap.

   $ sudo minicom

   Welcome to minicom 2.2

   OPTIONS: I18n 
   Compiled on May  2 2007, 10:11:26.
   Port /dev/ttyUSB0

                    Press CTRL-A Z for help on special keys


3. BOOTING

  Follow the twilight-hack instructions to boot the linux.elf through the
  "loading" SD card.  If you have doubts read the README bundled with the
  twilight-hack.

  At this stage the twilight-hack ELF loader will load and boot linux.elf.
  You will start to see the typical startup messages of Linux on your TV
  and, if you own an USB Gecko, on your terminal too.


   Wii ELF Loader v0.1-alpha2                           
   Copyright (C) 2003,2004,2008  tmbinc, segher, bushing
   Cleaning up environment
   Closing file descriptors ...............done.
   OK.
   Slot A: SD card detected
   Slot B: USBGecko serial interface detected

   loading ELF file from SD...
   done!ng: 47f0
   00000000: 7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
   elf
   Loading .text @ 0x80400000 (23836 bytes)
   Loading .data @ 0x80406000 (4904 bytes)
   Loading __builtin_cmdline @ 0x80407328 (512 bytes)
   Loading .kernel:dtb @ 0x80407528 (770 bytes)
   Loading .kernel:vmlinux.strip @ 0x80408000 (1490516 bytes)
   Loading .kernel:initrd @ 0x80574000 (572049 bytes)
   Clearing .bss @ 0x80600000 (52592 bytes)
   
   zImage starting: loaded at 0x00400000 (sp: 0x00600fb4)
   Allocating 0x33450c bytes for kernel ...
   gunzipping (0x00000000 <- 0x00408000:0x00573e54)...done 0x30fc64 bytes
   Attached initrd image at 0x00574000-0x005ffa91
   initrd head: 0x1f8b0808
   
   Linux/PowerPC load: root=/dev/ram0 video=gcnfb:tv=auto ip=192.168.001.047:192
   Finalizing device tree... flat tree at 0x60d320

   ...

   RPC: Registered udp transport module.
   RPC: Registered tcp transport module.
   IP-Config: No network devices available.
   RAMDISK: Compressed image found at block 0
   VFS: Mounted root (ext2 filesystem) readonly.
   Freeing unused kernel memory: 160k init
   

4. LOGGING INTO THE SYSTEM

  (This will work only for USB Gecko users).
  In your terminal program, you'll see a welcome screen like this:


   Wii-linux-PoC GNU/Linux 0.2 (none) usbgeckocon1

   (none) login:


  At the login prompt you can enter the PoC credentials:
    user: root
    password: cube

  If you manage to do so, you'll get a command prompt :)

   # 


6. WORKING WITH THE SYSTEM

  The PoC system is based on busybox. There are a few symlinks to commands
  already created, but the busybox version supplied has support for a lot more
  commands. If you miss a command try with 'busybox missing_command' or ask for
  help with 'busybox'.

   # busybox top

  The kernel supplied has support for hot-insertion and removal of SD cards
  so you can extract your "loading" card and insert and mount another one.
  Just make sure YOU DON'T REMOVE A CARD WHEN IT'S MOUNTED, umount it first.


7. CHANGES

  We have fixed a long-standing bug that prevented some SD cards with block
  sizes greater than 512 bytes to work (I recently got one of these :).

  The kernel is now based on the powerpc branch instead of the ppc branch
  which is scheduled to die in June 2008.

  More classic gamecube hardware (audio, pads, exi) works now in
  Wii mode.
  You can also use now 52MB of MEM2 as a block device through /dev/mem2.


7. POWERING OFF THE SYSTEM

  The PoC has not yet support to poweroff the system so you must hold the
  power button for several seconds when you are done.


8. CREDITS

  Team Twiizers for the Twilight Hack.
  The wiibrew.org site and their contributors for their documentation.
  The libogc guys for providing another valuable source for
  cross-checking information.


9. DISCLAIMER

   THIS PROGRAM IS NOT AFFILIATED WITH NINTENDO.

   IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
   SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
   OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE AUTHOR
   HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

   THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
   BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
   AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
   ON AN "AS IS" BASIS, AND THE AUTHOR HAS NO OBLIGATION TO
   PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.


