CS3 Operating Systems 2013-14, Practical Exercise. PHASE 1 ------- Background reading ------------------ First, you should find some general descriptions of the Linux kernel. Many such descriptions may go into more detail than we have so far covered in the course; however, we have reviewed the high-level structure of OSes, which should suffice. At this stage, you can ignore more detailed descriptions of virtual memory structures, etc., although you are of course free to read up on this in advance of lectures. Warning: Linux is a rapidly evolving system. In this exercise, you will be using kernel 2.6.21.1. This is older than the kernel now running on DICE; we're using an older kernel because some of the things we rely on have been locked down in new kernels. (In Linux kernel numbering, the second number is even for production versions, and odd for development versions - 2.6 is the current production series, but some people still use 2.4.) Unfortunately, there is a shortage of good documentation about the 2.6 kernels. However, the basics have not undergone any really dramatic changes, although many of the details have. Most high-level information and quite a lot of detailed information about 2.4 or even 2.2 kernels can be (cautiously) applied to the 2.4 series. Information about earlier releases should be carefully checked before you assume it applies to modern kernels. Suitable descriptions can be found OS textbooks that take Linux as a case study. Stallings does not have a single chapter on Linux, but several chapters contain sections on aspects of Linux: specifically sections 2.7, 4.6, 8.4, 10.3. On the Stallings book website, there is a PDF file collecting together all the Linux information. Silberschatz has a chapter on Linux, of about the right level for this phase. There are also many online resources, which are themselves sufficient. The centre for Linux documentation is The Linux Documentation Project http://www.tldp.org/ You should look round this site, and consider particularly the following items in the "Guides" section: + The Linux Users' Guide. This is a basic introduction to end-user use of Linux, covering such things as the use of the shell, etc. If you are not confident in traditional (i.e. command-line, not GUI) use of Linux, this guide may be useful. (Real system programmers don't use GUIs, of course.) + The Linux Kernel. Although this is very out-dated, it is probably the single most useful online resource (apart from the kernel source itself!). It provides a good description of the 2.0 kernel, and does not assume a great deal of pre-existing technical OS knowledge. You should read this document. + The Linux Kernel Hackers' Guide. This is more outdated, referring to the 1.0 and 1.1 releases. However, it may be useful in conjunction with other documents. + Linux Kernel 2.4 Internals This is the other main online resource. It provides quite detailed information on the implementation of the current kernel. It is written for a fairly expert audience, in a concise and unforgiving style. Note that the scheduler (which is the part we are most likely to look at) has been completely re-written between 2.4 and 2.6 - hence ... + The Linux Kernel Module Programming Guide Since you're going to be writing a kernel module, it's well worth looking through this. And from outside: + Understanding the 2.6.8.1 Linux Scheduler http://joshaas.net/linux/ This is of course a bit out of date, but I don't think there are really serious scheduler changes between 2.6.8 and 2.6.21. There are also several relevant HOWTOs. In particular: + The KernelAnalysis-HOWTO. This is a summary of the 2.4 kernel structure. Read it after reading the more leisurely "The Linux Kernel". + The Kernel-HOWTO. This describes the process of building the kernel. You will not be required to build a kernel, but it will do no harm to get an idea of what is involved.