Update Booting/linux-bootstrap-2md.md

This commit is contained in:
hailin cai
2016-02-05 11:52:18 -05:00
parent 34411dbbbb
commit 4b6827722d

View File

@@ -120,8 +120,9 @@ lgdt gdt
```
从上面的表格我们可以看出当第43位是`0`的时候,这个段描述符对应的是一个数据段,如果该位是`1`那么表示这个段描述符对应的是一个代码段。对于数据段第424140位表示的是(*E*扩展,*W*可写,*A*可访问对于代码段第424140位表示的是(*C*一致,*R*可读,*A*可访问)。 *A*ccessible) or CRA(*C*onforming *R*eadable *A*ccessible)。
* if E(bit 42) is 0, expand up other wise expand down. Read more [here](http://www.sudleyplace.com/dpmione/expanddown.html).
* if W(bit 41)(for Data Segments) is 1, write access is allowed otherwise not. Note that read access is always allowed on data segments.
* A(bit 40) - Whether the segment is accessed by processor or not.
* C(bit 43) is conforming bit(for code selectors). If C is 1, the segment code can be executed from a lower level privilege e.g. user level. If C is 0, it can only be executed from the same privilege level.
* R(bit 41)(for code segments). If 1 read access to segment is allowed otherwise not. Write access is never allowed to code segments.
* 如果`E` = 0数据段是向上扩展数据段反之为向下扩展数据段。关于向上扩展和向下扩展数据段可以参考下面的[链接](http://www.sudleyplace.com/dpmione/expanddown.html).
* 如果`W` = 1说明这个数据段是可写的否则不可写。所有数据段都是可读的。
* A位表示该内存段是否已经被CPU访问。
* 如果`C` = 1说明这个代码段可以被第优先级的代码访问比如可以被用户态代码访问。反之如果`C` = 0说明只能同优先级的代码段可以访问。
* 如果`R` = 1说明该代码段可读。代码段是永远没有写权限的。