Protected mode
≈ 5 min read
Names in other languages
No names in other languages are held for this entry yet.
Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.
In computing, protected mode, also called protected virtual address mode, is an operational mode of x86-compatible central processing units (CPUs). It allows system software to use features such as segmentation, virtual memory, paging and safe multi-tasking designed to increase an operating system's control over application software. When a processor that supports x86 protected mode is powered on, it begins executing instructions in real mode, in order to maintain backward compatibility with earlier x86 processors. Protected mode may only be entered after the system software sets up one descriptor table and enables the Protection Enable (PE) bit in the control register 0 (CR0). Protected mode was first added to the x86 architecture in 1982, with the release of Intel's 80286 (286) processor, and later extended with the release of the 80386 (386) in 1985. Due to the enhancements added by protected mode, it has become widely adopted and has become the foundation for all subsequent enhancements to the x86 (IA-32) architecture, although many of those enhancements, such as added instructions and new registers, also brought benefits to the real mode.
In computing, protected mode, also called protected virtual address mode, is an operational mode of x86-compatible central processing units (CPUs). It allows system software to use features such as segmentation, virtual memory, paging and safe multi-tasking designed to increase an operating system's control over application software. When a processor that supports x86 protected mode is powered on, it begins executing instructions in real mode, in order to maintain backward compatibility with earlier x86 processors. Protected mode may only be entered after the system software sets up one descriptor table and enables the Protection Enable (PE) bit in the control register 0 (CR0). Protected mode was first added to the x86 architecture in 1982, with the release of Intel's 80286 (286) processor, and later extended with the release of the 80386 (386) in 1985. Due to the enhancements added by protected mode, it has become widely adopted and has become the foundation for all subsequent enhancements to the x86 (IA-32) architecture, although many of those enhancements, such as added instructions and new registers, also brought benefits to the real mode. MASM program enter protected mode (set PE bit) mov EBX, CR0 ; save control register 0 (CR0) to EBX or EBX, PE_BIT ; set PE bit by ORing, save to EBX mov CR0, EBX ; save EBX back to CR0 clear prefetch queue; (using far jump instruction jmp) jmp CLEAR_LABEL CLEAR_LABEL: With the release of the 386, protected mode could be exited by loading the segment registers with real mode values, disabling the A20 line and clearing the PE bit in the CR0 register, without the need to perform the initial setup steps required with the 286. In real mode each logical address points directly into a physical memory location, every logical address consists of two 16-bit parts: The segment part of the logical address contains the base address of a segment with a granularity of 16 bytes, i.e. a segment may start at physical address 0, 16, 32, ..., 2 20 − 16. The offset part of the logical address contains an offset inside the segment, i.e. the physical address can be calculated as physical_address = segment_part × 16 + offset, if the address line A20 is enabled, or (segment_part × 16 + offset) mod 2 20 , if A20 is off. Every segment has a size of 2 16 bytes. if X = 1 then C is the Conforming bit, and determines which privilege levels can far-jump to this segment (without changing privilege level): if C = 0 then only code with the same privilege level as DPL may jump here; if C = 1 then code with the same or a lower privilege level relative to DPL may jump here. if X = 0 then C is the direction bit: if C = 0 then the segment grows up; if C = 1 then the segment grows down. X is the Executable bit: if X = 1 then the segment is a code segment; if X = 0 then the segment is a data segment. S is the Segment type bit, which should generally be cleared for system segments; DPL is the Descriptor Privilege Level; P is the Present bit; D is the Default operand size; G is the Granularity bit; Bit 52 of the 80386 descriptor is not used by the hardware.
Text derived from https://en.wikipedia.org/w/index.php?oldid=1351428141 under CC BY-SA 4.0; modifications have been made.