官术网_书友最值得收藏!

Protected mode - segmentation

While it was all fine and simple in real mode, things become a bit more complicated when it comes to protected mode. Unfortunately, memory segmentation is still intact, but the segment register no longer contain addresses. Instead, they are loaded with the so-called selectors, which are, in turn, the indices into the descriptor table multiplied by 8 (shifted 3 bits to the left). The two least significant bits designate the requested privilege level (0 for kernel space to 3 for user land). The third bit (at index 2) is the TI bit (table indicator), which indicates whether the descriptor being referred is in a global descriptor table (0) or in a local descriptor table (1). The memory descriptor is a tiny 8-byte structure, which describes the range of physical memory, its access rights, and some additional attributes:

Table 2: Memory descriptor structure

Descriptors are stored in at least two tables:

  • GDT: Global descriptor table (used by the operating system)
  • LDT: Local descriptor table (per task descriptor table)

As we may conclude, the organization of memory in protected mode is not that different from that in real mode after all.

There are other types of descriptors--interrupt descriptors (stored in the interrupt description table (IDT)) and system descriptors; however, since these are in use in kernel space only, we will not discuss them, as that falls out of the scope of this book.

主站蜘蛛池模板: 津市市| 兖州市| 赣州市| 综艺| 那曲县| 星子县| 葫芦岛市| 宜良县| 禹州市| 抚顺县| 兰考县| 台北市| 都昌县| 遵义县| 灵丘县| 岑溪市| 梓潼县| 大埔区| 隆尧县| 丰宁| 卓尼县| 达州市| 陆河县| 油尖旺区| 噶尔县| 金塔县| 山阳县| 称多县| 潮州市| 蒙城县| 漯河市| 徐水县| 镇原县| 鹤壁市| 娄烦县| 日土县| 横山县| 烟台市| 江山市| 定州市| 临沂市|