OS/2 communicates with devices through special programs called device drivers. A device driver acts as an interface between OS/2, together with its applications, and a physical device such as the keyboard, mouse, or printer. The device driver sends data to and receives data from a device, resolving device-independent requests from applications with the device-specific attributes of the device.

The primary method of communication between OS/2 and a device driver is request packets. OS/2 receives I/O requests from applications and sends data in the form of request packets to the device driver. The device driver communicates with the device either directly or through the BIOS and ABIOS interfaces. (Applications can communicate with device drivers also, by using DosDevIOCtl. See IOCtl Interface)

Devices work differently depending on the device driver installed. For example, if an application writes to the system console, each byte is interpreted as a character and is displayed on the screen. If, however, the ANSI display driver is loaded, some byte sequences direct the system to carry out certain actions on the screen, such as moving the cursor or clearing the screen. These byte sequences are called ANSI escape sequences.

Some devices are available to applications only if the appropriate device driver is installed. For example, an application cannot open a serial port unless a communications device driver, such as COM.SYS, has been loaded by using a DEVICE= command in CONFIG.SYS.


[Back] [Next]