From: <he...@us...> - 2004-10-06 23:27:43
|
Update of /cvsroot/gc-linux/htdocs/xml/en In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14857 Modified Files: howtodevelop.xml Added Files: building_a_kernel.xml Log Message: Added a new document explaining how to build a kernel image from sources. Linked the new document to the existing howtodevelop document. --- NEW FILE: building_a_kernel.xml --- <?xml version="1.0" encoding="iso-8859-1"?> <?xml-stylesheet type="text/xsl" href="iparticle.xsl"?> <iparticle> <info> <!-- <revhistory> <revision> <revnumber>1</revnumber> <revdate>6 October 2004</revdate> <revdescription>Initial revision</revdescription> </revision> </revhistory> --> <title>Building a GameCube Linux Kernel</title> <author>Albert Herranz</author> <date>6 October 2004</date> </info> <sect2> <title>Introduction</title> This guide explains briefly the necessary steps to produce a Linux kernel suitable for the GameCube, using a Linux PC. </sect2> <sect2> <title>Requisites</title> <list> <item> A working Linux PC with the typical development tools installed. You will also need a C++ compiler (g++ recommended) to build doltool. </item> <item> A compatible ppc toolchain, for cross-compiling. For example, <a href="http://prdownloads.sourceforge.net/gc-linux/ppc-linux-uclibc-toolchain-20040609.tar.bz2?download">ppc-linux-uclibc-toolchain-20040609.tar.bz2</a> (23 MB). </item> <item> Doltool for Linux sources, <a href="http://www.dextrose.com/files/gc/homebrewn/applications/doltool.0.3.2.linux-TenOfTen.tgz">doltool.0.3.2.linux-TenOfTen.tgz</a> (20 KB). </item> <item> Linux kernel sources, from <a href="http://www.kernel.org">www.kernel.org</a>. </item> <item> GameCube Linux kernel patches, from the <a href="http://sourceforge.net/project/showfiles.php?group_id=98581&package_id=108737">SourceForge project files</a> page. </item> <item> (Optional) A ramdisk image, when building a ramdisk based kernel. Grab this <a href="http://www.gc-linux.org/down/ramdisk.image.gz">sample image</a> (250 KB) if you are building a kernel for the first time. </item> </list> </sect2> <sect2> <title>Installing the toolchain and doltool</title> <p> 1. Uncompress the toolchain to a directory where you have write access.</p> <verbatim> $ cd /home/isobel $ tar xjvf /temp/ppc-linux-uclibc-toolchain-20040609.tar.bz2 </verbatim> <p> 2. Uncompress doltool sources there too.</p> <verbatim> $ tar xzvf /temp/doltool.0.3.2.linux-TenOfTen.tgz </verbatim> <p> 3. Build doltool, and copy the resulting binary to the toolchain bin directory.</p> <verbatim> $ cd doltool.0.3.2.linux-TenOfTen $ g++ -o doltool *cpp </verbatim> <verbatim> $ cp doltool ../powerpc-linux-uclibc/bin/ </verbatim> </sect2> <sect2> <title>Preparing to use the toolchain</title> <p> 1. Add the bin directory of your ppc toolchain tree to your PATH environment variable.</p> <verbatim> $ export PATH=$PATH:/home/isobel/powerpc-linux-uclibc/bin </verbatim> <q>NOTE: This will temporarily add the toolchain directory to your path. If you plan to frequently use the toolchain you may want to modify your login script accordingly.</q> </sect2> <sect2> <title>Installing and patching the Linux kernel sources</title> <p> 1. Put the kernel tarball, and the GameCube Linux kernel patches, in a directory where you have permissions.</p> <verbatim> $ ls linux-2.6.8.1.tar.bz2 linux-2.6.8-gc.patch.gz </verbatim> <q>CAUTION: Do NOT use the /usr/src directory !!!</q> <p> 2. Unpack the kernel sources.</p> <verbatim> $ tar xjvf linux-2.6.8.1.tar.bz2 </verbatim> <p> 3. If you plan to build a ramdisk based kernel, copy your ramdisk image into the kernel source tree.</p> <verbatim> $ cp /temp/ramdisk.image.gz linux-2.6.8.1/arch/ppc/boot/images/ </verbatim> <p> 4. Apply the GameCube Linux patch corresponding to your kernel version.</p> <verbatim> $ cd linux-2.6.8.1 $ gunzip -cd <../linux-2.6.8-gc.patch.gz | patch -p1 </verbatim> <q>HINT: The patch for 2.6.8 applies also to 2.6.8.1</q> </sect2> <sect2> <title>Building the kernel image</title> <p> 1. Change to the parent directory of your recently patched kernel source tree.</p> <verbatim> $ cd .. $ ls linux-2.6.8.1 linux-2.6.8.1.tar.bz2 linux-2.6.8-gc.patch.gz </verbatim> <p> 2. Start with the default GameCube Linux kernel configuration as a base config.</p> <verbatim> $ cp linux-2.6.8.1/arch/ppc/configs/gamecube_defconfig linux-2.6.8.1/.config </verbatim> <p> 3. (Optional) Modify the kernel configuration.</p> <verbatim> $ make -C linux-2.6.8.1 ARCH=ppc CROSS_COMPILE=powerpc-linux- menuconfig </verbatim> <q>HINT: To change the initial IP settings of your kernel, go to "Platform options" and change "Default bootloader kernel arguments". </q> <p> 4. Build your kernel image.</p> If you are building a ramdisk based kernel, then do a: <verbatim> $ make -C linux-2.6.8.1 ARCH=ppc CROSS_COMPILE=powerpc-linux- zImage.initrd $ doltool -d linux-2.6.8.1/arch/ppc/boot/images/zImage.initrd.elf </verbatim> <q>HINT: If you are building a non ramdisk based kernel, the target is zImage instead of zImage.initrd.</q> <p> The resulting Linux kernel image in DOL format can be located at, </p> <p> <b><l>linux-2.6.8.1/arch/ppc/boot/images/zImage.initrd.dol</l></b> </p> </sect2> </iparticle> Index: howtodevelop.xml =================================================================== RCS file: /cvsroot/gc-linux/htdocs/xml/en/howtodevelop.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- howtodevelop.xml 22 Jun 2004 21:47:14 -0000 1.7 +++ howtodevelop.xml 6 Oct 2004 23:27:32 -0000 1.8 @@ -16,6 +16,10 @@ <p>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 <a href="http://sourceforge.net/project/showfiles.php?group_id=98581&package_id=120824">SourceForge project files</a> page. You can of course also build your own cross-compiler from the GCC and binutils sources.</p> <p>There are also cross-compilers for Linux, Windows and Mac OS X available at <a href="http://heliscar.com/greg/">http://heliscar.com/greg/</a> and <a href="http://www.hangar-eleven.de/en/">http://www.hangar-eleven.de/en/</a>. However, we have found problems compiling recent kernels with them.</p> + <h2>Kernel Building</h2> + + <p>The document <a href="building_a_kernel.html">Building a GameCube Linux Kernel</a> explains briefly how to build a kernel image from sources.</p> + <h2>Running Executables on the GameCube</h2> <p>The GameCube cannot read any CDs/DVDs that can be burnt. There are several methods to run your code on the GameCube, but we will show briefly only the "PSOload" method.</p> |