OS Assignment -7: Udaydeep Thota Student ID: 010025210 8.5 What is the effect of allowing two entries in a page table to point to the same page frame in memory? Explain how this effect could be used to decrease the amount of time needed to copy a large amount of memory from one place to another. What effect would updating some byte on the one page have on the other page? Ans: If the two entries in a page table point to the same page frame in the memory, then the users can use the same code or sometimes data in the future. For example if two users wish to use the same code, then instead of loading the code two times in to the table, one user can load it in to one table initially and later the other user who would like to use that code access the same memory location. This will help both the users to fast access to memory, less time consumed for context switching and hence overall effective memory management is done. The main disadvantage in adopting to this type of technique is that in case of one user updates the data in the table, then the changes would be reflected to other user who uses the same memory as well. Hence there may be inconsistency between the users who wish to modify and those who would not like to modify it. 8.11 Given six memory partitions of 300 KB, 600 KB, 350 KB, 200 KB, 750 KB, and 125 KB (in order), how would the first-fit, best-fit, and worst-fit algorithms place processes of size 115 KB, 500 KB, 358 KB, 200 KB, and 375 KB (in order)? Rank the I tried answering this question myself: " Yes, we can. Allowing 2 entries can share data, modify code, and memory space can be saved. However, whoever access it and change it can affect others’ copy;" However, I am unable to answer the "why or why not" part: why can we allow 2 entries.....? Pls let me know if you have an answer. Thank you!!!!
So you can compute the page number and offset using just shift and mask operations
Because every address a process uses is translated by its page table, so it can't "utter" address in another process. The operating system could allow it access by: 1. Setting up entries for the physical pages use by other processes in its page table 2. Providing a system call for reading/writing from other processes This is probably a good idea - it allows cooperating processes to communicate very quickly and cheaply.
4.
9.14 Explain why it is easier to share a reentrant module
using segmentation than it is to do so when pure paging is used 5. 9.17 Consider the Intel address-translation scheme shown in figure 9.21 �
Describe all the steps taken to translate a virtual
address to a physical address The address is split into a segment descriptor and an offset. The descriptor indexes into the segment table (either global or local), which produces an address that is added to the offset to produce the linear address. This linear address is translated in a two level page table - the top 10 bits in the page global directory, and the middle 10 bits in the page table, which produces a physical page number that is added to the lower 12 bits of the address to produce the physical address. � What are the advantages to the OS of hardware that provides such complex memory-translation hardware? The advantage is that the OS can provide protection both through segmentation and paging - it doesn't have to choose just one. �
Are there any disadvantages? If so, what? If not,
why doesn't everybody do it?
|