4. Building your own PA-RISC/Linux kernel

To build a Linux kernel, you need a compiler and the Linux source. The first element is not a trivial thing to find because it depends on how you build your kernel. The second is easier since it lives on the official CVS site. First, we will discuss about GCC compiler. Then, the configuration of your build will be treated. The last paragraph will deal with the installation of this new kernel.

4.1. GCC compiler

You can compile your kernel with your own HP box. But on oldest systems, perhaps, you prefer to use another computer to compile your kernel. Let's see the two alternatives:

4.1.1. native build

Since Debian is the only distribution supporting PA-RISC architecture, if you want to use the Super Cow powers, you need to have some basic informations about Debian packages system first.

4.1.1.1. apt-get and friends

apt-get is a simple command line utility that manages your Debian package system. First, Gustavo Noronha Silva wrote APT HOWTO that I invite you to read for deeper knowledge. Here, we just want to build a kernel. Since hppa port is not out yet, you should be very careful with the mirrors you choose in your /etc/apt/sources.list. For example, In Germany, you can use the following settings:

# non-US packages
deb http://www.ftp.uni-erlangen.de/pub/debian/ unstable/non-US main non-free contrib
# Binary packages
deb http://gluck.debian.org/debian unstable main contrib non-free
# source packages
deb-src http://gluck.debian.org/debian unstable main contrib non-free

4.1.1.2. update your gcc

If you are using your own HP box, you need only the classical GCC compiler. The recommendation is to update to the last version uploaded by the developpers.

apt-get update
apt-get upgrade
If you do not want to upgrade all your system, the package description of kernel-source, you need to get those packages updated:

  • binutils

  • fileutils

  • gcc

  • libc-dev

  • make

When you did this step, you can procede to the kernel tweaking.

4.1.2. cross compiled build

For this way of building your kernel, everything depends on the architecture of your building machine. For PC, you can download an already-made cross compiler on PA/Linux FTP server. For the others architectures or if you want to compile your own toolchain, please refer to Carlos O'Donell's HOWTO.

4.2. Kernel configuration

The best way to get performance is to get a well configured kernel. For PA-RISC platform, make oldconfig is a kind of default setup. If you want to make your own kernel, the first step is to know what is your hardware. The best way is to look at your box and find a maximum of information. Then, you go to the official hardware database or the HP partsurfer.

When you know what is inside your box and what you want to do with your box, just run make menuconfig or another config command. Here is the list of menus you should be going in to see if the value set corresponds with your hardware:

As you see, menus about HP hardware are not numerous but there is a lot of dependency between them. Now, you must configure accordingly to the use you will do of the box. Here is the list of some menus you should be going in to configure the services you want:

Once this is done, save your configuration. Everything is written in the .config file. You can backup it because a make distclean will remove it. At this stage, you do make dep vmlinux and if everything goes fine, you have a new kernel.

4.3. Kernel installation

If you made a native build, you backup the last working kernel with an extension like ".bk" and you copy the recent kernel with the same name. You reboot and try the new one. If it is not working, you can reboot and using PALO command, you change the name of th kernel you want to boot. ( See next section for more informations )

If you are booting via network, you need to set PALO as it is explained in the next section and run make palo