Files: ------------ clock_testfile ---------------------- a test file for clock algorithm with 4 pages of 32 bytes each and time interval set to 4. Does the following: loads 4 pages in the 4 frames: read page 0 read page 1 read page 2 read page 3 Note that since time interval is set to 4, all read bits will be clear after these four lines. Next the first three pages are accesses - this makes sure the read bits are set and the read bit for page 3 is not set: read page 0 read page 1 read page 2 Now we repeat 5 times: read page 4 read page 0 read page 1 read page 2 read page 5 read page 0 read page 1 read page 2 At the beginning of this loop, page 4 must be placed somewhere, since the read bit is set for pages 0,1 and 2, it ends up in physical page 3. Next pages 0,1 and 2 are accessed (all HITS). Then page 5 is accessed - once again it is placed in physical page 3, then pages 0,1 and 2 are accessed again (to prevent them from being booted). The overall result is that there are the four initial faults, then every access to pages 4 and 5 is a fault, for a total of 14 faults. > ./hw4 -n 4 -t 4 -p 32 -a clock < clock_testfile Page Size: 32 # page frames: 4 Replacement Algorithm: clock Lines processed: 47 Memory operations: 47 Faults: 14 If we change the number of page frames to 8, each virtual page causes a single page fault (total of 6 faults): ./hw4 -n 8 -t 4 -a clock < clock_testfile Page Size: 32 # page frames: 8 Replacement Algorithm: clock Lines processed: 47 Memory operations: 47 Faults: 6