Address processToPhysical(pid, Vaddr)
{
PageData *PageTable = AllPageTables[pid];
uint pageno = PageNumberFrom(Vaddr);
uint offset = OffsetFrom(Vaddr);
if (PageTable[pageno].status != Loaded) {
}
uint frame = PageTable[pageno].frameNo;
return frame * P + offset;
}
|