
CMSI 387
OP E R A T I N G SY S T E M S
Spring 2007
Assignment 0412
This assignment should cap off your study of memory management.
Not for Submission
Read Chapters 8 and 9 in SGG.
For Submission
Exercises
Do the following exercises from SGG; submit your
answers in hardcopy.
1. SGG Exercise 9.3
2. SGG Exercise 9.4
3. SGG Exercise 9.5
4. SGG Exercise 9.14
5. SGG Exercise 9.15
Programming
Write the following mini-programs and commit
them to CVS. To keep interfaces and tests uni-
form, header and test harness files have been
committed to your respective CVS repositories.
1. Paged memory:
a. Implement a rudimentary paged memory
manager as specified by the page.h and
pageTest.c files that have been committed to
your /homework/cmsi387/page directory.
b. Add a myTest() function to the pageTest.c test
harness that designates a new page table and
additional test cases. A call to myTest() is al-
ready part of pageTest.c’s main() function.
2. Segmented memory:
a. Implement a rudimentary segmented memory
manager as specified by the segment.h and
segmentTest.c files that have been committed to
your /homework/cmsi387/segment directory.
b. Add a myTest() function to the segmentTest.c test
harness that designates a new page table and
additional test cases. A call to myTest() is al-
ready part of segmentTest.c’s main() function.
3. Virtual memory page replacement:
a. Implement FIFO and LRU page replacement
algorithms (essentially SGG Exercise 9.21) as
specified by the pageReplacement.h and
pageReplacementTest.c files that have been com-
mitted to your /homework/cmsi387/page-repl
directory. These functions are structured so
that they accept a reference string then pro-
duce a “report” showing how memory alloca-
tions changed for that reference string.
b. A dd a myTest () functio n to the
pageReplacementTest.c test harness that desig-
nates a new page table and additional test
cases. A call to myTest() is already part of
pageReplacementTest.c’s main() function.
Commit your work “in place” at their preloaded
locations and tag it as hw-0412.