Online Book Reader

Home Category

UNIX System Administration Handbook - Evi Nemeth [69]

By Root 2784 0
(flow control, baud rate, etc.) of the locked device and then open it with a program, the kernel will ignore attempts to reconfigure the port. See sio(4) for more details.

As always, the names of the device files do not really matter. Behavior is determined by the major and minor device numbers, and the names of device files are merely conventional.5

Table 7.5 on the next page shows the standard naming conventions for serial port device files on our example systems. Filenames are shown for the first two ports; additional ports are named similarly.

Table 7.5 Device files for the first two serial ports

a. See the mksf(1M) manual page for a full explanation of the many exciting options.

7.7 SOFTWARE CONFIGURATION FOR SERIAL DEVICES


Once a device has been connected with the proper cable, software on the host machine must be configured to take advantage of it. Unlike devices that connect directly to the host’s bus, serial devices do not require configuration at the kernel level.6

High-level software must still be told about the new devices, however.

The configuration chores for a new device depend on the type of device and the uses to which it will be put:

• For a hardwired terminal, you must tell the system to listen for logins on the terminal’s port. You specify the speed and parameters of the serial connection. Configuration for terminals is described in the next section.

• Dial-in modems are configured similarly to hardwired terminals. However, the exact procedure may be slightly different on some systems.

• To configure a dial-out modem for use by humans, you must put entries in /etc/remote for use by the tip and cu commands. This procedure is described on page 114.

• To use a modem to connect to a remote network using PPP, see page 291. You may need additional software.

• See Chapter 23, Printing, for information about how to set up a serial printer. Some printers only receive data; others are bidirectional and can return status information to the host computer.

• A custom serial device that you will use only from your own software needs no special configuration. You can simply open the device file to access the device. Refer to the termio man page or the man page for the tty driver to learn about the ioctl calls that set the speed, flag bits, and buffering mode of the serial port.

7.8 CONFIGURATION OF HARDWIRED TERMINALS


Over the last decade, cheap computers have almost entirely replaced ASCII terminals. However, even the “terminal” windows on a graphical display use the same drivers and configuration files as real terminals, so system administrators still need to understand how they work.

Terminal configuration involves two main tasks: making sure that a process is attached to a terminal to accept logins, and making sure that information about the terminal is available once a user has logged in.

The login process


The login process involves several different programs.

The init daemon is started at boot time. One of its jobs is to spawn a process, usually getty (but not on Solaris), on each terminal port that is turned on in the /etc/ttys or /etc/inittab file (depending on the system). getty sets the port’s initial characteristics (such as speed and parity) and prints a login prompt.

The sequence of events in a complete login is as follows:

• A user enters a login name at getty’s prompt.

• getty executes the login program with the specified name as an argument.

• login requests a password and validates it against /etc/passwd.7

• login prints the message of the day from /etc/motd.

• login sets up the TERM environment variable and runs a shell.

• The shell executes the appropriate startup files.8

• The shell prints a prompt and waits for input.

When the user logs out, control returns to init, which wakes up and spawns a new getty on the terminal port.

Files in /etc control the characteristics associated with each terminal port. These characteristics include the presence of a login prompt and getty process on the port, the baud rate to expect,

Return Main Page Previous Page Next Page

®Online Book Reader