******************************************************* ***** README Sample ****** ***** ( By courtesy of Tim Richards) ****** ******************************************************* Exercise 1 PROBLEM This excercise is used to get one familiar with the proc filesystem. It demonstrates that the various files and directories in /proc are in fact useful for querying kernel variables. The purpose is to show a simple trait of unix like systems, the file abstraction. Much of the important aspects of a unix system can be viewed as a file or directory. The programming goal of this excercise is to write a program that queries these resources in the /proc filesystem and display them in a meaningful manner on the console. DESIGN My design of this program is fairly simple. It consists of a table that maps the type of report to display (short,standard,long) to the reports that are to be generated for that type. The main program consists of a case statement that calls printing functions for each report for the report type. RUNNING The program can be executed as follows, Usage: observer [-s][-l int dur] TIME I did not spend much time on this exercise. It is in fact incomplete according to what was requested from the book. I felt it was a little over kill. Once you understand what the /proc filesystem is useful for, it is really not necessary to implement all the reports. I did find it useful to implement a few exercises. It quickly becomes an exercise in parsing the pseudo files after 3 or 4 reports. LEARNING & SUGGESTIONS As I mentioned above. It was useful for understanding the /proc filesystem. If used in a real course, I would recommend implementing the observer program as an initial exercise. Perhaps using it through out the course to show information regarding the internals that you modify in later exercises. Using it as such makes it not only useful for understanding /proc, but also a useful tool in general for checking your modifications on the kernel. For example, part A simply asks you to inspect the various files under /proc to discover where the various types of information are. Part B would be perfect for a first implementation of the program (perhaps a couple more useful facts about the system). Part C could be used in conjunction with exercises that discuss the scheduler. Part D could be used in conjunction with exercises that discuss the memory manager.