Home |
RTTarget-32 Programming Manual Running Win32 Programs without Win32 Protected Mode Descriptors and Descriptor Tables Virtual, Linear, and Physical Addresses Running a Program on the Target Compiling and Linking with On Time RTOS-32 |
Protected ModeThis mode was first introduced with the 80286 processor. The differences between this mode and real address mode are Protection and a larger address space. Except for some very minor differences, the instruction set available in protected mode is the same as in real mode. Segment registers are interpreted differently than in real mode. They hold Selectors, which are indices into one of two tables, the Global Descriptor Table (GDT) or the Local Descriptor Table (LDT). These tables contain Segment Descriptors. Each descriptor contains information about a Segment in memory. This information includes the start address (Base), size (Limit), access rights, etc., of the segment. Each time a segment register is loaded by the processor, the information about the corresponding segment is loaded from one of the two tables. Every memory reference to the segment is executed by retrieving the base of the segment and adding the offset to the base. Memory protection is also implemented using the segment descriptors. First, the processor checks whether a value loaded in a segment register references a valid descriptor. Then it checks that every linear address calculated actually lies within the segment. Also, the type of access (read, write, or execute) is checked against the information in the segment descriptor. Whenever one of these checks fails, exception (interrupt) 13 (hex 0D) is raised. This exception is called a General Protection Fault (GPF). Descriptors and Descriptor Tables Virtual, Linear, and Physical Addresses
|