In order for multiple DOS applications, each running in its own VDM, to access physical hardware devices, each VDM must be provided with a set of "virtual interfaces" to these devices, so that the actions of one application do not affect the state of the device as perceived by applications in other VDMs.
Figure "MVDM System Structure Overview"
These virtual interfaces are provided by OS/2 Version 2.0 using virtual device drivers. Virtual device drivers are installable modules responsible for virtualizing the hardware and ROM BIOS aspects of the DOS environment for virtual DOS machines. A virtual device driver manages shared access to hardware I/O devices for multiple VDMs, allowing an application running in a VDM to act as though it exercised sole control over I/O devices. Virtual device drivers are implemented whenever possible, allowing the BIOS in the system to perform its functions without interference from DOS applications. Virtual device drivers are used to control hardware such as the keyboard, mouse, and serial and parallel ports.
Virtual device drivers are responsible for the following functions:
The virtual device driver architecture implemented in OS/2 Version 2.0 provides support for all standard hardware utilized by DOS applications and supports installable virtualization, so that new hardware may be added and supported by VDMs without requiring an upgrade to the operating system.
Virtual device drivers obtain and release system resources via the Virtual Device Helper (VDH) services, provided by the MVDM kernel. A virtual device driver typically performs I/O through a physical device driver using a direct call interface. However, a virtual device driver may directly access an I/O control device. The virtual video device driver performs such direct access under OS/2 Version 2.0 for performance purposes. A virtual device driver may also simulate hardware interrupts into one or many VDM processes.
Under OS/2 Version 2.0, a virtual device driver is inherently protected from a VDM because it is not visible in the VDM address space, although a virtual device driver must be careful to check all parameters coming in from a VDM to ensure that it does not damage itself or some other part of the system by executing an invalid instruction.