Wednesday, December 16, 2009

Operating Systems

Assume tht a MM with only 4 pages ,each of 16 bytes,is initially empty.the cpu generates the following sequence of virtual addresses & uses the lru replacement policy.
0 ,4,8,20,24,36,44,12,68,72,80,28,32,88,92
How many page faults?Wht r the page no of the pages pages present in the MM at the end of the sequence.
plz anybody solve this.

solution:- 7 page faults with 1,2,4,5 at the end.......
each page size is 16 bytes..so, these virtual addresses are divided by 16 and so we get as 0 0 0 1 1 2 2 0 4 4 5 5 1 2 5 5 ............. with lru replacement statergy, we will get as 7 page faults.... with 2,5,1,4 at the end.......