Easy MAMECab  
  Hardware | Linux | Windows | MyCab | Links

You must have a working development environment to compile a Linux kernel. If you are using LFS or Gentoo you already have one. If, however, you are using a package based distro, like Mandrake, SUSE, Debian, or Slackware, then you must install all of the necessary development packages (gcc, make, kernel source, etc). Since all of these distro's offer a development bundle during the install, this chore is simple enough. Most likely you'll only need to manually install the kernel's source using your package manager (like on Mandrake, for example). Note, Fedora no longer distributes a kernel source package.

You must use the kernel source provided by your distribution for the following to work. Building the latest kernel from vanilla sources (i.e. ftp.kernel.org) is beyond the scope of this howto and is NOT recommended if you are using either SUSE or Fedora.

To compile a 2.6.x framebuffer kernel on SUSE or Mandrake, launch a command prompt, and enter (or cut and paste)

su -
cd /usr/src/linux
sed -i "s/^EXTRAVERSION.*/EXTRAVERSION = -mykernel/" Makefile
make mrproper
zcat /proc/config.gz > .config || cat /boot/config-`uname -r` > .config
make oldconfig
make menuconfig

Goto Device Drivers ---> Graphics Support and unselect VESA VGA graphics support from the menu (i.e. press n to remove it from the kernel). Change the remaining framebuffer drivers from M to * (i.e. press y to compile them into the kernel). Exit and save your modifications. Then at the command prompt enter (or cut and paste)

make all
make modules_install
VERSION=`grep "^VERSION" Makefile | tr -d ' ' | grep -o "[^=]*$"`
PATCHLEVEL=`grep "^PATCHLEVEL" Makefile | tr -d ' ' | grep -o "[^=]*$"`
SUBLEVEL=`grep "^SUBLEVEL" Makefile | tr -d ' ' | grep -o "[^=]*$"`
EXTRAVERSION=`grep "^EXTRAVERSION" Makefile | tr -d ' ' | grep -o "[^=]*$"`
cp arch/i386/boot/bzImage /boot/mykernel
cp System.map /boot/System.map-${KERNELRELEASE}
cp .config /boot/config-${KERNELRELEASE}
mkinitrd /boot/myinitrd /lib/modules/${KERNELRELEASE}

Note, on SUSE use mkinitrd -k mykernel -i myinitrd instead of the above command.

You will see a few warnings during the kernel build, so don't be overly alarmed. Warnings are just that, warnings, and many stable packages generate them for various reasons. Errors or compilation failures, however, require a complete recompile. Simply issue the command make mrproper and start over. If your kernel won't compile successfully, then your environment is probably goofed. Most likely you're missing some essential development tools. Using your package manager (SUSE yast, Mandrake rpmdrake) check that you have gcc, binutils, glibc, make, ncurses, kernel source, and kernel headers installed (be sure to install all the devel packages for these as well).

Once you've successfully compiled the kernel, edit your grub or lilo configuration (click here for help), reboot your computer, launch a command prompt and enter

depmod -a

www.mamedev.org www.mameworld.info