This part of the document is intended for developers and people who just like to live on the edge, compiling their own kernel.
This section describes how you can recompile your own kernel. It may be necessary to do if the prebuilt kernels do not contain drivers for some of your equipment. Rebuilding the kernel including only drivers for the equipment you have may also result in slightly more memory available for applications.
The diff files found at SunSITE Denmark are relative to the last release of the Linux/m68k developer sources. The diffs are named linux-2.2.8-m68k-YYMMDD.diff.gz (2.2.8 is the current Linux/m68k version at the time of writing - you may find patches for more recent kernels).
Always apply my patches to a clean set of Linux/m68k sources as found on SunSITE Denmark to avoid getting rejects. My diffs may include (parts) of patches posted to the Linux/m68k kernel list.
I have also started uploading Linux/APUS relative diffs. These are named linux-apus-YYMMDD.diff.gz and are relative to the previous Linux/APUS release.
So, in order to get yourself a set of Linux/APUS kernel sources, download the latest Linux/m68k sources (e.g., linux-2.2.8.tar.gz). Unpack these and apply a version-matching Linux/m68k-Linux/APUS diff (e.g., linux-2.2.8-m68k-990516.diff). When you want to upgrade the Linux/APUS sources later on, get the incremental Linux/APUS patches (e.g., linux-apus-990517.diff and linux-apus-990518.diff) and apply these in turn (to get from 990516 sources to 990518 sources). When you have downloaded the Linux/m68k kernel sources once, you should be able to remain up-to-date using only Linux/APUS incremental patches.
Both because the precompiled kernels are so big, and because the set of included drivers may change without notice, you should recompile your own customized kernel when you have used a precompiled kernel to install your system.
If you want to help (actively) with the development of Linux/m68k and/or Linux/APUS you also need to recompile your own kernel (yes, you can hack the kernel. All that is really required is build tools, patience, a bit of interest in the subject and possibly some C knowledge (I learned C by hacking Linux -- see the two previous requirements :))
It is possible to get a reasonable stable kernel by following the advice below. Many people who have problems with the kernels they build themselves usually didn't follow the below advice. In particular, use the specified tool versions even if newer are available. And build the tools yourself since prebuilt tools may include patches that could foul things up.
You can find binutils at prep.ai.mit.edu or one of its mirrors (e.g., sunsite.auc.dk/mirrors/prep.ai.mit.edu/pub/gnu/). You can find egcs at egcs.cygnus.com or one of its mirrors (e.g., sunsite.auc.dk/mirrors/egcs.cygnus.com).
Still, since it is a developer kernel, your mileage may vary, even if you painstakingly follow the below.
Note: There has been reported problems with rebuilding egcs-1.1 from the source code archive; it requires a C++ compiler, even if you specify LANGUAGES to only include C. Workaround is to build everything (i.e., don't use the LANGUAGES option).
A good way to start compiling your own kernel is by using the configuration I use to build kernels. That way, you can be sure that the kernel will build without problems, and you can test that it works just as well as the ones I have built.
First patch the kernel:
tar xzf linux-2.1.115.tar.gz cd linux-2.1.115 patch -d. -p0 < .../linux-2.1.115-m68k-980814.diff |
Then copy the .config from one of the archives with precompiled kernels to the kernel directory, configure and build the kernel:
cp [path of prebuilt kernel]/.config . make oldconfig make dep make |
Now test the kernel. If it works, reconfigure to suit your system and rebuild. Resolve problems as they appear and send patches to the list :)
If you know how to recompile Linux/m68k there shouldn't be much of a difference - except that it will be done faster :)
Get binutils-2.9.1 and egcs-1.1.
Configure, build and install binutils.
tar xzf binutils-2.9.1.tar.gz cd binutils-2.9.1 ./configure make make install cd .. |
Configure, build and install egcs.
tar xzf egcs-1.1.tar.gz cd egcs-1.1 mkdir build cd build ../configure make LANGUAGES=c make LANGUAGES=c install |
Get the latest Linux/m68k kernel sources (2.1.115 as of the time of writing) and apply the Linux/APUS patch.
tar xzf linux-2.1.115.tar.gz cd linux-2.1.115 patch -d. -p0 < .../linux-2.1.115-m68k-980814.diff |
Configure and compile the kernel.
make config [select the options you want] make dep make |
Boot your shiny new kernel (see the section called Booting Linux/APUS (991030) in Chapter 4).
This is probably what you want to do if you want to do some serious Linux/APUS development as it cuts down the time of the build-boot-test cycle dramatically. You need a slave box (like my PC 'Concubine') on which you do the editing and building and a proper connection to the Amiga (I used serial for some months, but can warmly recommend an Ethernet card).
Using a different build machine also allows you to get serial output from the kernel you are testing and/or use a remote debugger (beats printk-debugging, I'm sure) if you connect the machines with a null-modem cable.
You need a cross compilation environment, targeting big-endian PowerPC ELF files. Here's how to build the required binutils and compiler on another Linux box:
Get binutils-2.9.1 and egcs-1.1.
Configure, build and install binutils for target
tar xzf binutils-2.9.1.tar.gz cd binutils-2.9.1 mkdir build cd build ../configure --target=powerpc-unknown-linux make make install |
You should now have binutils targeted for PowerPC installed in /usr/local/bin. Make sure this directory is in your PATH.
Get the files from /usr/include of your Linux/APUS box and put them in the /usr/local/powerpc-unknown-linux/include directory of your build machine. (The files are also available from the 'misc' directory at SunSITE Denmark.) Make sure that the asm and linux links point to the location of those directories in the linux source code you are trying to compile (i.e., /usr/src/linux/include/asm and /usr/src/linux/include/linux) .
Configure egcs for cross-compilation.
tar xzf egcs-1.1.tar.gz cd egcs-1.1 mkdir build cd build ../gcc/configure --target=powerpc-unknown-linux make LANGUAGES=c make LANGUAGES=c install |
You should now have gcc targeted for PowerPC installed in /usr/local/bin/powerpc-unknown-linux-gcc.
Configure and build the kernel.
make config [select the options you want] make dep make |
Notice that the kernel will be build using the cross-compiler, powerpc-unknown-linux-gcc which automatically uses the correct PowerPC binutils.
Copy the kernel to your Amiga.
Boot your shiny new (cross-compiled) kernel (see the section called Booting Linux/APUS (991030) in Chapter 4).
There's a cross-compiling mini HOWTO at ftp://ftp.uni-erlangen.de:/pub/Linux/680x0/docs/cross-compiling-Mini-HOWTO you can consult if you need more help.