Project 2

CMSC 421, Fall 2004

 
Points: 75 (65 + 10)
Released on : Sep 30th, 2004
Due               : Oct 20th, 2004

In Project 2, you are required to add a system call to the Linux kernel and write a small program to test this system call. Before you begin, create a custom kernel specific for Project 2, starting with a copy of the pristine Linux kernel linux-2.4.21-20.EL. Name your custom kernel for Project 2 as linux-2.4.21-20.EL-GLUSRNM-project2, where GLUSRNM is your UMBC GL username. (Replace the "custom" in Makefile by "-GLUSRNM-project2".)

Part 1: Adding system calls to the kernel.

The system call should return 1 if successful or 0 if there is any error. Note that the variables max_threads and nr_threads are in the kernel space; where as, the arguments of the system call are addresses in the user-space where it needs to put the information.

Make sure that your system calls have exactly the same signatures as above, (since otherwise our test programs will fail!) Function/variable names are case sensitive. Any kernel panics/failures will result in a very substantial reduction of points. Please go through the hints and pay particular attention to functions you use to copy to/from user/kernel spaces.

Please have the implementation of the system call in separate files.

Part 2: User mode driver and test programs

Write a user mode driver program (driver.c and driver.h) to demonstrate that your system call works correctly. Note that you should use your own test program to test your system calls, to ensure that they work as specified and they can handle all kinds of (good and bad) inputs.

Hints

What to submit

Create and submit a single compressed tar file project2.tar.gz (created using the Linux tar and gzip commands) via blackboard. It should contain the following