⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lsg11.htm

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTM
📖 第 1 页 / 共 5 页
字号:


<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->


























<LINK REL="ToC" HREF="index.htm">







<LINK REL="Index" HREF="htindex.htm">







<LINK REL="Next" HREF="lsg12.htm">



















<A NAME="I0"></A>







<H2>Linux System Administrator's Survival Guide lsg11.htm</H2>







<P ALIGN=LEFT>







































<HR ALIGN=CENTER>







<P>







<UL>







<UL>







<UL>







<LI>







<A HREF="#E68E60" >Connecting Terminals</A>







<UL>







<LI>







<A HREF="#E69E96" >Using Multiport Cards</A>







<LI>







<A HREF="#E69E97" >Connecting Serial Port Terminals</A>







<LI>







<A HREF="#E69E98" >Wiring Serial Cables</A></UL>







<LI>







<A HREF="#E68E61" >Understanding the Login Process</A>







<UL>







<LI>







<A HREF="#E69E99" >init and inittab</A>







<LI>







<A HREF="#E69E100" >/etc/ttys and /etc/inittab</A>







<LI>







<A HREF="#E69E101" > /etc/getty and /etc/gettydefs</A>







<LI>







<A HREF="#E69E102" > The /etc/termcap File</A></UL>







<LI>







<A HREF="#E68E62" >Adding a Terminal</A>







<LI>







<A HREF="#E68E63" >Setting Terminal Behavior with stty and tset</A>







<LI>







<A HREF="#E68E64" >Resetting a Screwy Terminal</A>







<LI>







<A HREF="#E68E65" >Using term</A>







<UL>







<LI>







<A HREF="#E69E103" >Installing term</A>







<LI>







<A HREF="#E69E104" >Testing term</A>







<LI>







<A HREF="#E69E105" >Running term</A>







<LI>







<A HREF="#E69E106" >Using term with X</A>







<LI>







<A HREF="#E69E107" >Using term Utilities</A></UL>







<LI>







<A HREF="#E68E66" >Summary</A></UL></UL></UL>







<HR ALIGN=CENTER>







<A NAME="E66E13"></A>







<H1 ALIGN=CENTER>







<CENTER>







<FONT SIZE=6 COLOR="#FF0000"><B>Chapter 11</B></FONT></CENTER></H1>







<BR>







<A NAME="E67E16"></A>







<H2 ALIGN=CENTER>







<CENTER>







<FONT SIZE=6 COLOR="#FF0000"><B>Terminals and term</B></FONT></CENTER></H2>







<BR>







<P>The most common Linux installation involves only a single screen, which is the system console that came with the PC Linux is running on. If you are running your Linux system for yourself and don't want to add another terminal to your system, your Linux configuration is complete as far as terminals are concerned and you can skip this chapter.







<BR>







<P>If, on the other hand, you want to add another PC or a terminal to your system, either for yourself to access (from another room, for example) or to provide access to Linux for others in your home or office, you need to know how to add and configure terminals. This chapter explains how to add terminals (including PC and Macintosh devices running terminal emulation software) to Linux and how to configure them. It also explains how to use the term program, which allows you to multiplex your serial lines, essentially supporting more than one device on a line.







<BR>







<BR>







<A NAME="E68E60"></A>







<H3 ALIGN=CENTER>







<CENTER>







<FONT SIZE=5 COLOR="#FF0000"><B>Connecting Terminals</B></FONT></CENTER></H3>







<BR>







<P>For the purposes of this book, the word terminal doesn't necessarily mean the old, dumb, ASCII-based terminals that many feel are remnants of days gone by. Although those machines are definitely terminals (and fully usable with Linux), modern terminals can range from inexpensive graphics-based systems to complex X workstations that have more in-built computing power than most PC machines (at a suitably hefty price). A terminal can also be any other computer (PC, Macintosh, UNIX system, Commodore 64, Amiga, and so on) that runs a terminal emulation package, which makes the machine act like a terminal.







<BR>







<P>You may want to add terminals to your system to allow other users to work with Linux at the same time you do (it is a multiuser system) or to provide access to your database of videotape movies (not to mention games) by running a terminal into your living room. If you are a parent, you can run terminals into your children's rooms, letting them use the system for education and entertainment. You may want to let friends access your system when they visit, or call in over the modem.







<BR>







<P>For whatever reason you need new terminals, you can add them to your Linux system by connecting them through an existing serial port on the back of your PC or through a multiport card with many serial ports on it.







<BR>







<BR>







<A NAME="E69E96"></A>







<H4 ALIGN=CENTER>







<CENTER>







<FONT SIZE=4 COLOR="#FF0000"><B>Using Multiport Cards</B></FONT></CENTER></H4>







<BR>







<P>Because many PC machines have a maximum of four serial ports (and the majority of systems only have two), expanding your Linux system using serial ports can be limiting. If you use an external modem, a serial printer, or other serial port devices, you may not have any serial ports left for terminals. In this case, you must use a multiport card.







<BR>







<P>Multiport cards are an easy and effective method of adding serial ports to a Linux system. Multiport cards have a plug-in board that is placed in a slot on your PC system and an oversized connector on the outer board edge to which a cable is attached. The cable either leads directly to a number of serial ports (in which case the cable is called an octopus) or to a hardware device that has serial ports laid out on it.







<BR>







<P>Multiport cards come in two basic types. The first is essentially a fast, somewhat intelligent serial port server. These cards are inexpensive because they are simple to manufacture. However, they lack any on-board processing or memory, so every device connected to the multiport card takes its toll on the Linux system's CPU and RAM.







<BR>







<P>The other type of multiport card is the intelligent controller. These cards cost much more, but have an on-board CPU to offload the Linux system's CPU. The on-board CPU can handle all the communications requests and, in some cases, is smart enough to provide terminal commands. These cards usually have RAM mounted on the board too, which provides a cache system for speeding up access. In general, these intelligent boards are much better for supporting four or more terminals and other devices than their dumber brethren, but you may be spending money on features you don't need if you have less than that number of attached devices.







<BR>







<P>Multiport cards can provide from 2 to 32 additional serial ports per card, and you can add multiple boards to the increase capacity even further, although this situation is very rare for Linux installations. A couple of manufacturers even offer systems that can support 256 terminals spread out in a cluster arrangement. Some multiport boards include parallel ports for printers, and a few high-end boards are designed to use SCSI devices.







<BR>







<P>Each port on the multiport card is usually wired for use by any serial device, including terminals, modems, printers, scanners, and so on. However, a few cards designed for simple terminal use support only a few of the wires in a serial port. These cards cannot support modems, printers, and similar complex devices properly. Different card manufacturers have different supported systems, so if you decide to go with a multiport card for your system, check the specifications carefully.







<BR>







<P>The types of connectors on multiport cards differ, too. Most use either standard DB25 25-pin connectors or DB9 9-pin connectors, identical to the ones found as PC serial ports. Some cards use the RJ45 connector, which looks like a wide modular telephone-style jack. Adapters are used to connect the RJ11 connector to a standard serial cable. Again, if you decide to use a multiport card, check the types of connectors and make sure the wiring of the connector is consistent with your serial devices or that converters and adapters are readily available.







<BR>







<P>If you are going to use a multiport card on your Linux system, make sure you use one with software device drivers that are designed for Linux. You cannot use any multiport card device driver designed for other versions of UNIX without modification. Because the drivers are usually already compiled, you cannot modify the drivers yourself. Several multiport card drivers, specially modified or written by Linux users to suit the most popular multiport cards, are available from FTP and BBS sites. As Linux becomes more popular, more multiport card vendors are developing optimized drivers for their products to integrate with Linux.







<BR>







<P>Multiport cards come with complete instructions for installing the device drivers for the multiport card, as well as configuring the terminals and other devices. Because the details of the configurations change depending on the manufacturer of the multiport card, you should consult the documentation accompanying your card for further information.







<BR>







<BR>







<A NAME="E69E97"></A>







<H4 ALIGN=CENTER>







<CENTER>







<FONT SIZE=4 COLOR="#FF0000"><B>Connecting Serial Port Terminals</B></FONT></CENTER></H4>







<BR>







<P>If you have a spare port, you can use your PC's serial ports to add terminals. In most cases, connecting the terminal is a matter of running a cable between the terminal and the serial port, and ensuring the proper connectors are used. You then update the Linux configuration files to tell the operating system to provide service for the terminal. The remote terminal should be active after this step.







<BR>







<P>You can choose any serial port for a terminal, although the port should not be shared with other devices (such as a modem) unless you are willing to disable other devices when the terminal is needed. If you need to run more than one device off a serial port, you can get switch boxes to connect the devices to. These boxes usually have a rotary switch on the front for routing the internal wiring to the proper port.







<BR>







<P>Serial port terminals are sometimes limited by the speed of the UARTs used in the PC, although most new PC machines have the faster 16550 UARTs capable of high-speed communications. Even older machines are very usable for all but graphics applications, as most character-based terminals don't need speeds above 38,400 baud. (In fact, 9600 baud is fast enough for most character-based applications, although 19,200 is better.)







<BR>







<BR>







<A NAME="E69E98"></A>







<H4 ALIGN=CENTER>







<CENTER>







<FONT SIZE=4 COLOR="#FF0000"><B>Wiring Serial Cables</B></FONT></CENTER></H4>







<BR>







<P>The wiring of cables between the terminal and the Linux PC depends on the type of connectors at both ends. The same problems usually occur whether you are using a serial port or a multiport card for your serial ports. In most cases, the cables you will use will be a DTE (Data Terminal Equipment) to DTE type. Some terminals and PC serial ports require DCE (Data Communications Equipment) cabling. As a general rule, terminals and remote computers use DTE, and modems use DCE. The difference between DTE and DCE cabling is in the way the wires run from each end connector; DTE crosses several of the wires between pins at either end.







<BR>







<P>Some store-bought cables are designed specifically for terminals and cross the internal wires as part of their connector design, and other cables are designed for modems and have wires that run straight through. If you find your terminal doesn't work even after following all the configuration instructions discussed in this chapter, chances are your cables are incorrectly wired. A null modem adapter (which forces a cross between wires) is the easiest solution, and you can add it anywhere in the chain from the terminal to the Linux PC.







<BR>







<P>A typical DCE cable (such as for a modem) uses straight through wiring, meaning that pin 1 on the PC end goes to pin 1 on the modem end, pin 2 through to pin 2, and so on. This cable is called a straight cable or modem cable.







<BR>







<P>DTE cables cross wires to allow sending and receiving ends accept signals on the same pins, so that pin 2 in a connector is always for transmit, for example, and pin 3 is always for receive. By crossing pins 2 and 3 between the two ends, one connector's transmit pin becomes the other connector's receive pin. When connecting a terminal, some of the pins must be crossed to permit signals to pass properly. The wiring of these cables (often called null modem cables) requires several such crosses or shorts to make the connection valid.







<BR>







<P>The sex of the connectors at each end of the cable is also important when buying or making a cable. Carefully note whether the connectors at each end are male (pins sticking out) or female (no pins). Usually, a PC has male serial port connectors (requiring a female end on the cable), and a terminal has female connectors (requiring a male connector on the cable), although if you are connecting a remote PC, you will need female connectors at both ends. Multiport cards differ widely in their sex and types of connectors, so check before buying cables!







<BR>







<P>Serial port connectors on a PC are either DB9 (9-pin) or DB25 (25-pin) D-shaped connectors. Not all the wires in either the 9-pin or 25-pin connector are required for a terminal. You can make a complete simple terminal cable with only three pins (send, receive, and ground), although Linux also likes to use the Carrier Detect wire to tell when a terminal is attached and active. Table 11.1 shows the important pins of 25-pin, DTE connector cables and their meanings. The pin numbers change with 9-pin connectors, but the crossings from one to another are the same.







<BR>







<BR>







<P ALIGN=CENTER>







<CENTER>







<FONT COLOR="#000080"><B>Table 11.1. DTE cables for a 25-pin connector.</B></FONT></CENTER>







<BR>















<TABLE  BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 WIDTH="100%" CELLPADDING=2 >







<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







<I>Terminal Pin</I>







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -