Homework Assignment #11 – Page Faults


You are expected to do your own work on all homework assignments. You may (and are encouraged to) engage in general discussions with your classmates regarding the assignments, but specific details of a solution, including the solution itself, must always be your own work. (See the statement of Academic Dishonesty on the Syllabus)

How to turn in?

Assignments need to be turned in via Laulima. Check the Syllabus for the late assignment policy for the course.

What to turn in?

You should turn in single plain text file named README.txt with your answers to the assignment’s questions. Your file must be readable “as is” and points will be removed if the report is not readable.


Exercise #1 [42pts]

Consider a system with four page frames and a program that uses eight pages. Consider the reference string 0473230177 and assume that all four page frames are initially empty. Consider the following algorithms:

In each cases show a diagram (ASCII art recommended) that shows which pages are in which frames throughout time, and page faults at the bottom. For instance:

r | 0  1  2  3  4  2  . . .
----------------------------
0 | 0  0  0  0  4  4  . . .
1 | -  1  1  1  1  1  . . .
2 | -  -  2  2  2  2  . . .
3 | -  -  -  3  3  3  . . .
----------------------------
f | X  X  X  X  X  -  . . .

would mean that at step 1 page 0 is referenced and loaded into frame 0, which is a page fault; then page 1 is referenced, and so on. At step 7 page 2 is referenced and is in RAM, so there is no page fault…. The goal is to fill this table to see what in memory when and thus infer the number of page faults.

The first 4 steps are ALWAYS the same (i.e., just fill the four frame, with one page fault each time).