The document discusses protected mode memory addressing in microprocessors. It describes how protected mode allows access to 4GB of memory using 32-bit offsets and segment descriptors. Segment descriptors stored in global and local descriptor tables define memory segment locations, lengths, and access rights. Operating systems like Windows use protected mode and 32-bit environments while DOS uses 16-bit. The microprocessor caches descriptor information from the tables in program-invisible registers associated with segment registers to efficiently access memory segments.
1 of 19
More Related Content
Microprocessor Protected Mode Memory addressing By DHEERAJ KATARIA
2. PROTECTED MODE
MEMORY ADDRESSING
Allows access to data and programs located within & above
the first 1M byte of memory.
Protected mode is where Windows operates.
Offset address can be 32-bit number.
Allows microprocessor to access data within 4G bytes in
length.
3. SELECTORS AND DESCRIPTORS
In place of a segment address, the segment register contains a
selector that selects a descriptor from a descriptor table.
The descriptor is located in the segment register & describes the
location, length, and access rights of the segment of memory.
it selects one of 8192 descriptors from one of two tables of descriptors
In protected mode, this segment number can address any memory
location in the system
for the code segment.
Indirectly, the register still selects a memory segment, but not
directly as in real mode.
4. Global descriptors contain segment definitions that apply to
all programs.
a global descriptor might be called a system descriptor
Local descriptors are usually unique to an application.
local descriptor is known as application descriptor
Format of a descriptor for the 80286 through the Core2.
each descriptor is 8 bytes in length
global and local descriptor tables are a
maximum of 64K bytes in length
DESCRIPTOR TYPES
6. The base address of the descriptor indicates the starting
location of the memory segment.
the paragraph boundary limitation is removed in protected mode
segments may begin at any address
The G, or granularity bit allows a segment length of 4K to 4G
bytes in steps of 4K bytes.
32-bit offset address allows segment lengths of 4G bytes
16-bit offset address allows segment lengths of 64K bytes.
7. Operating systems operate in a 16- or 32-bit environment.
DOS uses a 16-bit environment.
Most Windows applications use a 32-bit environment called
WIN32.
MSDOS/PCDOS & Windows 3.1 operating systems require
16-bit instruction mode.
Instruction mode is accessible only in a protected mode
system such as Windows Vista.
OPERATING SYSTEM
8. The access rights byte controls access to the protected mode
segment.
describes segment function in the system and allows complete
control over the segment
if the segment is a data segment, the direction of growth is specified
If the segment grows beyond its limit, the operating system
is interrupted, indicating
a general protection fault.
You can specify whether a data segment
can be written or is write-protected.
ACCESS RIGHTS BYTE
10. Descriptors are chosen from the descriptor table by the
segment register.
register contains a 13-bit selector field, a table selector bit, and
requested privilege level field
The TI bit selects either the global or the local descriptor
table.
Requested Privilege Level (RPL) requests the access privilege
level of a memory segment.
If privilege levels are violated, system normally indicates an
application or privilege level violation
DESCRIPTOR TABLE
11. The contents of a segment register during protected mode operation
of the 80286 through Core2 microprocessors
12. Segment register, containing a selector, chooses a
descriptor from the global descriptor table.
The entry in the global descriptor table selects a segment in
the memory system.
Descriptor zero is called the null descriptor, must contain all
zeros, and may not be used for accessing memory.
13. Using the DS register to select a description from the global
descriptor table. In this example, the DS register accesses memory
locations 00100000H–001000FFH as a data segment
14. PROGRAM-INVISIBLE REGISTERS
Global and local descriptor tables are found
in the memory system.
To access & specify the table addresses, 80286–Core2
contain program-invisible registers.
not directly addressed by software
Each segment register contains a program-invisible portion
used in the protected mode.
often called cache memory because cache is
any memory that stores information
16. When a new segment number is placed in a segment
register, the microprocessor accesses a descriptor table and
loads the descriptor into the program-invisible portion of
the segment register.
held there and used to access the memory segment until the
segment number is changed
This allows the microprocessor to repeatedly access a
memory segment without referring to the descriptor table.
hence the term cache
17. The GDTR (global descriptor table register) and IDTR
(interrupt descriptor table register) contain the base address
of the descriptor table and its limit.
when protected mode operation desired, address of the global
descriptor table and its limit are loaded into the GDTR
The location of the local descriptor table is selected from
the global descriptor table.
one of the global descriptors is set up to
address the local descriptor table
DESCRIPTOR TABLE REGISTERS
18. To access the local descriptor table, the LDTR (local
descriptor table register) is loaded with a selector.
selector accesses global descriptor table, & loads local descriptor
table address, limit, & access rights into the cache portion of the
LDTR
The TR (task register) holds a selector, which accesses a
descriptor that defines a task.
a task is most often a procedure or application
Allows multitasking systems to switch tasks
to another in a simple and orderly fashion.