next up previous
Next: Differences between Windows3.1 Up: Memory Architecture of Previous: 80286

80386

Barrier of 16-bit displacement in a segment no longer exists in 80386. Each segment can now have up to 4GB in length. A segment register points to an entry in the descriptor table which contains 32-bit base address of the segment and 20-bit limit. The limit is the length of the segment, but its unit is different in whether 80386 is running 16-bit application or 32-bit. In the former case the limit is in byte (hence a segment is up to 1MB), and is in page (4096 bytes) in the latter case (up to 4GB).

Virtual memory in 80386 is a 2-level paging system. A virtual memory address is divided into three parts; bit 31 to 22, 21 to 12 and 11 to 0. The first part is used as an index to the first level page table, called Page Table Directory. The base address of Page Table Directory is stored in the register CR3 and reloaded at every context switching. The second part is the index to the the Page Table (actually the second level) of which base address is pointed by the Page Table Directory entry.

In addition to pointers to the next level, both Page Table Directory entry and Page Table entry have the following information bits:

D bit
Dirty bit, the page has been modified.
A bit
Accessed bit, the page has been referenced.
P bit
Presence bit, the page is in the main memory.
U/S bit
User/Supervisor bit, protecting operating system's pages from users' accesses.
R/W bit
Read/Write bit, access mode protection.

D bit and A bit are used to select a page to be replaced. Although [8] says the replacement policy is LRU, it is actually Not Recently Used (NRU).



next up previous
Next: Differences between Windows3.1 Up: Memory Architecture of Previous: 80286



Hitoshi Oi
Wed Dec 20 23:53:45 EST 1995