
CHAPTER 6
MEMORY MANAGEMENT AND VIRTUAL ADDRESSING
In Protected Virtual Address Mode, the 80286 provides an advanced architecture that retains substan- tial compatibility with the 8086 and other processors in the 8086 family. In many respects, the baseline architecture of the processor remains constant regardless of the mode of operation. Application programmers continue to use the same set of instructions, addressing modes, and data types in Protected Mode as in Real Address Mode.
The major difference between the two modes of operation is that the Protected Mode provides system programmers with additional architectural features, supplementary to the baseline architecture, that can be used to good advantage in the design and implementation of advanced systems. Especially noteworthy are the mechanisms provided for memory management, protection, and multitasking.
This chapter focuses on the memory management mechanisms of Protected Mode; the concept of a virtual address and the process of
6.1 MEMORY MANAGEMENT OVERVIEW
A memory management scheme interposes a mapping operation between logical addresses (Le., addresses as they are viewed by programs) and physical addresses (i.e., actual addresses in real memory). Since the logical address spaces are independent of physical memory (dynamically relocatable), the mapping (the assignment of real address space to virtual address space) is transparent to software. This allows the program development tools (for static systems) or the system software (for reprogrammable systems) to control the allocation of space in real memory without regard to the specifics of individual programs.
Application programs may be translated and loaded independently since they deal strictly with virtual addresses. Any program can be relocated to use any available segments of physical memory.
The 80286, when operated in Protected Mode, provides an efficient
Memory management, then, consists of a mechanism for mapping the virtual addresses that are visible to the program onto the physical addresses of real memory. With the 80286, segmentation is the key to virtual memory addressing. Virtual. memory is partitioned into a number of individual segments, which are the units of memory that are mapped into physical memory and swapped to and from secondary storage devices. Most of this chapter is devoted to a detailed discussion of the mapping and virtual memory mechanisms of the 80286.
The concept of a task also plays a significant role in memory management since distinct memory mappings may be assigned to the different tasks in a multitask or