User's Manual

17-10 Vol. 3
8086 EMULATION
The processor enters virtual-8086 mode to run the 8086 program and returns to
protected mode to run the virtual-8086 monitor.
The virtual-8086 monitor is a 32-bit protected-mode code module that runs at a CPL
of 0. The monitor consists of initialization, interrupt- and exception-handling, and I/O
emulation procedures that emulate a personal computer or other 8086-based plat-
form. Typically, the monitor is either part of or closely associated with the protected-
mode general-protection (#GP) exception handler, which also runs at a CPL of 0. As
with any protected-mode code module, code-segment descriptors for the virtual-
8086 monitor must exist in the GDT or in the task’s LDT. The virtual-8086 monitor
also may need data-segment descriptors so it can examine the IDT or other parts of
the 8086 program in the first 1 MByte of the address space. The linear addresses
above 10FFEFH are available for the monitor, the operating system, and other system
software.
The 8086 operating-system services consists of a kernel and/or operating-system
procedures that the 8086 program makes calls to. These services can be imple-
mented in either of the following two ways:
They can be included in the 8086 program. This approach is desirable for either
of the following reasons:
The 8086 program code modifies the 8086 operating-system services.
There is not sufficient development time to merge the 8086 operating-
system services into main operating system or executive.
They can be implemented or emulated in the virtual-8086 monitor. This approach
is desirable for any of the following reasons:
The 8086 operating-system procedures can be more easily coordinated
among several virtual-8086 tasks.
Memory can be saved by not duplicating 8086 operating-system procedure
code for several virtual-8086 tasks.
The 8086 operating-system procedures can be easily emulated by calls to the
main operating system or executive.
The approach chosen for implementing the 8086 operating-system services may
result in different virtual-8086-mode tasks using different 8086 operating-system
services.
17.2.3 Paging of Virtual-8086 Tasks
Even though a program running in virtual-8086 mode can use only 20-bit linear
addresses, the processor converts these addresses into 32-bit linear addresses
before mapping them to the physical address space. If paging is being used, the
8086 address space for a program running in virtual-8086 mode can be paged and
located in a set of pages in physical address space. If paging is used, it is transparent
to the program running in virtual-8086 mode just as it is for any task running on the
processor.