## Input/Output Device Driver Reference

[prev][next][parent][TOC]

### Overview

The parallel port device drivers service parallel port requests from DOS, WIN-OS/2, and OS/2 applications (including those running under the Presentation Manager). Requests are serialized by the spooler so that mixed printer output will not occur. Printer requests include:

Initializing a parallel port device

Sending characters to a parallel port device

Returning the status of a parallel port device

Handling IOCtl function calls, including the setting of the parallel port device's frame control (characters per line and lines per inch)

In addition, the parallel port device drivers include character device monitor support. The parallel port device driver sends data to a character device monitor, if one is installed.

The primary method of communicating with the parallel port device driver is through a request packet. When the parallel port device driver receives a request packet, it determines which device the request is for. If a request is not already in progress, the physical device driver calls an appropriate routine to handle the request. If a request is in progress, the physical device driver blocks the caller's thread until the in-progress request has completed. Once the in-progress request has been serviced, the physical device driver will run the caller's thread and process the waiting request.

To make a request of the printer, an OS/2 application pushes parameters ( for example, the address of characters to be written) onto its stack, and calls the file system API (for example, DosWrite). The file system:

Determines that the request is for the parallel port device driver (based on the specified device handle)

Creates a request packet

Issues a call to the parallel port device driver strategy routine

To make a request of the printer from a DOS session, an application moves the parameters into predefined registers and issues an INT 17h or INT 21h. The INT 17h is intercepted by the virtual parallel port device driver. Refer to OS/2 Virtual Device Driver Reference for more information. The INT 21h request is converted into a request packet and issued to the device driver strategy routine.