How to develop for GameCube Linux
From GamecubeLinux Wiki
Targetting the GameCube with your development is not as easy as targetting your Linux PC, because you have to do cross-development and explicitly upload the executables after compilation.
| Table of contents |
Cross Compiling
Although you can run a compiler on the GameCube, you will prefer to develop and compile on your desktop computer - which is likely to be a lot faster anyway.
The GameCube has a PowerPC CPU, so your development machine must be able to compile PowerPC binaries. If you have a Mac running Linux, this is easy: Your machine can already create executables for the GameCube.
If your development machine is an x86 PC or a Mac running Mac OS X, you need a cross-compiler. Arthur Othieno has contributed a ready-to-use cross-compiler for x86 available for download from the SourceForge project files (http://sourceforge.net/project/showfiles.php?group_id=98581&package_id=120824) page. You can of course also build your own cross-compiler from the GCC and binutils sources.
There are also cross-compilers for Linux, Windows and Mac OS X available at http://www.torlus.com and http://www.hangar-eleven.de/en/. However, we have found problems compiling recent kernels with them.
Kernel Building
The document Building a GameCube Linux Kernel explains briefly how to build a kernel image from sources.
Running Executables on the GameCube
There are several methods to run your code on the GameCube:
- SDload
- PSOload
- Samson's AR loader
- Datel's MAX Drive Pro
- modchip
- kexec
Please see Mod That Cube (http://modthatcube.pxn-os.com/) for more information about running executables.
The Root Filesystem
When linux boots it needs to find its root filesystem. Since the Gamecube does not have a harddrive you will most likely have the filesystem on a SD card, a minidvd, or located on a computer on the network. There are two main methods to accomplish this through network:
- NBD
- NBD stands for Network Block Device. It allows you to have a filesystem in an image file. Server software is available for both Linux and Windows. See Setting up GC-Linux with NBD-root.
- NFS
- NFS stands for Network File System. It allows you to have the filesystem as normal files and directories on the server. Server software is used mainly on Unix systems and is quite complex to set up. See Setting up GC-Linux with NFS.

