Protection mode·Re-recognition

What is protection mode? In the windows environment, there are three ways to work with cpu:

  1. 实模式: It works the same as 8086 (generally when the computer is initialized at boot time), at this time a task exclusively cpu
  2. protect mode: that is, calculate the boot After the state, you can run multiple programs at this time, multi-threaded.
  3. Virtual 8086 mode: the dos program that runs when the computer is in protected mode. At this time, it is in protected mode, that is, it simulates real mode in protected mode, so that the software that can run under 8086 can still run in protected mode. Implementation compatibility.

不说说不说! Protection mode is nothing to know, it is recommended that the browser tab in the upper right corner click X

1.protect mode to protect what? Hardware resources, OS kernel 2. Why protect hardware resources and OS kernel? In the traditional real mode, tasks can access each other, and you can also access system resources and hardware resources 3. What are the protections?

  • 硬件资源: Register CR3 Segment Register TLB GDT IDT TR
  • @OS Kernel: SSDT

4. How to implement protection? 段 Page

保护模式, focusing on the protection of the taskHow come this? In modern operating systems, multi-process multi-threading is implemented, ring3 programs can not access ring0 at will, ring0 code can not read ring3 data freely, process space low 2G memory is virtual space, usually between tasks Can not access each other

protection within the task: 保护模式_段ring3 and ring0 isolationsegment + page

protection between tasks: 这里写图片描述 tasks can not access each other

保护模式概要这里写图片描述

Page mechanism summary这里写图片描述