Is Write-Only Memory a Real Thing in Hardware Design?

  • Thread starter Thread starter zak100
  • Start date Start date
  • Tags Tags
    Fault Writing
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
3 replies · 2K views
zak100
Messages
462
Reaction score
11
TL;DR
Hi,
I am trying to understand the concept of NRU from the following link. I have got some problem in understanding the text below:
https://www.informit.com/articles/article.aspx?p=25260&seqNum=3
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 can't 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.

Zulfi.
 
Physics news on Phys.org
LOL your question invokes an age-old joke among programmers, the "write-only-memory". Just the concept used to send programmers rolling on the floor with laughter.

Look at it this way. If a page has only been read, then the page entry can be given up without writing anything back to main memory. However, as soon as the page is modified, the page entry can not be given up before the cache contents are written back to main memory.

What are all the possible states of a page?
How would you keep track of those states using bits?
When does the OS care what the state is?
 
Hi my friend, thanks for your reply.

Your reply was LOL for me because I asked one question and now you are asking 3 questions.
<What are all the possible states of a page?>
4.
00, 01, 10, 11
<
How would you keep track of those states using bits?>

Maybe by storing in some array or just by looking at the 2 bits.

<When does the OS care what the state is?>
At the time of page fault because all the memory frames might be full and we are requesting a page which is not in main memory, so we have replace a page in the frame with a page from virtual memory.

My problem not yet solved.

Zulfi.
 
anorlunda said:
LOL your question invokes an age-old joke among programmers, the "write-only-memory". Just the concept used to send programmers rolling on the floor with laughter.

Programmers might laugh but hardware guys design it.

https://en.wikipedia.org/wiki/Write-only_memory_(engineering)
In 1972, WOM, an antithesis of read-only memory (ROM), was introduced as an inside practical joke perpetrated by Signetics.[1] However, it was soon recognized that this concept actually describes certain functionalities in microprocessor systems.[2]
 
  • Haha
Likes   Reactions: anorlunda