Convert logical (virtual) address to physical address

前端 未结 1 650
北海茫月
北海茫月 2020-12-30 18:28

I have the following page table of process1 :

\"enter

相关标签:
1条回答
  • 2020-12-30 18:51

    In your case process 1 currently can access upto 4 * 4k bytes of virtual memory.
    Generally a process can access upto 4gb of virtual memory(depending on the implementation).
    Now the table you have given maps virtual memory to the actual physical address(on RAM).With each entry of page table mapping 4k of memory from virtual to physical space.
    So the physical address where the address 16000 corresponds to the 3rd entry of page table which is mapped to the physical address starting from 8192(3*4096) till 12288 (8192+4096).

    16000 mod 4096 =  3712(offset).
    

    At an offset of 3172 bytes in the virtual page 2 i.e at an offset of 3172 in physical page 3 ( at address 8192) you find the data corresponding to address 16000.
    All these mappings are done by the MMU(memory management unit) for every address access a process makes.
    Good link to understand this concept is here.

    Cheers :)

    0 讨论(0)
提交回复
热议问题