[Previous] [Contents] [Next]

Dev.par

Parallel device driver (QNX)

Syntax:

Dev.par [options] &

Options:

-b number
Use the printer number, as defined by the BIOS, where number can be 1, 2, 3, or 4.
-c
Check open()s. If the printer isn't online and READY, any open()s are refused.
-e
Abort output if the printer is in an error condition.
-f
Send data faster than the IEEE parport specifications.
-N name
Use this prefix for the device name. If a full path (i.e. one which includes the directory under which the device should be registered) is not specified, the name will implicitly be registered under /dev. (default is /dev/par)
-O number
The size of the output buffer (default is 1000 bytes).
-P priority
The priority to run at when printing (default: 9)
-p number
The I/O address (in hex) of the parallel port (required only when using a non-standard parallel port that the BIOS is unable to find).
-s number
Don't wait forever on the printer. Instead, wait at most this many seconds before discarding data.
-w number
Busy-wait on the printer this many microseconds before reverting to periodic polling (default is 1000 microseconds or 1 millisecond).

Description:

The Dev.par driver manages parallel devices in a QNX system.

A unique instance of Dev.par must be started for each parallel device to be supported. Each device must have a unique name, so the -N name option must be specified to each additional driver.

If Dev.par is started without specifying any I/O ports, it uses the first parallel port found by the system BIOS (LPT1). If there aren't any parallel ports, Dev.par terminates.

Normally, Dev.par will busy-wait on a printer at low priority, waiting for the printer to accept new characters. This behavior results in maximum throughput to the printer without significantly impeding overall system response. Nevertheless, it also means that Dev.par will wait forever if the printer ever goes offline (e.g. paper out) until the offline condition is removed (e.g. paper added). Therefore, it is sometimes worthwhile to put a limit on the length of time Dev.par should wait for the printer to go online. To set this timeout, use the -snumber option. If the printer stays offline the specified number of seconds, any pending data is simply thrown away. This is useful in unattended environments where it's preferable to throw away logging output rather than block the logging processes themselves when the output buffers fill up.

The priority at which Dev.par polls the parallel port is 9 by default. To lower (or raise) this, use the -P priority option to specify a different priority.


Note:

Dev.par must be run as root and may not be started until the Device Manager (Dev) has been started.


Examples:

Support LPT1 as /dev/par1:

    Dev.par &

Support LPT2 as /dev/prn1:

    Dev.par -b 2 -N prn &

Support port at 278 hex as /dev/laser1

    Dev.par -p 278  -N laser &

Don't wait on the printer on /dev/par. If the printer remains unavailable for longer than 30 seconds, flush all data:

    Dev.par -s 30 &

Files:

Dev.par closes its standard input, standard output and standard error immediately upon startup.

Dev.par will cause Dev to adopt a single character special file under its directory (/dev). Usually this file will be named /dev/par1, but will be different if the -N is specified with an alternate name.

Exit status:

Dev.par will terminate only upon receipt of a signal or upon encountering a problem during startup.

0
received a SIGTERM signal and performed a clean shutdown
or
no -p port was specified and Dev.par failed to detect any parallel ports on the machine.
12
Failed to mount driver with Dev
19
Failed to arm driver with Dev
23
Failed to register driver with Dev

Note:

A common cause of failure on startup is that Dev has hit its maximum number of devices and rejects the driver's attempt to register. If this happens, increase the value of Dev's -n option.


See also:

Dev, Dev.*, stty

QNX Installation & Configuration


[Previous] [Contents] [Next]