Linux Kernel: Difference between revisions

From Xenon Wiki
Jump to navigation Jump to search
imported>Jamiec
No edit summary
imported>Jamiec
No edit summary
Line 10: Line 10:


To run linux, you need to use the [[Linux Bootloader]] available right now. To compile the kernel, you need to set up a [cross compiler] toolchain (unless you already have another PowerPC Linux machine).
To run linux, you need to use the [[Linux Bootloader]] available right now. To compile the kernel, you need to set up a [cross compiler] toolchain (unless you already have another PowerPC Linux machine).
== Prerequisites ==
The minimal requirements for successfully cross compiling the Linux Kernel for your Xbox are (unverified):
•A machine running a Linux based OS (most likely your PC)
•Sources for the Linux Kernel version 2.6.21, get them at kernel.org
•The Xenon patchset from above
•Binutils (targeting the powerpc architecture)
•GCC (targeting the powerpc architecture)
Configuring and Compiling the Kernel
# Get the source for the Linux 2.6.21 Kernel from kernel.org and unpack it somewhere in your home directory.
    cd
    wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.21.tar.bz2
    tar -xvjf linux-2.6.21.tar.bz2
# Download and apply the Xenon patchset from above to make your Kernel sources aware of the newly supported platform.
    cd linux-2.6.21/
    for patch in pci_ids.h.diff linux-2.6.21-xenon-cpu.diff linux-2.6.21-xenon.diff \
                linux-2.6.21-xenon-enet.diff linux-2.6.21-xenon-platform.diff \
                linux-2.6.21-xenon-sata.diff linux-2.6.21-xenon-smc.diff \
                linux-2.6.21-xenon-ugly-fb.diff linux-2.6.21-xenon-ugly-udbg.diff \
                interlace.diff ; do
            wget http://op-co.de/xbox360/2.6.21/$patch
            patch -p1 < $patch
    done
# Configure the Kernel. You can manually fetch a configuration file from the internet (e.g. here) and type:
    make ARCH=powerpc CROSS_COMPILE=powerpc64-unknown-linux-gnu- oldconfig
Of course, you can fine-tune your Kernel configuration to fit your needs using
    make ARCH=powerpc CROSS_COMPILE=powerpc64-unknown-linux-gnu- menuconfig
# Build the Kernel by typing:
    make ARCH=powerpc CROSS_COMPILE=powerpc64-unknown-linux-gnu- all
If everything goes well, you will end up with a file arch/powerpc/boot/zImage.xenon containing the kernel which can be loaded by the [[XeLL]].

Revision as of 01:32, 12 March 2010

There is a set of 7 patches available sent to the linuxppc mailing list on 08 March 2007, which have to be applied to Linux 2.6.20. If you're interested in kernel development and/or adding new features, please take a look at Linux Kernel Development.

To run linux, you need to use the Linux Bootloader available right now. To compile the kernel, you need to set up a [cross compiler] toolchain (unless you already have another PowerPC Linux machine).


Prerequisites

The minimal requirements for successfully cross compiling the Linux Kernel for your Xbox are (unverified):

•A machine running a Linux based OS (most likely your PC) •Sources for the Linux Kernel version 2.6.21, get them at kernel.org •The Xenon patchset from above •Binutils (targeting the powerpc architecture) •GCC (targeting the powerpc architecture)

Configuring and Compiling the Kernel

  1. Get the source for the Linux 2.6.21 Kernel from kernel.org and unpack it somewhere in your home directory.
   cd
   wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.21.tar.bz2
   tar -xvjf linux-2.6.21.tar.bz2
  1. Download and apply the Xenon patchset from above to make your Kernel sources aware of the newly supported platform.
   cd linux-2.6.21/
   for patch in pci_ids.h.diff linux-2.6.21-xenon-cpu.diff linux-2.6.21-xenon.diff \
                linux-2.6.21-xenon-enet.diff linux-2.6.21-xenon-platform.diff \
                linux-2.6.21-xenon-sata.diff linux-2.6.21-xenon-smc.diff \
                linux-2.6.21-xenon-ugly-fb.diff linux-2.6.21-xenon-ugly-udbg.diff \
                interlace.diff ; do
           wget http://op-co.de/xbox360/2.6.21/$patch
           patch -p1 < $patch
   done
  1. Configure the Kernel. You can manually fetch a configuration file from the internet (e.g. here) and type:
   make ARCH=powerpc CROSS_COMPILE=powerpc64-unknown-linux-gnu- oldconfig

Of course, you can fine-tune your Kernel configuration to fit your needs using

   make ARCH=powerpc CROSS_COMPILE=powerpc64-unknown-linux-gnu- menuconfig
  1. Build the Kernel by typing:
   make ARCH=powerpc CROSS_COMPILE=powerpc64-unknown-linux-gnu- all

If everything goes well, you will end up with a file arch/powerpc/boot/zImage.xenon containing the kernel which can be loaded by the XeLL.