Previous Table of Contents Next

The Line Control Model

The line control model for Solaris 2.x system software is different from that of Solaris 1.x releases. The files /etc/gettytab and /etc/ttytab have been removed. Line settings are now stored in the /etc/ttydefs file and in the ttymon configuration files. Table 9-3 compares the Solaris 1.x and Solaris 2.x line control models.

Table 9-3 Comparison of Solaris 1.x and Solaris 2.x Line Control Models

Feature Solaris 1.x File Solaris 2.x File
Database descriptor /etc/termcap /etc/terminfo /etc/terminfo
Set terminal I/O operation stty (BSD) stty (SVR4)
Line settings and sequences /etc/gettytab /etc/ttytab /etc/ttydefs
Administer tty definitions ttydef(1M)

Figure 9-4 shows how the terminal control and the SAF interact. The init program starts sac, which controls the ttymon port monitor. In turn, ttymon monitors serial port devices. It connects incoming requests to services, which are usually login processes. Port monitors keep a close watch over the device or network transport, add and delete services, and start and stop services at the appropriate time. You can use the stty and tput commands to configure the terminal I/O settings to match the characteristics of the terminal. When ttymon gets a character from the terminal, it starts a login to the terminal. When the user logs out, ttymon hangs up to recycle the serial port and waits for another service request.

Figure 9-4  Terminal control architecture.

The /etc/ttydefs File

The /etc/ttydefs file defines baud rates and terminal settings for tty ports. When you set up modems, you use the ttyadm -l ttylabel argument as part of the pmadm command-line argument in order to specify information about the baud rate and the modem settings. The ttylabel variable specifies the first field for an entry in the /etc/ttydefs file. When ttymon initializes a port, it uses the information from the /etc/saf/pmtag/_pmtab file to search the /etc/ttydefs file for an entry that contains the ttylabel that matches the ttylabel for the port. The ttydefs file is similar to the old gettydefs file. Each entry in the /etc/ttydefs file has five fields, which are separated by colons.

  The ttylabel field contains the ttylabel that matches the port.
  The initial-flags field contains the initial terminal input and output settings.
  The final-flags field contains the terminal input and output values set by ttymon after a connections request is made but before the port service is started.
  The autobaud field allows ttymon to determine the line speed of the TTY port by analyzing the first Return received and setting the speed accordingly. To enable autobaud, the field must contain the character A. If the field is empty, autobaud is disabled.
  The nextlabel field is used to specify a hunt sequence that links speeds together in a closed set. For example, 4800 may be linked to 1200, which is linked to 2400, which is linked to 4800. If the current ttydefs entry does not provide a compatible line speed, the next speed in the sequence is tried. The default /etc/ttydefs file follows:

castle% more /etc/ttydefs
460800:460800 hupcl:460800 hupcl::307200
307200:307200 hupcl:307200 hupcl::230400
230400:230400 hupcl:230400 hupcl::153600
153600:153600 hupcl:153600 hupcl::115200
115200:115200 hupcl:115200 hupcl::76800
76800:76800 hupcl:76800 hupcl::57600
57600:57600 hupcl:57600 hupcl::38400
38400:38400 hupcl:38400 hupcl::19200
19200:19200 hupcl:19200 hupcl::9600
9600:9600 hupcl:9600 hupcl::4800
4800:4800 hupcl:4800 hupcl::2400
2400:2400 hupcl:2400 hupcl::1200
1200:1200 hupcl:1200 hupcl::300
300:300 hupcl:300 hupcl::460800

460800E:460800 hupcl evenp:460800 evenp::307200
307200E:307200 hupcl evenp:307200 evenp::230400
230400E:230400 hupcl evenp:230400 evenp::153600
153600E:153600 hupcl evenp:153600 evenp::115200
115200E:115200 hupcl evenp:115200 evenp::76800
76800E:76800 hupcl evenp:76800 evenp::57600
57600E:57600 hupcl evenp:57600 evenp::38400
38400E:38400 hupcl evenp:38400 evenp::19200
19200E:19200 hupcl evenp:19200 evenp::9600
9600E:9600 hupcl evenp:9600 evenp::4800
4800E:4800 hupcl evenp:4800 evenp::2400
2400E:2400 hupcl evenp:2400 evenp::1200
1200E:1200 hupcl evenp:1200 evenp::300
300E:300 hupcl evenp:300 evenp::19200

auto:hupcl:sane hupcl:A:9600

console:9600 hupcl opost onlcr:9600::console
console1:1200 hupcl opost onlcr:1200::console2
console2:300 hupcl opost onlcr:300::console3
console3:2400 hupcl opost onlcr:2400::console4
console4:4800 hupcl opost onlcr:4800::console5
console5:19200 hupcl opost onlcr:19200::console

contty:9600 hupcl opost onlcr:9600 sane::contty1
contty1:1200 hupcl opost onlcr:1200 sane::contty2
contty2:300 hupcl opost onlcr:300 sane::contty3
contty3:2400 hupcl opost onlcr:2400 sane::contty4
contty4:4800 hupcl opost onlcr:4800 sane::contty5
contty5:19200 hupcl opost onlcr:19200 sane::contty

4800H:4800:4800 sane hupcl::9600H
9600H:9600:9600 sane hupcl::19200H
19200H:19200:19200 sane hupcl::38400H
38400H:38400:38400 sane hupcl::2400H
2400H:2400:2400 sane hupcl::1200H
1200H:1200:1200 sane hupcl::300H
300H:300:300 sane hupcl::4800H

conttyH:9600 opost onlcr:9600 hupcl sane::contty1H
contty1H:1200 opost onlcr:1200 hupcl sane::contty2H
contty2H:300 opost onlcr:300 hupcl sane::contty3H
contty3H:2400 opost onlcr:2400 hupcl sane::contty4H
contty4H:4800 opost onlcr:4800 hupcl sane::contty5H
contty5H:19200 opost onlcr:19200 hupcl sane::conttyH

Figure 9-5 shows how the ttylabel entry in the /etc/saf/zsmon/_pmtab file matches an entry in the /etc/ttydefs file. In this example, the ttylabel is part of the default entry provided by Solaris 2.x system software for serial port B

Figure 9-5  How ttymon identifies the ttylabel in the /etc/ttydefs file.

The /etc/ttydefs file also contains information about speed and terminal settings for the TTY ports on a system. You can use the sttydefs(1M) administrative command to create new entries in the /etc/ttydefs file. See the sttydefs(1M) manual page for information on how to configure the /etc/ttydefs file.

Previous Table of Contents Next