The assignment is due Monday, September 27, beginning of class.
See coding guidelines for suggestions on C style.
You may develop your programs on any system (cunix, home, office, ...) However, your programs must compile and run on the CLIC Solaris or Linux machines, preferably both. In your solutions, indicate which operating system you used.
Please use the "submit" script to submit files for the programming portions of the assignment according to the instructions below:
On-campus students should turn in the hardcopy of their writeups for the assignment before class on the due date. Off-campus (CVN) students should use the normal CVN channels (fax, overnight mail, ...) to submit their homework on the due date.
The script to add setup your userid and module in the CVS repository is available from the CLIC and CS systems. You should invoke this script by entering
Once this script completes, you can login to the CVS repository and complete the exercise using the following guidelines:
your_userid (for the add_cvs_user, CVS login, and import is your CLIC/CS username.
cvs -d :pserver:email@example.com:/home/amini/cvsroot login
Document the steps you took; we will be able to see your sample files.
In addition to importing your code, take the proper steps (described in the CVS documentation) to protect files in your modules from anyone who is not logged into CVS with your userid. We will check your work for exercise 1 through your writeup and through your setup in CVS. However, we will not use files in the CVS repository to grade your programming exercises. You must use the steps described above to turn in your files and writeup.
The default purify only works on Solaris 2.6, /import/pkg/pure-4.5b/purify-4.5-beta-L4-solaris2/purify for Solaris 2.7
In your assignment, describe the output of purify (e.g., via a screen dump) and indicate the errors you found in the sample program.
If you allocate memory, the malloc routines do not allocate chunks of arbitrary size (say, 17 or 23 bytes). Rather, they create chunks of some multiple number of bytes, to reduce fragmentation. The details depend on the particulars of the malloc library. Also, the sbrk or brk functions will be executed periodically to change the data memory boundary (see the man pages for these functions). Again, they generally aren't called for each call to malloc, but rather with larger increments.
Use truss to find out (a) how often the lower-layer read() function is called; (b) what increments are used to allocate memory.
Provide the source code, show the output of truss and your measurement results.
Provide the source code and the output of gprof and interpret the results.