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

In summary, the conversation discusses the concept of simulating missing bits in hardware. It explains that a page fault occurs when a page is not in memory, and the operating system sets the R bit and changes the page's mode to READ ONLY upon referencing. If the page is modified, another page fault occurs and the M bit is set, allowing the mode to be changed to READ/WRITE. The conversation also touches on the joke about write-only-memory and the practical applications of this concept in microprocessor systems.
  • #1
zak100
462
11
TL;DR Summary
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.
 
Technology news on Phys.org
  • #2
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?
 
  • #3
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.
 
  • #4
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 anorlunda

1. What is NRU: Page fault on writing?

NRU (Not Recently Used) is a page replacement algorithm used by operating systems to manage virtual memory. A page fault on writing occurs when a process attempts to write to a page that is not currently in main memory, and the operating system must retrieve it from secondary storage.

2. What causes NRU: Page fault on writing?

This type of page fault is caused by a process attempting to write to a page that is not currently in main memory. This can happen when the page has been swapped out to secondary storage, or if it has never been accessed before.

3. How does NRU handle page faults on writing?

When a page fault on writing occurs, the operating system will check the NRU bit of the page to determine its recent usage. If the page has not been recently used, it will be replaced with a page from secondary storage. If the page has been recently used, the operating system will attempt to find a free page in main memory to use.

4. What are the advantages of using NRU for page replacement?

One advantage of using NRU is that it is relatively simple and efficient to implement. It also takes into account the recent usage of pages, which can help to reduce the number of page faults and improve performance.

5. Are there any limitations of NRU for page replacement?

One limitation of NRU is that it does not consider the frequency of page accesses, only the recent usage. This can result in pages that are frequently accessed being replaced, which can decrease performance. Additionally, it may not work well with certain types of workloads, such as those with varying levels of page usage.

Similar threads

  • DIY Projects
Replies
6
Views
317
Replies
3
Views
2K
  • Programming and Computer Science
Replies
7
Views
3K
  • Differential Equations
Replies
1
Views
694
  • Computing and Technology
Replies
14
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
10
Views
1K
  • Quantum Interpretations and Foundations
Replies
27
Views
2K
  • Math Proof Training and Practice
3
Replies
100
Views
7K
  • Programming and Computer Science
Replies
29
Views
3K
Back
Top