Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

open(2)

write(2)

mcpp(7)

NAME

mcpp − ALM-2 Parallel Printer port driver

SYNOPSIS

#include <fcntl.h>
#include <sys/mcpio.h>
open("/dev/mcppn", mode);

DESCRIPTION (PARALLEL PORT)

The parallel port is Centronics-compatible and is suitable for most common parallel printers.  Devices attached to this interface are normally handled by the line printer spooling system and should not be accessed directly by the user. 

The printer devices reside on a separate major device number from the serial devices.  Minor device numbers in the range 0 − 7 access the printer, and the recommended naming is /dev/mcpp[0-7]. 

IOCTLS

Various control flags and status bits may be fetched and set on an ALM-2 printer port.  The following flags and status bits are supported; they are defined in sys/mcpio.h:

MCPRIGNSLCT 0x02 set if interface ignoring SLCT− on open
MCPRDIAG 0x04 set if printer port is in self-test mode
MCPRVMEINT 0x08 set if VME bus interrupts are enabled
MCPRINTPE 0x10 print message when out of paper
MCPRINTSLCT 0x20 print message when printer offline
MCPRPE 0x40 set if device ready, cleared if device out of paper
MCPRSLCT 0x80 set if device online (Centronics SLCT asserted)

The flags MCPRINTSLCT, MCPRINTPE, and MCPRDIAG may be changed; the other bits are status bits and may not be changed. 

The ioctl() calls supported by ALM-2 printer ports are listed below. 

MCPIOGPR The argument is a pointer to an unsigned char.  The printer flags and status bits are stored in the unsigned char pointed to by the argument. 

MCPIOSPR The argument is a pointer to an unsigned char.  The printer flags are set from the unsigned char pointed to by the argument. 

ERRORS

Normally, the interface only reports the status of the device when attempting an open(2) call.  An open() on a /dev/mcpp∗ device will fail if:

ENODEV The unit being opened does not exist. 

ENXIO The device is offline or out of paper. 

Bit 17 of the configuration flags may be specified to say that the interface should ignore Centronics SLCT− and RDY/PE− when attempting to open the device, but this is normally useful only for configuration and troubleshooting: if the SLCT− and RDY lines are not asserted during an actual data transfer (as with a write(2) call), no data is transferred. 

FILES

/dev/mcpp[0-7] parallel printer port

SEE ALSO

open(2), write(2)

DIAGNOSTICS

Printer on mcppn is out of paper

Printer on mcppn paper ok
Assorted printer diagnostics, if enabled as discussed above.

SunOS 5.4  —  Last change: 8 Mar 1993

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026