The difference between protection mode and real mode

Source: Internet
Author: User

Real mode: Addressing uses the same 16-bit and offset as 8086, the maximum addressing space 1MB, and the maximum segment 64KB. You can use 32-bit directives. The 32-bit x86 CPU is used for high-speed 8086.

Protection mode: Addressing using 32-bit and offset, maximum addressing space 4GB, maximum segment 4GB (Pentium pre and 64GB later). In protected mode, the CPU can enter the virtual 8086 mode, this is in the protection mode of real-mode program running environment.

The fundamental difference between protected mode and real mode is that process memory is protected or not. The difference between addressable spaces is only the result of this. Real-mode treats the entire physical memory as a segmented area, where program code and data are located in different regions, System programs and user programs are not treated differently, and each pointer is a physical address that points to "reality". As a result, if a pointer to a user program points to a System program area or other user program area and changes the value, the consequences for the modified system program or user program are likely to be catastrophic. To overcome this poor memory management, the processor manufacturer emits protection mode. In this way, the physical memory address can not be directly accessed by the program, the program's internal address (virtual address) to be converted from the operating system to the physical address to access, the program is ignorant of this.
At this point, the process (where we can call the program a process) has a strict boundary, no other process has access to a region of physical memory that does not belong to itself, even within its own virtual address range, because there are virtual areas that have been put into some common system runtime libraries. These areas can also not be arbitrarily modified, if modified will be: SIGSEGV (Linux segment error), Illegal Memory Access dialog box (Windows dialog box).
The CPU boot environment is 16-bit real mode and can then be switched to protected mode. However, you cannot switch back to real mode from protected mode

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.