previous | start | next

Minix 3 Address Translation Function

The virtual_copy function calls umap_local to translate a virtual address for a process to a physical address.

The equivalence between using the Data segment and the Stack segment just noted ignores the fact that an address could fall in the gap between the two segments. Since the Intel processor hardware is only being used by Minix 3 to protect the whole memory allocated to a process, the processor just considers the gap just to be part of the single Intel segment. The umap_local function is careful if the segment number passed in indicates D or S. It assumes the consecutive address (Intel) segment and checks whether the address is really in the data, stack, or gap and returns invalid (0) if it is in the gap. Otherwise, umap_local uses the correct segment D or S and makes the usual protection check on the virtual address va assumed to reference a multibyte data that extends through virtual address vc:

     va >> CLICK_SIZE < mem_vir + mem_len
and
     vc >> CLICK_SIZE < mem_vir + mem_len


previous | start | next