CS 401/CS 746
(Linux) Kernel Programming
Spring 2016
Exercise #1
The aim of this exercise is to setup a machine for kernel programming and to get familiar with the kernel compilation and installation procedure.
Tasks
- Setup a machine or a virtual machine to be used for the kernel programming course.
If you have a single work machine, I would recommend installing a virtual machine on your laptop/desktop. The VM can then become your playground for kernel programming.
Candidates for VMs are kvm, virtualbox and maybe xen and vmware.
If you choose to operate with a VM based setup, the first step is to create and start a virtual machine.
Note, the VM will need network connectivity with the outside world and possibly access to shared storage (at least with the host machine). - Once a machine or a virtual machine is setup, the next step is to download the
Linux kernel source, build it and use it as a separate installation.
- Where do i get the kernel source?
kernel.org - Which kernel version?
4.3.3
- Where do i get the kernel source?
- Complete the installation by adding the compiled version of the kernel to the bootloader
(grub, or lilo etc.).
What is the installation (build = compile + install) procedure?- Get source
- Extract source archive (to local or in some home directory)
- Install development tools and configure kernel
- Compile and install the kernel
- Update boot loader
- Reboot and select your kernel. Welcome to compiled-and-installed-a-kernel land.
- Submit a step-by-step process in which the above was achieved, including
commands used and main files created, and other
software and hardware details.
- Submit answers to following questions,
- What is the purpose of each of the following files created during
the kernel build process?
System.map-4.3.3, config-4.3.3, vmlinuz-4.3.3, initrd.img-4.3.3 - Where are the above files stored?
- Where is the grub menu list stored? Specifiy the full pathname and also a snapshot of the file showing entry for the kernel you built.
- What is the purpose of each of the following files created during
the kernel build process?
- Submission due via moodle.
- A in-class demo is required.
Reference links:
- http://www.cyberciti.biz/tips/compiling-linux-kernel-26.html
- http://kernelnewbies.org/KernelBuild
- http://www.linuxtopia.org/online_books/linux_kernel/kernel_configuration/ch05.html