|
From: Thomas B. <th...@bo...> - 2007-01-27 17:15:23
|
Hello, as it seems there are still a few working with the Networkstation! I was looking for some hardware to play with a different architecture and came across the Networkstation. With it's ppc architecture you need to create a cross compiler toolchain in order to get software compiled on a standard i386 desktop. Due to the lack of time I had to stop but maybe the following is of use to the one or other trying to do the same.. 1. Building the toolchain(s) The development environment has been set up on the development machine in /share/projects/8362. The following directory layout was used: directory layout /share/projects/8362 |-docu (documentation for this project) |-crosstool-0.43 (unpacked version of crosstool-0.43) |-kernel (kernel sources and binaries) |-powerpc-603-linux-gnu (the resulting toolchain) |-rootfs (NFS Root with all binaries) |-source (all source packages) |-sysapps (place to compile all apps for target) We need to create a working toolchain for the ppc target in order to compile software on a fast i686 host for the target. Crosstool is a collection of scripts to create such a toolchain. The toolchain will be created using crosstool-0.43 from http://kegel.com/crosstool. Actually we need 2 toolchains. As the NetworkStation 1000 relies on the 2.4.xx Kernel we need a gcc 2.95.3 to successfully compile the kernel for it. Tests with 3.3.5 and 3.4.2 failed to produce a bootable kernel image. All other binaries for the NFS root are compiled using a recent toolchain with gcc 3.4.2 and glibc 2.3.3. Switching the compiler to be used is as simple as changing the search path... The two toolchains have been compiled using a script networkstation.sh which is based on demo-powerpc603.sh in the crosstool archive. You should be able to use the scripts as-is beside from changing the TARBALLS_DIR and RESULT_DIR in demo-ppc603.sh according to your environment. cp demo-powerpc-603.sh networkstation.sh change the path for TABALLS_DIR and RESULT_TOP and uncomment the needed toolchains in networkstation.sh ---------------------------- #!/bin/sh # This script has one line for each known working toolchain # for this architecture. Uncomment the one you want. # Generated by generate-demo.pl from buildlogs/all.dats.txt set -ex TARBALLS_DIR=/share/projects/8362/source RESULT_TOP=/share/projects/8362 export TARBALLS_DIR RESULT_TOP GCC_LANGUAGES="c,c++" export GCC_LANGUAGES # Really, you should do the mkdir before running this, # and chown /opt/crosstool to yourself so you don't need to run as root. mkdir -p $RESULT_TOP #eval `cat powerpc-603.dat gcc-2.95.3-glibc-2.1.3.dat` sh all.sh --notest #eval `cat powerpc-603.dat gcc-2.95.3-glibc-2.2.2.dat` sh all.sh --notest eval `cat powerpc-603.dat gcc-2.95.3-glibc-2.2.5.dat` sh all.sh --notest #eval `cat powerpc-603.dat gcc-3.2.3-glibc-2.2.5.dat` sh all.sh --notest #eval `cat powerpc-603.dat gcc-3.2.3-glibc-2.3.2.dat` sh all.sh --notest #eval `cat powerpc-603.dat gcc-3.2.3-glibc-2.3.2-tls.dat` sh all.sh --notest #eval `cat powerpc-603.dat gcc-3.3.6-glibc-2.2.2.dat` sh all.sh --notest #eval `cat powerpc-603.dat gcc-3.3.6-glibc-2.2.5.dat` sh all.sh --notest #eval `cat powerpc-603.dat gcc-3.3.6-glibc-2.3.2.dat` sh all.sh --notest #eval `cat powerpc-603.dat gcc-3.3.6-glibc-2.3.2-tls.dat` sh all.sh --notest #eval `cat powerpc-603.dat gcc-3.3.6-glibc-2.3.5.dat` sh all.sh --notest #eval `cat powerpc-603.dat gcc-3.3.6-glibc-2.3.5-tls.dat` sh all.sh --notest #eval `cat powerpc-603.dat gcc-3.3.6-glibc-2.3.6.dat` sh all.sh --notest #eval `cat powerpc-603.dat gcc-3.3.6-glibc-2.3.6-tls.dat` sh all.sh --notest #eval `cat powerpc-603.dat gcc-3.4.5-glibc-2.2.2.dat` sh all.sh --notest #eval `cat powerpc-603.dat gcc-3.4.5-glibc-2.2.5.dat` sh all.sh --notest #eval `cat powerpc-603.dat gcc-3.4.5-glibc-2.3.2.dat` sh all.sh --notest #eval `cat powerpc-603.dat gcc-3.4.5-glibc-2.3.2-tls.dat` sh all.sh --notest #eval `cat powerpc-603.dat gcc-3.4.5-glibc-2.3.5.dat` sh all.sh --notest #eval `cat powerpc-603.dat gcc-3.4.5-glibc-2.3.5-tls.dat` sh all.sh --notest #eval `cat powerpc-603.dat gcc-3.4.5-glibc-2.3.6.dat` sh all.sh --notest #eval `cat powerpc-603.dat gcc-3.4.5-glibc-2.3.6-tls.dat` sh all.sh --notest #eval `cat powerpc-603.dat gcc-4.0.2-glibc-2.2.2.dat` sh all.sh --notest #eval `cat powerpc-603.dat gcc-4.0.2-glibc-2.3.2.dat` sh all.sh --notest #eval `cat powerpc-603.dat gcc-4.0.2-glibc-2.3.2-tls.dat` sh all.sh --notest #eval `cat powerpc-603.dat gcc-4.0.2-glibc-2.3.5.dat` sh all.sh --notest #eval `cat powerpc-603.dat gcc-4.0.2-glibc-2.3.6.dat` sh all.sh --notest #eval `cat powerpc-603.dat gcc-4.0.2-glibc-2.3.6-tls.dat` sh all.sh --notest #eval `cat powerpc-603.dat gcc-4.1.0-glibc-2.2.2.dat` sh all.sh --notest #eval `cat powerpc-603.dat gcc-4.1.0-glibc-2.3.2.dat` sh all.sh --notest #eval `cat powerpc-603.dat gcc-4.1.0-glibc-2.3.2-tls.dat` sh all.sh --notest #eval `cat powerpc-603.dat gcc-4.1.0-glibc-2.3.5.dat` sh all.sh --notest #eval `cat powerpc-603.dat gcc-4.1.0-glibc-2.3.5-tls.dat` sh all.sh --notest eval `cat powerpc-603.dat gcc-4.1.0-glibc-2.3.6.dat` sh all.sh --notest #eval `cat powerpc-603.dat gcc-4.1.0-glibc-2.3.6-tls.dat` sh all.sh --notest echo Done. ---------------------------- The source packages are needed in /share/projects/8362/source. If the source packages are not present, crosstool tries to download them. building the 2 toolchains: sh networkstation.sh 2>&1 | tee networkstation.log Depending on the host system this can take a few hours... 2 Compiling the Kernel To compile the Kernel for the NetworkStation 1000 we first have to patch the Kernel source. Download the patch for the 2.4.29 Kernel: http://prdownloads.sourceforge.net/networkstation/patch-2.4.29-ns1000-20050209.gz?download The "export PATH=/share/projects/8362/powerpc-603-linux-gnu/gcc-2.95.3-glibc-2.2.5/bin:$PATH" sets the toolchain with the gcc 2.95.3 first in the search path. The ARCH=ppc CROSS_COMPILE=powerpc-603-linux-gnu- switches force the use of the ppc Architecture and the use of the cross compile toolchain. Kernel-2.4.29 cd /share/projects/8362/kernel tar xvjf ../source/linux-2.4.29.tar.bz2 export PATH=/share/projects/8362/powerpc-603-linux-gnu/gcc-2.95.3-glibc-2.2.5/bin:$PATH patch Kernel in order to compile a kernel for NS1000 (8362) patch -p1 < ../../source/patch-2.4.29-ns1000-20050209 make ARCH=ppc CROSS_COMPILE=powerpc-603-linux-gnu- mrproper cp ../../source/kernel-config-2.4.29 .config make ARCH=ppc CROSS_COMPILE=powerpc-603-linux-gnu- oldconfig make ARCH=ppc CROSS_COMPILE=powerpc-603-linux-gnu- menuconfig make ARCH=ppc CROSS_COMPILE=powerpc-603-linux-gnu- dep make ARCH=ppc CROSS_COMPILE=powerpc-603-linux-gnu- zImage cp .config ../../source/kernel-config-2.4.29 cp arch/ppc/boot/images/kernel.1000 .. The Kernel image is now under /share/projects/8362/kernel/kernel.1000 and you should be able to boot it via NFS or TFTP. This way you can at least get the kernel compiled, in order to compile a small Linux system you need to cross compile a few packages and are likely to end up in some trouble. Regards, Thomas |