CMSC421

PRINCIPALS OF OPERATING SYSTEMS

Section 0101

CSEE
UMBC

Programming Project #1

Assigned: 6 March 2002
Due: 1 April 2002 at 11:59 PM

Goals

This project is intended to get your feet wet with building a linux kernel, installing it, and making changes to the kernel. We assume that you have installed linux, or are in the process of doing so. This document will describe a new function that we want you to add to the kernel as a system call. The exercise is fairly straightforward. The idea is to make sure you understand the mechanics of modifying the kernel.

We assume that you are already familiar with makefiles and debugging from classes such as CMSC 341. If not, this will be a considerably more difficult project because you will have to learn to use these tools as well.

Mechanics, and what to hand in

The project can be done in groups of up to two people, although you are welcome to work alone. If a group works on a project, then we will assign a common score to both participants. Please make sure that the group is identified in the README you turn in, and that only one member of the group submits the project!

You will need to hand in all of the code you create or modify and documentation.

Your design documentation, typically 1-2 pages for a project of this size, should include the basic design of your software (what modules will you write, where will you make changes to the kernel etc.), a timeline, as well as details on the testing that you plan to do to ensure that your code works.

Version of the Kernel and Linux to Use

Because of the problems associated with the differences of hardware that everyone has, there will be no "specified version" to use. Use the one that you have installed. This will mean that some of you will have different problems that others, but we found that the Pentium 4's can not use the UMBC version of Red Hat 6.2. Those people must use a later version! We can not answer every question about all the different versions of Linux and the kernel, but there are several sources available on the Internet. Of course, the Lunix Users Group at UMBC is an excellent source of assistance. Remember though, these sources can not help you with homework specific questions! That is cheating!

Specifics

We ask you to implement two new system calls named mysetkernel and mygetkernel. You will create a variable in the kernel space (to make sure we do not use a label alread in use, call it CMSC421_0101. mysetkernel will have one argument, which will be used to give the variable a new value. mygetkernel will return the current value. Additionally, you must provide a driver to show that the system calls work. The driver should have a set of five (5) set/get calls to show that the calls are working. The function are fairly straightforward, but there are several things you need to keep in mind.

There is one additional requirement! mygetkernel must be implemented as a loadable module. This requirement is not rocket science and the LDP Linux Kernel Module Programming Guide is a good reference.

Helpful Hints

Grading the Project

The intent of the grading for the project is not to differentiate among those students who do a careful design and implementation of the assignments. Rather, the grading helps us identify those students who (i) don't do the assignments or (ii) don't think carefully about the design, and therefore end up with a messy and over-complicated solution. Remember that you can't pass this course without at least making a serious attempt at each of the assignments. Further, the grading is skewed so that you will get substantial credit, even if your implementation doesn't completely work, provided your design is logical and easy to understand. This means that you should first strive to come up with a clean design of your project on paper. Second, don't try to add fancy features because some other group is!

The grading for the project will be as follows: 40% design, 60% implementation. We have structured the grading in this way to encourage you to think through your solution before you start coding. If all you do is to work out a detailed design for what you would do to address the assignment (and if the design would work!), but you write no code, you will still get almost half of the credit for the assignment. The implementation portion of the grade considers whether you implemented your design, ran reasonable test cases, and provided documentation that the TA could understand. Part of being a good computer scientist is coming up with simple designs and easy to understand code; a solution which works isn't necessarily the best that you can do. Another critical success factor is ability to communicate! Thus, part of the design and and easy to understand. implementation grade will be based on whether your solution is elegant, simple, *** There will be 5% extra credit if you can print out the variable before returning from the kernel ***

Additional Resources

The following items are from the Linux Documentation Project and will provide you with additional information:

Rules for Collaboration

This is a pretty straightforward project with a minimal amount of code to be written. We therefore DO NOT expect that there will be occasion for you to discuss solution strategies with others. If you do not do this project yourself, then there is a good chance that you will not learn how to modify the kernel, and will certainly fail when we give you the next, more complex modification of the kernel. You are, of course, free to discuss problems relating to installing Linux. Please recall that academic dishonesty will be sternly dealt with.

UMBC CMSC421