For each process its entry in the process manager's process table and also its entry in the kernel's process table contains a data structure to keep track of the segments for that process:
/* Memory map for local text, stack, data segments. */ struct mem_map { vir_clicks mem_vir; /* virtual address */ phys_clicks mem_phys; /* physical address */ vir_clicks mem_len; /* length */ };
Addresses and segment lengths are both expressed in
clicks rather than bytes. Check the definition in the
source code to determine the number of bytes in a click. (I found
it to be different than stated in the text.) Memory is allocated in
integral multiples of this unit. Given access to a process's
mem_map
structure, a segment, and a virtual address in
that segment, it straightforward to to translate the virtual
address to a physical address.