Building the Linux Kernel with C4
This page outlines the steps needed in order to build the Linux kernel with C4.
Get the files
- You will need a kernel source tree. You can download one from kernel.org. The version of kernel known to work with C4 is 2.6.12.3. It is the latest stable kernel (as of Aug 2,2005). However, you are very welcome to test other versions of the kernel and report the result back to me. Alternatively, you can download a precompiled kernel image and skip to Booting.
- You need an installation of QEMU.
- Download one of the disk images from the disk image.
- Download the kernel Makefile patch from the kernel patch.
Compiling the kernel
If you are using GCC 4.0 and/or Fedora Core, please install GCC 3.4, because there is a bug in GCC 3.3 which will cause it to seg fault, and GCC 4.0 is not yet supported by XTC.
- Apply the kernel patch
- configure the kernel
- Type: make bzImage. It may take a while. To make it faster, you can play around with -j option. Watch out for the memory usage though.
Booting the compiled kernel with QEMU
The following commands are used to boot the compiled kernel image in the QEMU.
- To boot up an image, use the following command:
qemu -nographic -kernel <path-to-kernel-image> -hda <path-to-disk-image> -append "console=ttyS0 root=/dev/hda"
- To enable networking support, use the following command:
qemu -nographic -kernel <path-to-kernel-image> -hda <path-to-disk-image> -append "console=ttyS0 root=/dev/hda" -user-net
- Enabling GDB support, use the following command:
qemu -nographic -kernel <path-to-kernel-image> -hda <path-to-disk-image> -append "console=ttyS0 root=/dev/hda" -s
Disk Image
For your convenience, we've compiled a few kernel images available for download.
| Kernel | Description |
| 2.6.12.5-network | 2.6.12.5 kernel with built-in ethernet driver(NE2000). |
| 2.6.12.3-network | 2.6.12.3 kernel with built-in ethernet driver(NE2000). |
| 2.6.12.3-aspect | 2.6.12.3 with adivce instrumenting on do_fork() and kthread_stop(). |
Kernel Patch
The Makefile patch will incorporate C4 into the Linux Kernel's build system.
| Patch | Description |
| Makefile.build.patch | Invoke C4 during the kernel compilation process. |
