CS3 Operating Systems 2013-14, Practical Exercise. INTRODUCTION ------------ This practical exercise starts in week 3, and runs until week 8, with a final submission deadline of 16:00 Friday 8 November 2013. The submission mechanism will be electronic, by the "submit" command. No other form of submission will be accepted. The practical instructions will be issued in three phases. Phase 1 ------- In the first phase, you will be asked to do some background reading. You will be given instructions on using the VirtualBox emulator, and expected to become familiar with it. You will take a first look at the Linux kernel source, and at the kernel build procedure. During this phase, you should work on revising and extending your knowledge of C. The key concepts that differ from Java are structs and pointers. You should also aim to get a general understanding of Makefiles and the kernel build procedure, although no detailed knowledge of this will be needed. The main objectives and intended outcomes for phase 1 are: + [course objective] understanding of the basic structure of the Linux kernel, and how that structure is reflected in the structure of the source code + [course objective] understanding of the virtual machine concept as provided by VirtualBox + [transferable skills] basic C skills + [transferable skills] use of online resources for system programming Time: about 2 weeks, continuing into phase 2. Phase 2 ------- In this phase, you will be be given instructions on how to build a kernel module that can be loaded into a running kernel. You should study appropriate documentation (key references will be given) to ensure that you understand the supplied module template, and you will need to ensure that you can successfully compile a module, transfer it to your VirtualBox system, and load it into the running kernel. You will continue your acquisition of basic C knowledge, and you will be asked to look at one component of the Linux kernel source in more detail. Main objectives and intended outcomes: + [course objective] understanding of the principle of modular kernel design, as implemented in Linux + [course objective] deeper understanding of one component of the Linux kernel and its relation to the general presentation in lectures. + [transferable skills] continuing basic C skills Time: about 1 week. Phase 3 ------- Phase 3: in the final phase, which will produce the assessed result of the exercise, you will be asked to write a module to perform a specific function (possibly purely information gathering) connected to the kernel component studied in phase 2. You will submit your final module code; it will be automatically tested, and manually reviewed for style. ***Your code must compile in the specified environment. ***If your code contains any hidden dependencies on another system, ***and therefore fails to compile, it will receive a fail mark. Main objectives: + to demonstrate your successful attainment of the Phase 1 and 2 objectives + to reinforce your understanding of operating system implementation Time: about 1 week. Permissible collaboration ------------------------- The primary purpose of this practical is educational. However, it also contributes to your mark for this course. Therefore the following policy on collaboration applies: During Phases 1 and 2, you are permitted, and actively encouraged, to discuss any aspect of the exercise, whether in person with each other, or via the course newsgroup. During Phase 3, you should be working mainly on your own. That means that the module code you submit must be your own code, produced without significant assistance from others. The following forms of collaboration and discussion are permitted: + asking for assistance (from each other or the newsgroup) with any problems you have with the C language or the compilation process; + asking a colleague to help you debug your code by, for example, listening to you talk through it and trying to spot mistakes; + asking for assistance using any debugging facilities provided by the system. If you have any question or difficulty that does not obviously fall into the above categories, you should ask it publicly on the newsgroup, and I will determine a suitable public answer. Using other machines -------------------- The practical material will be provided to you in the DICE file system, and the instructions will assume that you are working on a DICE workstation. You are welcome to do the practical on a home machine. However, if you do this, you must be aware that: + I will not provide any support or assistance in transferring the practical to another system + you will need to copy several hundred megabytes of files to your home machine + your final submitted code must compile and run, unmodified, in the specified environment.