Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

tip(1)

uucp(1C)

ldterm(7)

termio(7)

ttcompat(7)

zs(7)

NAME

zs − Zilog 8530 SCC serial communications driver

SYNOPSIS

#include <fcntl.h>
#include <sys/termios.h>
open("/dev/ttyn", mode);
open("/dev/ttydn", mode);
open("/dev/cuan", mode);

DESCRIPTION

The Zilog 8530 provides two serial input/output channels that are capable of supporting a variety of communication protocols.  A typical system uses two or more of these devices to implement essential functions, including RS-423 ports (which also support most RS-232 equipment), and the console keyboard and mouse devices. 

The zs module is a loadable STREAMS driver that provides basic support for the 8530 hardware, together with basic asynchronous communication support.  The driver supports those termio(7) device control functions specified by flags in the c_cflag word of the termios structure and by the IGNBRK, IGNPAR, PARMRK, or INPCK flags in the c_iflag word of the termios structure.  All other termio(7) functions must be performed by STREAMS modules pushed atop the driver.  When a device is opened, the ldterm(7) and ttcompat(7) STREAMS modules are automatically pushed on top of the stream, providing the standard termio(7) interface. 

The character-special devices /dev/ttya and /dev/ttyb are used to access the two serial ports on the CPU board.  The Sun-4/330 platform supports two additional 9-pin RS-423 interfaces that are accessed through the character-special devices /dev/ttyc and /dev/ttyd.  These ttyn devices have minor device numbers in the range 0 − 3. 

By convention these same devices may be given names of the form /dev/ttydn, where n denotes which line is to be accessed.  Such device names are typically used to provide a logical access point for a dial-in line being used with a modem. 

To allow a single tty line to be connected to a modem and used for both incoming and outgoing calls, a special feature, controlled by the minor device number, is available.  By accessing character-special devices with names of the form /dev/cuan it is possible to open a port without the Carrier Detect signal being asserted, either through hardware or an equivalent software mechanism.  These devices are commonly known as dial-out lines and have minor numbers 128 greater than their corresponding dial-in lines. 

Once a /dev/cuan line is opened, the corresponding tty, or ttyd line cannot be opened until the /dev/cuan line is closed; a blocking open will wait until the /dev/cuan line is closed (which will drop Data Terminal Ready, after which Carrier Detect will usually drop as well) and carrier is detected again, and a non-blocking open will return an error.  Also, if the /dev/ttydn line has been opened successfully (usually only when carrier is recognized on the modem) the corresponding /dev/cuan line can not be opened.  This allows a modem to be attached to, for example, /dev/ttyd0 (renamed from /dev/ttya) and used for dial-in (by enabling the line for login in /etc/inittab) and also used for dial-out (by tip(1) or uucp(1C)) as /dev/cua0 when no one is logged in on the line. 

IOCTLS

The standard set of termio ioctl() calls are supported by zs. 

If the CRTSCTS flag in the c_cflag is set, output will be generated only if CTS is high; if CTS is low, output will be frozen.   If the CRTSCTS flag is clear, the state of CTS has no effect.  Breaks can be generated by the TCSBRK, TIOCSBRK, and TIOCCBRK ioctl() calls.  The modem control lines TIOCM_CAR, TIOCM_CTS, TIOCM_RTS, and TIOCM_DTR are provided. 

The input and output line speeds may be set to any of the speeds supported by termio.  The speeds cannot be set independently; when the output speed is set, the input speed is set to the same speed. 

ERRORS

An open() will fail if:

ENXIO The unit being opened does not exist. 

EBUSY The dial-out device is being opened and the dial-in device is already open, or the dial-in device is being opened with a no-delay open and the dial-out device is already open. 

EBUSY The unit has been marked as exclusive-use by another process with a TIOCEXCL ioctl() call. 

EINTR The open was interrupted by the delivery of a signal. 

FILES

/dev/tty{a,b,c,d} hardwired tty lines

/dev/ttyd[0-3] dial-in tty lines

/dev/cua[0-3] dial-out tty lines

SEE ALSO

tip(1), uucp(1C), ldterm(7), termio(7), ttcompat(7)

DIAGNOSTICS

zsnc: silo overflow.
The 8530 character input silo overflowed before it could be serviced.

zsnc: ring buffer overflow.
The driver’s character input ring buffer overflowed before it could be serviced.

SunOS 5.1/SPARC  —  Last change: 24 May 1992

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