首页 > 其他 > 详细

关于CR0寄存器

时间:2014-02-26 22:12:18      阅读:935      评论:0      收藏:0      [点我收藏+]

    开始的时候,我认为CR0.WP如果被置位,那么内存的页面只读属性将会失效,导致可以被写入数据。

    这几天正好碰到一个问题,查看了资料才发现,之前的理解不完整。

    引用Intel手册中的一句话:

    CR0.WP allows pages to be protected from supervisor-mode writes. If CR0.WP = 0, supervisor-mode write accesses are allowed to linear addresses with read-only access rights; if CR0.WP = 1, they are not. (User-mode write accesses are never allowed to linear addresses with read-only access rights, regardless of the value of CR0.WP.) Section 4.6 explains how access rights are determined, including the definition of supervisor-mode and user-mode accesses.

    很显然,CR0.WP位只用于内核模式,在用户模式下不管CR0.WP是什么值,它对一个只读虚拟内存的写访问是不会成功的。

关于CR0寄存器,布布扣,bubuko.com

关于CR0寄存器

原文:http://www.cnblogs.com/emissary/p/3568324.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!