Old kernels have less code. So They are easier to learn and understand. I follow the instructions here: http://www.oldlinux.org/. You can also download the eBook in the website(In Chinese).
I managed to run the kernel in Hardy(8.04) and Lucid(10.04) using Bochs simulator. In Ubuntu, you may install it by typing:
You may encounter syntax error using the including bochs configure file. Refer to a sample one found in /usr/share/doc/bochs/examples/bochsrc.gz. Basically, you should specify the image path of your floppy(kernel image) and harddisk like:
Note that Ubuntu kernels build with debugging information on, which makes the resulting kernel modules (*.ko files) much larger than they would otherwise be (linux-image*.deb will be 200-300 MB instead of 20-30 MB). To turn this off, go into “Kernel hacking”; then, under “Kernel debugging”, turn off “Compile the kernel with debug info”.
It’s outdated maybe. When building kernel 2.6.24.x in Hardy, It WAS 200-300MB. But in Lucid, it is always 20-30MB. When you turn off the option, the build process took 80min instead of 100min, and 800MB instead of 5G storage. The option is configured by “CONFIG_DEBUG_KERNEL” in .config file.
After all, two files were generated. It contains 2772 modules. You may find the usage of “–append-to-version” and “–revision” options here:
*) linux-headers-2.6.33.4-custom_2.6.33.4-1_i386.deb
*) linux-image-2.6.33.4-custom_2.6.33.4-1_i386.deb
The last 2 lines are NOT mentioned in the wiki. They are used to generate the initrd image in Lucid. The build also do not generate abi and vmcoreinfo files in /boot.
Add option “skipmodule=true” to the last command line. If you got:
1
2
get_debug_info: Can't create a handle for a new debug session.
makedumpfile Failed.
Add option “no_dumpfile=true” to the last command line. And there will be no vmcoreinfo-2.6.32-22-core2 file.
5. Done:
I found that Lucid has 2675 driver modules while Hardy has only 1921. It seems the kernel was greatly enhanced between the two releases.
My T60 has a Duo Core 1.83G CPU. It took about 90 minutes to finish. The kernel also consumed about 4G storage T.T. After all, two *.deb files were generated:
*) linux-headers-2.6.32-22-core2_2.6.32-22.33_i386.deb
*) linux-image-2.6.32-22-core2_2.6.32-22.33_i386.deb
6. Others:
Since the build process used so much storage, I was monitor my available disk space from time to time using “df” utility. I found the “free space” is about 500M larger than “available space”. What happened? Then I found the answer here: http://ubuntuforums.org/showthread.php?t=328786&page=3 . We can use “tune2fs” utility to set the size of reserved space:
Set the percentage of the filesystem which may only be allocated by privileged processes. Reserving some number of filesystem blocks for use by privileged processes is done to avoid filesystem fragmentation, and to allow system daemons, such as syslogd(8), to continue to function correctly after non-privileged processes are prevented from writing to the filesystem. Normally, the default percentage of reserved blocks is 5%.
Hardy(8.04) is a little different from all the other versions when building a kernel. Only Hardy has two packages for kernel installation: linux-image, linux-ubuntu-modules. If you do not install the latter one, your sound card and network card will can not be recognized.
Today, I built the kernel from the ubuntu source(not the original kernel source). So, I could use the including debian scripts for convenience. Here’s the steps:
> /home/gonwan/Documents/linux-2.6.24 is not clean, please run 'make mrproper'
> in the '/home/gonwan/Documents/linux-2.6.24' directory.
Run the following command, it is issued by the Makefile:
1
# rm -rf .config include/config
5. Done:
My PC has a P4-2.6c CPU. It took about 90 minutes to finish. The kernel also consumed about 2G storage. After all, three *.deb files were generated:
*) linux-headers-2.6.24-27-core2_2.6.24-27.69_i386.deb
*) linux-image-2.6.24-27-core2_2.6.24-27.69_i386.deb
*) linux-image-debug-2.6.24-27-core2_2.6.24-27.69_i386.deb
This time, it took 30 minutes and consumed 300M storage. Two *.deb files were built:
*) linux-headers-lum-2.6.24-27-core2_2.6.24-27.45_i386.deb
*) linux-ubuntu-modules-2.6.24-27-core2_2.6.24-27.45_i386.deb
9. Install kernel:
Just double-click or install using the dpkg utility. Here’s my screen-shot: