同一虚拟地址如何将用于不同进程的虚拟地址映射到不同的物理地址 [英] How are same virtual address for different processes mapped to different physical addresses

查看:180
本文介绍了同一虚拟地址如何将用于不同进程的虚拟地址映射到不同的物理地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经学习了有关操作系统设计和概念的课程,现在我正尝试全面学习Linux内核.我有一个我无法摆脱的问题.在现代操作系统中,每个进程都有自己的虚拟地址空间(VAS)(例如,在32位系统中为0到2 ^ 32-1).这提供了许多优点.但是在实现过程中,我有时会感到困惑.让我通过一个例子来解释它:

I have taken a course about Operating System design and concept and now I am trying to study Linux kernel thoroughly. I have a question that I cannot get rid of. In modern operating systems each process has own virtual address space(VAS) (eg, 0 to 2^32-1 in 32-bit systems). This provides many advantages. But in the implementation I am confused at some points. Let me explain it by giving an example:

假设我们有两个过程p1,p2; p1和p2具有自己的VAS.地址0x023f4a54映射到不同的物理地址(PA),怎么可能?如何以这种方式完成此翻译.我的意思是我知道转换机制,但是当它涉及到不同进程的地址空间时,我无法理解相同的地址被映射到不同的物理地址.

Let's say we have two processes p1, p2; p1 and p2 have their own VASes. An address 0x023f4a54 is mapped to different physical addresses(PA), how can it be? How is done this translation in this manner. I mean I know translation mechanism but I cannot understand that same address is mapped to different physical address when it comes different processes' address space.

0x023f4a54 in p1's VAS => PA 0x12321321
0x023f4a54 in p2's VAS => PA 0x23af2341 # (random addresses)

推荐答案

感谢所有答案.我不知道的实际要点是,不同进程的相同虚拟地址不会与彼此的物理通讯程序发生冲突.我在下面的链接中找到了答案,每个进程都有自己的页表.

Thanks for all answers. The actual point that i dont know is that how same virtual address of different processes does not clash with each other's physical correspondent. I found the answer in the link below, each process has its own page table.

http://tldp.org/LDP/tlk/mm/memory.html

这篇关于同一虚拟地址如何将用于不同进程的虚拟地址映射到不同的物理地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆