80386 programmer's reference manual Chapter 6 Protection notes

1. Why protection?

Identify and detect bugs.

2. Overview: 5 aspects

Type checking
Limit checking
Restriction of addressable domain
Restriction of procedure entry points
Restriction of instruction set

Protection is a hardware mechanism, applies both to segment translation and to page translation.

3. Segment level protection.

Here we mainly talking about Privilege levels.

Segment descriptor contains a filed called DPL(descriptor privilege level)

Selectors contains RPL(requestor's privilege level)

An internal register contains CPL(current privilege level), usually CPL = DPL, it changes when controls transferred to different segments.

The processor automatically evaluates the right of a procedure to access
another segment by comparing the CPL to one or more other privilege levels.
The evaluation is performed at the time the selector of a descriptor is
loaded into a segment register. The criteria used for evaluating access to
data differs from that for evaluating transfers of control to executable
segments; therefore, the two types of access are considered separately in
the following sections.
DPL >= max(CPL, RPL);

The instructions that affect system data structures can only be executed
when CPL is zero. If the CPU encounters one of these instructions when CPL
is greater than zero, it signals a general protection exception. These
instructions include:
CLTS
HLT
LGDT
LIDT
LLDT
LMSW
LTR
MOV to/from CRn
MOV to /from DRn
MOV to/from TRn


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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值