0

I'm doing an operating systems course at university and need to implement demand paging as a part of the major project. I've got the idea behind it, but just need to confirm some things.

Suppose physical memory is full, and a frame is chosen as victim to be written to disk, so that something else can be put in its place. When that frame is paged back in, and its old spot in the physical memory has been occupied by other things, does it mean I need to allocate another physical frame to put the old data and update the user's page table, so that from the user's point of view, the virtual memory stays the same but the physical memory has changed? Am I understanding the semantics of demand paging correctly? If not, how is it usually done?

Cheers

Einheri
  • 957
  • 1
  • 9
  • 22
  • 2
    You're right. The page may again be paged back to any frame, and hence the physical address might change, but the virtual address should always be the same. – raghav3276 Sep 30 '14 at 09:57
  • Related http://en.wikipedia.org/wiki/Page_replacement_algorithm and http://stackoverflow.com/questions/10159877/demand-paging-swapping-frames and http://stackoverflow.com/questions/18431261/how-does-x86-paging-work – xmojmr Sep 30 '14 at 11:52

0 Answers0