# Andrew S. Tanenbaum (OS) Edition 4 Exercise 3 Question 52 (Page No. 260 - 261)

106 views

Write a program that simulates a toy paging system that uses the $\text{WSClock}$ algorithm. The system is a toy in that we will assume there are no write references (not very realistic), and process termination and creation are ignored (eternal life). The inputs will be:

• The reclamation age threshhold
• The clock interrupt interval expressed as number of memory references
• A file containing the sequence of page references
1. Describe the basic data structures and algorithms in your implementation.
2. Show that your simulation behaves as expected for a simple (but nontrivial) input example.
3. Plot the number of page faults and working set size per $1000$ memory references.
4. Explain what is needed to extend the program to handle a page reference stream that also includes writes.

## Related questions

1
145 views
Write a program that simulates a paging system using the aging algorithm. The number of page frames is a parameter. The sequence of page references should be read from a file. For a given input file, plot the number of page faults per $1000$ memory references as a function of the number of page frames available.
We consider a program which has the two segments shown below consisting of instructions in segment $0,$ and read/write data in segment $1.$ Segment $0$ has read/execute protection, and segment $1$ has just read/write protection. The memory system is a demand- paged virtual memory system ... $16$ Fetch from segment $1,$ page $4,$ offset $28$ Jump to location in segment $1,$ page $3,$ offset $32$
A machine-language instruction to load a $32-bit$ word into a register contains the $32-bit$ address of the word to be loaded. What is the maximum number of page faults this instruction can cause?
It has been observed that the number of instructions executed between page faults is directly proportional to the number of page frames allocated to a program. If the available memory is doubled, the mean interval between page faults is also doubled. Suppose that a normal instruction ... which time it gets $15,000$ page faults, how long would it take to run if twice as much memory were available?