Virtual Numeric Coprocessor Device Driver

The virtual numeric coprocessor device driver VNPX.SYS provides virtualization of the 80287/80387 numeric coprocessor hardware, allowing access to numeric coprocessor facilities by multiple DOS applications running in virtual DOS machines.

OS/2 Version 2.0 provides a physical device driver for the numeric coprocessor, within the operating system kernel. At system initialization time, VNPX registers a number of hooks with the physical device driver, so that VNPX is informed whenever a numeric coprocessor exception or emulation trap occurs. Handling routines are also registered with the Virtual DOS Machine Manager, and are invoked upon VDM creation and termination. Coprocessor I/O ports visible to V86 mode applications are hooked by VNPX.

VNPX is informed by the physical device driver at initialization time, whether VDMs are permitted to use the coprocessor. Upon VDM creation, VNPX sets the equipment summary flag for the numeric coprocessor according to the information received at initialization time. In the event of the coprocessor being unavailable to DOS applications, the equipment summary flag is turned off. An application interrogating the flag will therefore assume that no coprocessor is present, and take appropriate action.

The first time an application in a VDM executes a coprocessor instruction within a particular timeslice, an exception condition (Trap 0007) occurs. The exception handler sets a flag within the physical device driver before allowing processing of the instruction to continue. This flag is checked at task switch time and if it is set, the coprocessor state is saved by the physical device driver. Note that the save operation takes place only if the coprocessor is used by an application during its timeslice; for those applications which do not use the coprocessor, no action is taken. This allows optimum performance during task switching.


[Back: Virtual Printer Device Driver]
[Next: Virtual Programmable Interrupt Controller]