In the Windows environment, the CPU works in three ways: Real mode: Same as 8086 work (usually when the computer is initialized at boot time), at this time a task exclusive CPU
Protection mode: That is, calculate the status after the boot, you can run multiple programs, multi-threaded.
Virtual 8086 mode: A DOS program that runs when the computer is in protected mode, in protected mode, which simulates the real mode in protected mode, so that the previous 8086 can run the soft Can be run in protected mode for compatibility.
80386 compared to 8086来 said, the addressing mechanism changed, because 80386 need to be able to find a larger address, so the previous segment address: The offset address is not enough space, so a new mechanism is used directly with a general register to address (64-bit), Because of the Windows Protection mechanism (restrictions on the operation), the system needs to know the information of each segment (such as whether it is readable and writable), so as to better perform the protection, there is a paragraph description table, the information of the segment is stored as a table, and then the segment register to address (segment register is called the segment descriptor), This adds two registers, the GDTR (Global descriptor Table), and the LDTR (local description table), which are ldtr positioned through the paging mechanism of Windows.
Windows on the processing of interrupts can not be 8086, Windows to the user's actions have some permissions, user-level code can not use the system-level code, it is certainly not like 8086, you can easily change the interrupt program, 80386 provides a door to access the interrupt program, The low-level program calls the high-level program, only through the door to invoke, so 80386 added a register IDTR, used to store the IDT (Interrupt description table) address.
The 80386 is more flexible than the 8086 addressing, and can also change the address of the interrupt description table, but it also restricts the user's operation.
80386 and 8086 differences and protection modes