Due Monday, 1999 December 06.
The project is to write a program collecting and displaying computer and operating system statistics. This is a good review of several topics we have covered in this course.
The project is to write a program that collects and display the following categories of computer and operating system statistics: cpu specifications, interrupt queue statistics, systemwide memory use statistics, kernel statistics, and process information.
More specifically, your program should display
Your program should also have the capability to display a list of processes with enough information displayed that the user could determine the process ID of an interesting process.
Your program need only be concerned with real user IDs, not effective user IDs. To convert a uid to a name, you can use the getpwuid(3) command.
Your program need only work for Linux 2.2 or higher on a computer science machine with one processor. Please format times in understandable formats, e.g., hh:mm:ss; consider using library functions. Feel free to ignore fractions of seconds when appropriate.
Implement the user interface as you see fit. For example, you can use FLTK or some other toolkit to wrap the program in a window with menus. Alternately, you can write a text-based program using command-line arguments to specify behavior or even directly query the user. It's your choice.
The Fast Light Tool Kit is a GNU Library General Public License C++ tool kit to ``wrap windows'' around programs running under X, OpenGL, and Win32. Parsing command-line arguments can be simplified using the Gnu Libc argp interface. See the info pages for Gnu's libc, then choose Process Startup, Program Arguments, Parsing Program Arguments, Argp.
There are several different ways to obtain the information to display:
Although the /proc directory is one of Linux's contributions to the art of operating system implementation, it is not well documented. Information can be found at /usr/src/linux-2.2.5/Documentation/proc.txt (also available here) and in the proc(5) manual page. When features are not documented, it can be useful to resort to just cating the desired /proc files.
Reading through the source code of Linux (or other operating systems') and of application programs with similar functionality for examples how to write the program is considered unethical and will probably increase the amount of time necessary to complete the assignment.
Use any programming language you desire. In fact, perl may be the best language for this assignment.
When programming, be sure to turn on all compiler warnings possible to illuminate as many issues as possible. This will greatly increase the possibility your program is correct and portable. When using gcc and g++, use the -Wall option. I do not know what the Java options are.
To minimize your workload, use as many library functions as possible. Depending on the language you use, information is available on UNIX manual pages, info pages (use the UNIX command info), WWW pages, and books. For more specific information, come see me, telling me for what you desire, and what language you are using.
Program and test the various pieces of your code before adding new features. This helps narrow down the region where errors can be occurring.
To check your program's correctness, compare your program's output to that of free(1), top(1), and gtop(1).
You can work in groups of up to three people. Grades will be assigned primarily according to correctness and functionality. Adequate documentation of the project and the code will assist in assigning partial credit (but, again, grades will primarily be assigned according to correctness and functionality).
Here is a possible point distribution:
compilation, no memory leaks, etc. | 5-15 points |
easily understood user interface | 10-20 points |
functionality and correctness | 65-85 points |
total | 100 points |
We do not have time for grading to be interactive. Just make sure your program works.
Use anonymous ftp to atlas03 to submit your program's source code.
Submit to
ftp://atlas03.cs.trinity.edu/pub/joldham/4320/pp3/.
If you need to package together several files, use
tar(1).
Here is one way to submit your program:
ftp atlas03.cs.trinity.eduUse ``anonymous'' as your password.
cd pub/joldham/4320/pp3 put <source-code> bye