CS 635 PROJECT 1 Due Date: Noon Friday 02/14/2003 The purpose of this initial project is to refamiliarize the student with the use of standard C library functions in application programs and to introduce the student to the programming boilerplate for Linux kernel modules. PROJECT STATEMENT Create a 'wizard' application (named 'newdrvr.cpp') which can write the essential C-language source-code 'boilerplate' for a Linux character device-driver module when supplied by your user with a suitable name for the new module, entered as a command-line argument; for example: newdrvr mymod In this example the textfile created by your wizard should have the name 'mymod.c'. It should be possible to compile this module in HRN-235 with the command: make mymod.o It should be possible to install, or remove, the resulting driver-module using the usual shell-commands: /sbin/insmod mymod.o /sbin/rmmod mymod The character-driver produced by your wizard should implement 'skeleton' functions for the 'read', 'write', 'open' and 'release' methods. These routines should simply contain 'printk()' statements which can serve to verify that your functions were being called properly by the kernel. While installed, it should be possible to 'test' your driver-module with simple I/O redirection commands, such as: echo "Hello" > /dev/mymod cat /dev/mymod (The 'dmesg' command may be used to view the output from your 'printk()' statements in the logfile of kernel messages.) SUGGESTIONS You may modify the demo-program named 'newmod.cpp' distributed in class (and available on our course website) so that it will incorporate these required character-driver functions. http://nexus.cs.usfca.edu/~cruse/cs635/ _______________________________________________________________________ (c) Allan B. Cruse University of San Francisco Spring 2003