< Day Day Up > |
In Linux, several users may be logged in at the same time. Each user needs his or her own terminal through which to access the Linux system, of course. The monitor on your PC acts as a special terminal, called the console, but you can add other terminals through either the serial ports on your PC or a special multiport card installed on your PC. The other terminals can be standalone terminals or PCs using terminal emulation programs. For a detailed explanation of terminal installation, see the Term-HOWTO file in /usr/share/doc/HOWTO (installed as part of Red Hat documentation CD-ROM) or at the Linux Documentation Project site (www.tldp.org). A brief explanation is provided here.
The serial ports on your PC are referred to as COM1, COM2, COM3, and COM4. These serial ports correspond to the terminal devices /dev/ttyS0 through /dev/ttyS3. Note that several of these serial devices may already be used for other input devices such as your mouse, and for communications devices such as your modem. If you have a serial printer, one of these serial devices is already used for that. If you installed a multiport card, you have many more ports from which to choose. For each terminal you add, you must create a character device on your Linux system. As with printers, you use the mknod command to create terminal devices. The permissions for a terminal device are 660. Terminal devices are character devices with a major number of 4 and minor numbers usually beginning at 64.
Tip |
The /dev/pts entry in the /etc/fstab file mounts a devpts file system at /dev/pts for Unix98 Psuedo-TTYs. These pseudo terminals are identified by devices named by number. |
Terminal devices are managed by your system using the getty program and a set of configuration files. When your system starts, it reads a list of connected terminals in the inittab file and then executes an appropriate getty program for each one, either mingetty, mgetty, or agetty. Such getty programs set up the communication between your Linux system and a specified terminal. mingetty provides minimal support for virtual consoles, whereas agetty provides enhanced support for terminal connections. agetty also includes parameters for the baud rate and timeout. mgetty is designed for fax/modem connections, letting you configure dialing, login, and fax parameters. mgetty configuration files are held in the /etc/mgetty+sendfax directory. Modem connection information is held in the /etc/mgetty+sendfax/mgetty.config file. All getty programs can read an initial message placed in the /etc/issue file, which can contain special codes to provide the system name and current date and time.
The /etc/inittab file holds instructions for your system on how to manage terminal devices. A line in the /etc/inittab file has four basic components: an ID, a runlevel, an action, and a process. Terminal devices are identified by ID numbers, beginning with 1 for the first device. The runlevel at which the terminal operates is usually 1. The action is usually respawn, which means to run the process continually. The process is a call to the mingetty, mgetty, or agetty with the terminal device name. The /etc/termcap file holds the specifications for different terminal types. These are the different types of terminals users could use to log into your system. Your /etc/termcap file is already filled with specifications for most of the terminals currently produced. An entry in the /etc/termcap file consists of various names that can be used for a terminal separated by a pipe character (|) and then a series of parameter specifications, each ending in a colon. You find the name used for a specific terminal type here. You can use more to display your /etc/termcap file, and then use a search, /, to locate your terminal type. You can set many options for a terminal device. To change these options, use the stty command instead of changing configuration files directly. The stty command with no arguments lists the current setting of the terminal.
When a user logs in, having the terminal device initialized using the tset command is helpful. Usually, the tset command is placed in the user's .bash_profile file and is automatically executed whenever the user logs into the system. You use the tset command to set the terminal type and any other options the terminal device requires. A common entry of tset for a .bash_profile file follows. The -m dialup: option prompts the user to enter a terminal type. The type specified here is a default type that is displayed in parentheses. The user presses ENTER to choose the default. The prompt looks like this: TERM=(vt100)?.
eval 'tset -s -Q -m dialup:?vt00'
< Day Day Up > |
This HTML Help has been published using the chm2web software. |