
80386
31 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
| OS |
|
|
|
|
|
|
|
| U | R |
|
PAGE FRAME ADDRESS 31 ..12 |
| RESERVED |
| 0 | 0 | D | A | 0 | 0 | - | - | P | |
|
|
|
|
|
|
|
|
|
|
| S | W |
|
Figure 4-21. Page Table Entry (Points to Page)
4.5.2.4 PAGE TABLES
Each Page Table is 4K bytes and holds up to 1024 Page Table Entries. Page Table Entries contain the starting address of the page frame and statistical information about the page (see Figure
4.5.2.5 PAGE DIRECTORY/TABLE ENTRIES
The lower 12 bits of the Page Table Entries and Page Directory Entries contain statistical information about pages and page tables respectively. The P (Present) bit 0 indicates if a Page Directory or Page Table entry can be used in address translation. If P = 1 the entry can be used for address translation if P= 0 the entry can not be used for translation, and all of the other bits are available for use by the software. For example the remaining 31 bits could be used to indicate where on the disk the page is stored.
The A (Accessed) bit 5, is set by the 80386 for both types of entries before a read or write access occurs to an address covered by the entry. The D (Dirty) bit 6 is set to 1 before a write to an address covered by that page table entry occurs. The D bit is undefined for Page Directory Entries. When the P, A and D bits are updated by the 80386, the processor generates a
The 3 bits marked OS Reserved in Figure
The (User/Supervisor) U/S bit 2 and the (Read/ Write) R/W bit 1 are used to provide protection attri- butes for individual pages.
4.5.3Page Level Protection (R/W, U/S Bits)
The 80386 provides a set of protection attributes for paging systems. The paging mechanism distin- guishes between two levels of protection: User which corresponds to level 3 of the segmentation based protection, and supervisor which encompass- es all of the other protection levels (0, 1, 2). Pro- grams executing at Level 0, 1 or 2 bypass the page protection, although segmentation based protection is still enforced by the hardware.
The U/S and R/W bits are used to provide Us- er/Supervisor and Read/Write protection for individ- ual pages or for all pages covered by a Page Table Directory Entry. The U/S and R/W bits in the first level Page Directory Table apply to all pages de- scribed by the page table pointed to by that directory entry. The U/S and R/W bits in the second level Page Table Entry apply only to the page described by that entry. The U/S and R/W bits for a given page are obtained by taking the most restrictive of the U/S and R/W from the Page Directory Table Entries and the Page Table Entries and using these bits to address the page.
Example: If the U/S and R/W bits for the Page Di- rectory entry were 10 and the U/S and R/W bits for the Page Table Entry were 01, the access rights for the page would be 01, the numerically smaller of the two. Table
Table
U/S | R/W | Permitted | Permitted Access | |
Level 3 | Levels 0, 1, or 2 | |||
|
| |||
0 | 0 | None | Read/Write | |
0 | 1 | None | Read/Write | |
1 | 0 | Read/Write | ||
1 | 1 | Read/Write | Read/Write |
However a given segment can be easily made read- only for level 0, 1, or 2 via the use of segmented protection mechanisms. (Section 4.4 Protection).
53