
3. | REAL MODE ARCHITECTURE | . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. | 31 | |||
| 3.1 | Real Mode Introduction | . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. | 31 | ||
| 3.2 | Memory Addressing | . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. | 32 | ||
| 3.3 | Reserved Locations | . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. | 33 | ||
| 3.4 | Interrupts | . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. | 33 | ||
| 3.5 | Shutdown and Halt | . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. | 33 | ||
4. | PROTECTED MODE ARCHITECTURE | . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. | 33 | |||
| 4.1 | Introduction | 33 | |||
| 4.2 | Addressing Mechanism | . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. | 34 | ||
| 4.3 | Segmentation | . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. | 35 | ||
| 4.3.1 | Segmentation Introduction | . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. | 35 | ||
| 4.3.2 | Terminology | . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. | 35 | ||
| 4.3.3 | Descriptor Tables | . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. | 35 | ||
|
| 4.3.3.1 | Descriptor Tables Introduction. . . | . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. | 35 | |
|
| 4.3.3.2 | Global Descriptor Table | 36 | ||
|
| 4.3.3.3 | Local Descriptor Table | 36 | ||
|
| 4.3.3.4 | Interrupt Descriptor Table | . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. | 36 | |
| 4.3.4 | Descriptors | . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. | 36 | ||
|
| 4.3.4.1 | Descriptor Attribute Bits | 36 | ||
|
| 4.3.4.2 | 386 Code, Data Descriptors (S = | 1) | 37 | |
|
| 4.3.4.3 | System Descriptor Formats | 38 | ||
|
| 4.3.4.4 | LDT Descriptors (S = 0, TYPE = | 2) | 39 | |
|
| 4.3.4.5 | TSS Descriptors (S = 0, TYPE = 1, 3, 9, B) | 39 | ||
|
| 4.3.4.6 | Gate Descriptors (S = 0 TYPE = | 39 | ||
|
| 4.3.4.7 | Differences Between 386 and 286 Descriptors | 40 | ||
|
| 4.3.4.8 | Selector Fields | 40 | ||
|
| 4.3.4.9 | Segment Descriptor Cache | . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. | 40 | |
|
| 4.3.4.10 Segment Descriptor Register Settings | 41 | |||
| 4.4 | Protection | . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. | 45 | ||
| 4.4.1 | Protection Concepts | 45 | |||
| 4.4.2 | Rules of Privilege | . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. | 45 | ||
| 4.4.3 | Privilege Levels | . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. | 45 | ||
|
| 4.4.3.1 | Task Privilege | 45 | ||
|
| 4.4.3.2 | Selector Privilege (RPL) | 45 | ||
|
| 4.4.3.3 | I/O Privilege Level and I/O Permission Bitmap | 45 | ||
|
| 4.4.3.4 | Privilege Validation | . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. | 46 | |
|
| 4.4.3.5 | Descriptor Access | 46 | ||
| 4.4.4 | Privilege Level Transfers | . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. | 46 | ||
| 4.4.5 | Call Gates | 49 | |||
|
| 4.4.6 | Task Switching | . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. | 49 | |
|
| 4.4.7 | Initialization and Transition to Protected Mode | 50 | ||
|
| 4.4.8 | Tools for Building Protected Systems. | . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. | 51 | |
| 4.5 | Paging. | . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . | . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. | 51 | |
4.5.1Paging Concepts.. .... .............................................. 51
4.5.2 | Paging Organization | 52 | |
4.5.2.1 | Page Mechanism | 52 | |
4.5.2.2 | Page Descriptor Base Register | 52 | |
4.5.2.3 | Page Directory | 52 | |
4.5.2.4 | Page Tables | 53 | |
4.5.2.5 | Page Directory/Table Entries | 53 | |
4.5.3 | Page Level Protection (R/W, U/S Bits) | 53 | |
4.5.4 | Translation Lookaside Buffer | 54 | |
4.5.5 | Paging Operation | 54 | |
4.5.6 | Operating System Responsibilities | 55 | |
4