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” an 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
With segmentation, you only need a small
amount of information – the segment descriptor – to share, instead of changing
protection on a large number of pages. In addition, you don’t have to worry
about mapping the code to the same address – the addresses within the code are
relative to the segment, so it can be relocated more easily.
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?
The complexity makes it slow and inflexible – OS’s can’t choose a page table
format or handle TLB misses. The OS had to be more complex to manage both
segments and page tables.