Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ zs(4) — NEXTSTEP 1.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

tty(4)

ZS(4)  —  UNIX Programmer’s Manual

NAME

zs − Zilog 8530 Serial Communications Controller

SYNOPSIS

pseudo-devicezs2 init zsintsetup

DESCRIPTION

The zs device provides 2 communication lines with partial modem control, adequate for UNIX dial-in and dial-out use.  These communication lines are identified as Serial A and Serial B on the rear of the NeXT cpu board.  The A and B serial lines directly support differential RS-422 devices.  These lines may also be used with RS-232 devices with the appropriate cables (described below).  Each line attached to the zs communications controller behaves as described in tty(4) and may be set to run at any of 16 speeds; see tty(4) for the encoding.

ZS DEVICE NAMES

Each line may be opened from software by one of three device names.  The device names for serial line A are: /dev/ttya, /dev/ttyda, and /dev/cua.  (There are corresponding names, /dev/ttyb, etc. for serial line B.)  The different device names for the serial line represent different manners of dealing with modem control signals. 

/dev/ttya/dev/ttya (/dev/ttyb) is used for "incoming" connections from directly connected terminals.  When /dev/ttya is open(2)’ed, the device driver asserts the DTR (data terminal ready) signal. Opens of the /dev/ttya device name do NOT block waiting for the RS-232 DCD (carrier detect) signal to be asserted. /dev/ttya should be specified in the file /etc/ttys for directly connected terminals. If a serial line is opened with the /dev/ttya device name, it may not be opened with the /dev/ttyda or /dev/cua device names.

/dev/ttyda/dev/ttyda (/dev/ttydb) is used for "incoming" connections from modems.  When /dev/ttyda is opened, the device driver asserts DTR and then blocks waiting for the modem to assert DCD (indicating that a connection has been established with a remote modem).  When DCD is asserted by the modem the open system call returns.  If DCD is deasserted by the modem, further reads and writes to the device will return the error EIO (i/o error); if the tty is the controlling terminal for the process a SIGHUP will be sent to the process. /dev/ttyda is typically used in the file /etc/ttys for connecting modems used for dial-up logins. If a serial line is opened with the /dev/ttyda device name, it may not be opened with the /dev/ttya. A serial line opened with the /dev/ttyda device name may also be opened with the /dev/cua device name. Interlocks between the /dev/ttyda and /dev/cua device names are described below.

/dev/cua/dev/cua (/dev/cub) is used for "outgoing" connections to auto-dial modems.  When /dev/cua is opened, the device driver asserts DTR and does NOT block waiting for the modem to assert DCD.  No action is taken by the driver when the modem asserts or de-asserts DCD. /dev/cua is typically used by programs like "uucp" and "tip" that need access to auto-dial modems. If a serial line is opened with the /dev/cua device name, it may not be opened with /dev/ttya. A serial line opened with the /dev/cua device name may also be opened with the /dev/ttyda device name. Interlocks between the /dev/ttyda and /dev/cua device names are described below.

ACCESS INTERLOCKS BETWEEN THE /dev/ttyda AND /dev/cua DEVICE NAMES

The /dev/ttyda and /dev/cua (/dev/ttydb and /dev/cub) device names arbitrate access to the serial line in such a manner that a single line and connected auto-dial modem may be used for both dial-up login’s and by software like tip and uucp which need dial-out facilities.  The arbitration rules are:

/dev/cuaThe /dev/cua device name may be opened when the "a" line is not opened by /dev/ttyda or if an open by /dev/ttyda is blocked waiting for the modem to assert DCD.  If /dev/cua gains access to the line, currently blocked opens of /dev/ttyda or future opens of /dev/ttyda will block until /dev/cua is closed.  If /dev/cua is opened when /dev/ttyda has the line opened with DCD asserted, (i.e. the /dev/ttyda open has completed) the open of /dev/cua will return the error EBUSY. 

/dev/ttyda/dev/ttyda may attempt an open at anytime.  If /dev/cua has the line opened, the open of /dev/ttyda will block until /dev/cua has relinquished the line (regardless of the state of DCD).  If the line is not opened by /dev/cua, the /dev/ttyda open will block until DCD is asserted by the modem. 

RECOMMENDED CABLING FOR RS-232 DEVICES

Cube to Modem Cable Mini-DinRS-232

1  (DTR)20 (DTR)
2  (CTS)8  (DCD)
3  (TxD-)2  (TD)
4  (GND)7  (SG)
5  (RxD-)3  (RD)
8  (RxD+)7  (SG)

Cube to Terminal Cable  (Null-modem cable) Mini-DinRS-232

1  (DTR)8  (DCD)
2  (CTS)20 (DTR)
3  (TxD-)3  (RD)
4  (GND)7  (SG)
5  (RxD-)2  (TD)
8  (RxD+)7  (SG)

SPECIAL IOCTLS

The zs driver silos input characters by queueing input immediately at a high interrupt level, and later processing the queue at a lower interrupt level.  The queue is processed when the silo nears full, or within 20 milliseconds of the time that the first character entered the silo. 

The delay to empty the silo may be read or altered by the ioctl’s ZIOCTGET and ZIOCTSET.  These ioctl’s are used to get and set the receiver silo delay, respectively.  Each ioctl takes as the third argument, the address of an int.  ZIOCTGET returns the current receiver silo delay in milliseconds in the int pointed to by the third argument, ZIOCTSET sets the receiver silo delay to the millisecond value pointed to by the third argument.  You must include <nextdev/zsreg.h> to get the definition of these ioctls. 

FILES

/dev/ttya, /dev/ttybdirectly connect terminals
/dev/ttyda, /dev/ttydbincoming modem connections
/dev/cua, /dev/cuboutgoing modem connections

SEE ALSO

tty(4)

DIAGNOSTICS

zs%d: recv buffer overrun.  The software input silo overflowed before it could be serviced.  zs%d: recv uart overrun.  The 8530 receiver silo overflowed before it could be serviced. 

NeXT, Inc.  —  July 6, 1989

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