Since the early age of computers operating systems (OS) have been playing a vital role in the software stack. The operating system is a software layer at the bottom of the software stack that extracts a high level abstraction of the underlying hardware, implements resource management and offers a variety of services into the layers that sit on top of it. Although programs can run directly on top of the hardware this is a rare case that usually can been seen only in embedded systems. Programming exactly above the “bare metal” machine adds more complexity to the programmers and requires a better understanding of the hardware.
The modern operating systems consist of a program so called kernel. The main functionality of the kernel is to handle the Central Processing Unit (CPU), the memory accesses and the input/output (I/O) requests. The software that is implemented as part of the kernel run in the context so called kernel space whereas the software on top of it in the so called user space. This comes from the memory abstraction that the kernel provides to applications (in this context applications can be considered the software implemented on top of the kernel). Running in the kernel space gives programmers privileged access to the hardware that in many cases is restricted from the user space, thus several functionalities can be implemented only inside the kernel space. Moreover, since the kernel is at the bottom of the software stack, it can dramatically affect the performance of the applications in many cases.
Currently, one of the most widely used operating systems (especially in the server environments) is the Linux OS, that consist of the Linux kernel. The Linux kernel, initially written from Linus Torvalds, follows the principles found in the Unix-kernel and it is published under the GNU General Public License version 2 (GPLv2). In this software lab you will learn the basics for Linux kernel development. At the end of this course you should be able to write your own kernel module.
This software lab will be given in English.
This software lab is suitable for advance undergraduate and graduate students of the Computer Science department. It requires advanced knowledge C programming language. Moreover, familiarity with basic Linux (Unix) utilities such as ls, rm, grep, tar. Use of available text editors (e.g, Vim, emacs.). Experience with any major Linux distribution. Students of other departments are also welcome.
In the first weeks of the lectures we will recap all the required knowledge for this software lab. Then we will introduce the basic concepts and principles of Linux Kernel programming. Later, the participants will have to present specific aspects of Linux Kernel programming. Short assignments will be given to students during the semester. At the end of the semester the students will also have to work on a short project.
Presentations given by the lecturers:
– Above presentations are licensed under the Creative Commons Attribution 4.0 International License.
Presentations given by the students*:
* two hours per presentation.
You are advised to have face to face meetings with your supervisor in the beginning/meantime if you need help or solve questions. To do so, arrange in advance an appointment with your corresponding supervisor.
It is recommended to use a virtual machine to solve your assignments since you can easily crash your system. However, compiling the kernel will take considerably longer. You are free to choose whichever virtualization solution you prefer (https://www.linux-kvm.org, https://www.virtualbox.org, https://www.vmware.com). Use CentOS 7.0 http://www.centos.org.
Memory layout: http://mylinuxbook.com/linux-processes-part2/
Virtual memory in Linux (kernel): http://www.makelinux.net/ldd3/chp-15-sect-1
C-Workshop / Tutorial: http://wr.informatik.uni-hamburg.de/_media/teaching/wintersemester_2011_2012/c-workshop.zip
Shell-Programming Bash-Intorduction: https://help.ubuntu.com/community/Beginners/BashScripting http://wiki.ubuntuusers.de/Shell/Bash-Skripting-Guide_f%C3%BCr_Anf%C3%A4nger
Makefile tutorial: http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/ GNU Make Manual: http://www.gnu.org/software/make/manual/make.html