When the program references memory in a page that is in a frame, which it can tell by examining the present/absent bit, it copies out the physical frame number and inserts that into the MAR of the memory hardware. For a write operation, the dirty bit is set so that when this page is evicted from this frame, the contents will be saved back to the swap area of the disk instead of thrown aware. Reads do not change the dirty bit. A page's dirty bit is initialized to 0 when it is loaded into a frame. If the page is not currently in a frame, then the operating system is called into action. The job is usually suspended until the OS can schedule a convenient time to copy the page. This event is called a page fault, although the program is not really at fault! |