[prev] 32 [next]

Address Mapping

Mapping from process address to physical address:

Address processToPhysical(pid, Vaddr)
{
   PageInfo pages[] = getPageInfo(pid);
   uint pageno = Vaddr / PageSize;  // int div
   uint offset = Vaddr % PageSize;
   return pages[pageno].mem + offset;
}


Computation of pageno,offset is efficient if Pagesize == 2n


Note that we assume PageInfo entries with more information ....