两个进程访问同样的逻辑地址物理地址为何不同

1.Linux 段表

In uniprocessor systems there is only one GDT, while in multiprocessor systems there is one GDT for every CPU in the system.

 

2.Linux页表

each process has its own Page Global Directory and its own set of Page Tables. When a process switch occurs Linux saves the cr3 control register in the descriptor of the process previously in execution and then loads cr3 with the value stored in the descriptor of the process to be executed next. Thus, when the new process resumes its execution on the CPU, the paging unit refers to the correct set of Page Tables.

The Copy On Write technique allows both the parent and the child to read the same physical
pages. Whenever either one tries to write on a physical page, the kernel copies its contents
into a new physical page that is assigned to the writing process. The implementation of this
technique in Linux is fully explained in

 linux系统下每个进程都拥有自己的页表,父进程fork出新的子进程时,子进程拷贝一份父进程的页表,且父子进程将页表状态修改为写保护。当父子进程中的进程发生写操作时将会发生缺页异常,缺页异常处理函数将会为父子进程各自分配新的物理地址。所以不同的进程访问同样的逻辑地址而对应的物理地址不同,是由于各自页表的不同。
两个进程访问同样的逻辑地址物理地址为何不同_linghaidong的专栏-CSDN博客_两个物理地址

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值