Developing Virtual Device Drivers (C, OS/2 only)

A virtual device driver is essentially a DLL. It is responsible for presenting a virtual copy of the hardware resource to a DOS session and for coordinating physical access to that resource.

To achieve a certain level of hardware independence, a virtual device driver usually communicates with a physical device driver to interact with hardware. For example, the OS/2 operating system provides both virtual and physical device drivers for the mouse and keyboard.

User-supplied virtual device drivers simulate the hardware interfaces of an option adapter or device, and are usually used to migrate existing DOS applications into the OS/2 DOS environment.

You may need to create a virtual device driver if multiple sessions must share access to a device where the input and output is not based on file handles, or if the particular device requires that interrupts be serviced within a short period of time.

To Build a Virtual Device Driver
To create virtual device drivers, specify build options link(dllinitinstance, no) and link(dllterminstance, no) or the directive target[vdd]filename in your configuration file.

In earlier versions of VisualAge C++, you needed to link virtual device drivers by placing a statement in your module definition (.DEF) file. This is no longer necessary.



Create Code to Run at Ring Zero


Convert Module Definition Files


Virtual Device Driver Calling Conventions
Using _Far32 _Pascal Function Pointers