Question: Write a program in C that implements clock policy on a set of 10 frames for page replacement. Generate at least 50 page requests randomly
Write a program in C that implements clock policy on a set of 10 frames for page replacement.
Generate at least 50 page requests randomly where each page number is between 1 and 30. When a page request is generated and the page is present in one of the frames, the R bit of the frame is set to 1. When a page requested is not found and all the frames are full, it is considered a page fault and your program should count the number of page faults. On page fault, the clock algorithm would start from last frame assignment position and look for next frame with R bit as zero, clearing the R bits to zero if they were 1. After the 30 page requests, your program would display the total number of page faults generated.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
