I haven't been following gc-linux since 2006 or so, so I was wondering if someone here had done it recently and could post a short guide.
Any help is much appreciated

you don't have to patch them anymore? wow!arcticfox wrote:(2.6.32 with mikep5 gc patch, newer kernels have gc support already)
Right now, i take a look at vanilla 2.6.38 source (just have it on local storage) - yes, its true, seems that it have all you need to build it for gc.liquitt wrote:you don't have to patch them anymore? wow!arcticfox wrote:(2.6.32 with mikep5 gc patch, newer kernels have gc support already)
For building a kernel, i used this cross toolchain http://downloads.sourceforge.net/gc-lin ... pc.tar.bz2liquitt wrote:what crosscompiler are you using btw. ?
i second thatemu_kidid wrote:A ready to go package would be nice
Code: Select all
$ mkdir ~/gclinux && cd ~/gclinux
$ wget http://ftp.gnu.org/gnu/binutils/binutils-2.18.tar.bz2
$ wget http://ftp.gnu.org/gnu/gcc/gcc-4.3.2/gcc-core-4.3.2.tar.bz2
$ wget http://slackware.sukkology.net/packages/devkitpro-gc/doltool.0.3.2.linux-TenOfTen.tgz
$ wget http://mirror.transact.net.au/sourceforge/g/project/gc/gc-linux/kernel/2.6.32/mikep5-patch-2.6.32-gc.bz2
$ wget http://ftp.halifax.rwth-aachen.de/kernel/linux/kernel/v2.6/linux-2.6.32.tar.bz2
Code: Select all
$ tar xjf binutils-2.18.tar.bz2
$ tar xjf gcc-core-4.3.2.tar.bz2
$ mkdir build-binutils && mkdir build-gcc && mkdir gccross && cd build-binutils
$ export PREFIX=/home/arcticfox/gclinux/gccross
$ export TARGET=powerpc-linux-gnu
$ sed -i "s/\[4-9\]|\[5-9\]/([4-9]|[1-9][0-9])|[5-9]/" ../binutils-2.18/configure
$ ../binutils-2.18/configure --target=$TARGET --prefix=$PREFIX --disable-nls --enable-werror=no
$ make all
$ make install
$ export PATH=$PATH:/home/arcticfox/gclinux/gccross/bin
$ cd .. && cd build-gcc
$ ../gcc-4.3.2/configure --target=$TARGET --prefix=$PREFIX --enable-languages=c --disable-nls --without-headers
$ make all-gcc
$ make install-gcc
Code: Select all
$ cd /home/arcticfox/gclinux/
$ tar xjf linux-2.6.32.tar.bz2
$ cd linux-2.6.32
$ bzip2 -cd <../mikep5-patch-2.6.32-gc.bz2 | patch -p1
$ cd ..
$ cp linux-2.6.32/arch/powerpc/configs/gamecube_defconfig linux-2.6.32/.config
Code: Select all
$ make -C linux-2.6.32 ARCH=powerpc CROSS32_COMPILE=powerpc-linux-gnu- CROSS_COMPILE=powerpc-linux-gnu- menuconfig
Code: Select all
$ make -C linux-2.6.32 ARCH=powerpc CROSS32_COMPILE=powerpc-linux-gnu- CROSS_COMPILE=powerpc-linux-gnu- zImage
Code: Select all
$ cd /home/arcticfox/gclinux
$ tar xzf doltool.0.3.2.linux-TenOfTen.tgz
$ cd doltool.0.3.2.linux-TenOfTen
$ g++ -o doltool *cpp
$ cp doltool /home/arcticfox/gclinux/gccross/bin/
$ cd ..
$ touch build-dol.sh
Code: Select all
#!/bin/bash
target=${1:-zImage}
ofile=zImage1
[ -r ${KSRC}/arch/powerpc/boot/${target} ] || {
echo "Can't find target image ${KSRC}/arch/powerpc/boot/${target}"
exit 1
}
cp ${KSRC}/arch/powerpc/boot/${target} ${ofile}
CROSS=powerpc-linux-gnu-
echo "+ building DOL"
load=$(${CROSS}readelf -l "$ofile" | \
perl -lane'printf"%08x\n",hex($F[3])+0x80000000 if /LOAD/;')
echo " LOAD: $load"
entry=$(${CROSS}readelf -l "$ofile" | \
perl -lane'printf"%08x\n",hex($F[2])+0x80000000 if /Entry point/;')
echo " EP : $entry"
${CROSS}objcopy -O binary \
-R .comment -R .shstrtab -R .symtab -R .strtab \
-R .gnu.attributes \
${ofile} ${ofile}.bin
doltool -c ${ofile}.bin $load $entry
doltool -i ${ofile}.dol
echo ""
Code: Select all
$ chmod u+x build-dol.sh
$ KSRC=linux-2.6.32/ ./build-dol.sh
if you do it like that, sed will tell you, that there is no such file ("configure") because you're entering an empty directory ("build-binutils")tar xjf binutils-2.18.tar.bz2
tar xjf gcc-core-4.3.2.tar.bz2
mkdir build-binutils && mkdir build-gcc && mkdir gccross && cd build-binutils
export PREFIX=/home/gclinux/gccross
export TARGET=powerpc-linux-gnu
sed -i "s/\[4-9\]|\[5-9\]/([4-9]|[1-9][0-9])|[5-9]/" configure
sure, will fix my postliquitt wrote:if you do it like that, sed will tell you, that there is no such file ("configure") because you're entering an empty directory ("build-binutils")sed -i "s/\[4-9\]|\[5-9\]/([4-9]|[1-9][0-9])|[5-9]/" configure
of course you meant the just tarred directory binutils-2.18/
I have a question - can you share your zImage.dol? I'm sure a lot of people don't have time/don't want to setup a cross-compiler, so it would be awesome if you supported our laziness.arcticfox wrote: You will have then zImage.dol file in current dir!
I tried all of this, right now - and it works. And thanks to all gc-linux team, becuase this guide is mostly based on their works.
Please, if you have any questions - i will glad to help!