I am trying to understand the concept of NRU from the following link. I have got some problem in understanding the text below:
NRU page replacement Algorithm
If the hardware does not have these bits, they can be simulated as follows. When a process is started up, all of its page table entries are marked as not in memory. As soon as any page is referenced, a page fault will occur. The operating system then sets the R bit (in its internal tables), changes the page table entry to point to the correct page, with mode READ ONLY, and restarts the instruction. If the page is subsequently written on, another page fault will occur, allowing the operating system to set the M bit and change the page's mode to READ/WRITE.
I have bolded the text. I have two problems: Page fault occurs if the page is not in memory but the above text says that (a)the page fault occurs at the time of modifying or writing the page? I can’t understand that. (b) Also I cant understand the text “, allowing the operating system to set the M bit and change the page's mode to READ/WRITE.” What is meant by READ/WRITE? If we are setting the M bit then it should be WRITE mode only? Why the text says READ/WRITE mode. Somebody please guide me.