From c39c96e6878a8fd0b843d534115090a6b0e1b183 Mon Sep 17 00:00:00 2001 From: Dru Lavigne Date: Tue, 6 May 2014 20:34:49 +0000 Subject: [PATCH] White space fix only. Translators can ignore. Sponsored by: iXsystems --- .../books/handbook/serialcomms/chapter.xml | 976 +++++++++--------- 1 file changed, 487 insertions(+), 489 deletions(-) diff --git a/en_US.ISO8859-1/books/handbook/serialcomms/chapter.xml b/en_US.ISO8859-1/books/handbook/serialcomms/chapter.xml index 6cf7fcf443..5fc9134075 100644 --- a/en_US.ISO8859-1/books/handbook/serialcomms/chapter.xml +++ b/en_US.ISO8859-1/books/handbook/serialcomms/chapter.xml @@ -63,441 +63,435 @@ bps - - Bits per - Secondbits-per-second - (bps) is the rate at which data is - transmitted. - - + + Bits per + Secondbits-per-second + (bps) is the rate at which data is + transmitted. + + - - DTE - - Data Terminal - EquipmentDTE - (DTE) is one of two endpoints in a - serial communication. An example would be a - computer. - - + + DTE + + Data Terminal + EquipmentDTE + (DTE) is one of two endpoints in a + serial communication. An example would be a + computer. + + - - DCE - - Data Communications - EquipmentDCE - (DTE) is the other endpoint in a - serial communication. Typically, it is a modem. - - + + DCE + + Data Communications + EquipmentDCE + (DTE) is the other endpoint in a + serial communication. Typically, it is a modem. + + - - RS-232 + + RS-232 + + The original standard which defined hardware serial + communications. It has since been renamed to + TIA-232RS-232C + cables. + + + - - The original standard which defined hardware serial - communications. It has since been renamed to - TIA-232RS-232C - cables. - - - + When talking about communications data rates, this section + does not use the term baud. Baud refers to the + number of electrical state transitions that may be made in a + period of time, while bps is the + correct term to use. - When talking about communications data rates, this section - does not use the term baud. Baud refers to the - number of electrical state transitions that may be made in a - period of time, while bps is the - correct term to use. + To connect a modem or serial terminal to a &os; system, a + serial port on the computer and the proper cable to connect to + the serial device are needed. Users who are already familiar + with serial hardware and cabling can safely skip this + section. - To connect a modem or serial terminal to a &os; system, a - serial port on the computer and the proper cable to connect to - the serial device are needed. Users who are already familiar - with serial hardware and cabling can safely skip this - section. + + Serial Cables and Ports - - Serial Cables and Ports + There are several different kinds of serial cables. The + two most common types are null-modem cables and standard + RS-232 cables. The documentation for the hardware should + describe the type of cable required. - There are several different kinds of serial cables. The - two most common types are null-modem cables and standard - RS-232 cables. The documentation for the hardware should - describe the type of cable required. + + null-modem cable + - - null-modem cable - + A null-modem cable passes some signals, such as + Signal Ground, straight through, but switches + other signals. For example, the Transmitted + Data pin on one end goes to the Received + Data pin on the other end. - A null-modem cable passes some signals, such as - Signal Ground, straight through, but - switches other signals. For example, the - Transmitted Data pin on one end goes to the - Received Data pin on the other end. + A null-modem cable can be constructed for use with + terminals. The following table shows the RS-232C signal names and + the pin numbers on a DB-25 connector. While the standard + calls for a straight-through pin 1 to pin 1 + Protective Ground line, it is often + omitted. Some terminals work using only pins 2, 3, and 7, + while others require different configurations than the + examples shown below. - A null-modem cable can be constructed for use with - terminals. The following table shows the RS-232C signal names - and the pin numbers on a DB-25 connector. While the - standard calls for a straight-through pin 1 to pin 1 - Protective Ground line, it is often - omitted. Some terminals work using only pins 2, 3, and - 7, while others require different configurations than - the examples shown below. + + DB-25 to DB-25 Null-Modem Cable -
- DB-25 to DB-25 Null-Modem Cable + + + + Signal + Pin # + + Pin # + Signal + + - - - - Signal - Pin # - - Pin # - Signal - - + + + SG + 7 + connects to + 7 + SG + - - - SG - 7 - connects to - 7 - SG - + + TD + 2 + connects to + 3 + RD + - - TD - 2 - connects to - 3 - RD - + + RD + 3 + connects to + 2 + TD + - - RD - 3 - connects to - 2 - TD - + + RTS + 4 + connects to + 5 + CTS + - - RTS - 4 - connects to - 5 - CTS - + + CTS + 5 + connects to + 4 + RTS + - - CTS - 5 - connects to - 4 - RTS - + + DTR + 20 + connects to + 6 + DSR + - - DTR - 20 - connects to - 6 - DSR - + + DTR + 20 + connects to + 8 + DCD + - - DTR - 20 - connects to - 8 - DCD - + + DSR + 6 + connects to + 20 + DTR + - - DSR - 6 - connects to - 20 - DTR - + + DCD + 8 + connects to + 20 + DTR + + + +
- - DCD - 8 - connects to - 20 - DTR - - - - + The next two tables show two other common schemes. - The next two tables show two other common - schemes. + + DB-9 to DB-9 Null-Modem Cable -
- DB-9 to DB-9 Null-Modem Cable + + + + Signal + Pin # + + Pin # + Signal + + - - - - Signal - Pin # - - Pin # - Signal - - + + + RD + 2 + connects to + 3 + TD + - - - RD - 2 - connects to - 3 - TD - + + TD + 3 + connects to + 2 + RD + - - TD - 3 - connects to - 2 - RD - + + DTR + 4 + connects to + 6 + DSR + - - DTR - 4 - connects to - 6 - DSR - + + DTR + 4 + connects to + 1 + DCD + - - DTR - 4 - connects to - 1 - DCD - + + SG + 5 + connects to + 5 + SG + - - SG - 5 - connects to - 5 - SG - + + DSR + 6 + connects to + 4 + DTR + - - DSR - 6 - connects to - 4 - DTR - + + DCD + 1 + connects to + 4 + DTR + - - DCD - 1 - connects to - 4 - DTR - + + RTS + 7 + connects to + 8 + CTS + - - RTS - 7 - connects to - 8 - CTS - + + CTS + 8 + connects to + 7 + RTS + + + +
- - CTS - 8 - connects to - 7 - RTS - - - - + + DB-9 to DB-25 Null-Modem Cable -
- DB-9 to DB-25 Null-Modem Cable + + + + Signal + Pin # + + Pin # + Signal + + - - - - Signal - Pin # - - Pin # - Signal - - + + + RD + 2 + connects to + 2 + TD + - - - RD - 2 - connects to - 2 - TD - + + TD + 3 + connects to + 3 + RD + - - TD - 3 - connects to - 3 - RD - + + DTR + 4 + connects to + 6 + DSR + - - DTR - 4 - connects to - 6 - DSR - + + DTR + 4 + connects to + 8 + DCD + - - DTR - 4 - connects to - 8 - DCD - + + SG + 5 + connects to + 7 + SG + - - SG - 5 - connects to - 7 - SG - + + DSR + 6 + connects to + 20 + DTR + - - DSR - 6 - connects to - 20 - DTR - + + DCD + 1 + connects to + 20 + DTR + - - DCD - 1 - connects to - 20 - DTR - + + RTS + 7 + connects to + 5 + CTS + - - RTS - 7 - connects to - 5 - CTS - + + CTS + 8 + connects to + 4 + RTS + + + +
- - CTS - 8 - connects to - 4 - RTS - - - - + + When one pin at one end connects to a pair of pins at + the other end, it is usually implemented with one short wire + between the pair of pins in their connector and a long wire + to the other single pin. + - - When one pin at one end connects to a pair of pins - at the other end, it is usually implemented with one - short wire between the pair of pins in their connector - and a long wire to the other single pin. - + The above designs seem to be the most popular. In + another variation, SG connects to SG, TD connects to RD, RTS + and CTS connect to DCD, DTR connects to DSR, and + vice-versa. - The above designs seem to be the most popular. In - another variation, SG connects to SG, TD connects to RD, - RTS and CTS connect to DCD, DTR connects to DSR, and - vice-versa. + RS-232C cables - RS-232C cables + A standard serial cable passes all of the RS-232C signals + straight through. The Transmitted Data pin on + one end of the cable goes to the Transmitted + Data pin on the other end. This is the type of + cable used to connect a modem to the &os; system, and is also + appropriate for some terminals. - A standard serial cable passes all of the RS-232C - signals straight through. The Transmitted - Data pin on one end of the cable goes to the - Transmitted Data pin on the other end. - This is the type of cable used to connect a modem to - the &os; system, and is also appropriate for some - terminals. + Serial ports are the devices through which data is + transferred between the &os; host computer and the terminal. + This section describes the kinds of ports that exist and how + they are addressed in &os;. - Serial ports are the devices through which data is - transferred between the &os; host computer and the - terminal. This section describes the kinds of ports that - exist and how they are addressed in &os;. + Several kinds of serial ports exist. Before purchasing or + constructing a cable, make sure it will fit the ports on the + terminal and on the &os; system. - Several kinds of serial ports exist. Before - purchasing or constructing a cable, make sure it will - fit the ports on the terminal and on the &os; - system. + Most terminals have DB-25 ports. Personal computers may + have DB-25 or DB-9 ports. A multiport serial card may have + RJ-12 or RJ-45 ports. - Most terminals have DB-25 ports. Personal computers - may have DB-25 or DB-9 ports. A multiport serial card may - have RJ-12 or RJ-45 ports. + See the documentation that accompanied the hardware for + specifications on the kind of port or visually verify the type + of port. - See the documentation that accompanied the hardware - for specifications on the kind of port or visually verify - the type of port. + In &os;, each serial port is accessed through an entry in + /dev. There are two different kinds of + entries: - In &os;, each serial port is accessed through an - entry in /dev. - There are two different kinds of entries: + + + Call-in ports are named + /dev/ttyuN + where N is the port number, + starting from zero. Generally, the call-in port is used + for terminals. Call-in ports require that the serial line + assert the Data Carrier Detect (DCD) + signal to work correctly. + - - - Call-in ports are named - /dev/ttyuN - where N is the port number, - starting from zero. Generally, the call-in port is - used for terminals. Call-in ports require that the - serial line assert the Data Carrier Detect - (DCD) signal to work - correctly. - + + Call-out ports are named + /dev/cuauN. + Call-out ports are usually not used for terminals, but are + used for modems. The call-out port can be used if the + serial cable or the terminal does not support the carrier + detect signal. + + - - Call-out ports are named - /dev/cuauN. - Call-out ports are usually not used for terminals, but - are used for modems. The call-out port can be used if - the serial cable or the terminal does not support the - carrier detect signal. - - - - If a terminal is connected to the first serial - port(COM1), use - /dev/ttyu0 to refer to the - terminal. If the terminal is on the second serial port - (COM2), use - /dev/ttyu1, and so forth. -
+ If a terminal is connected to the first serial port + (COM1), use + /dev/ttyu0 to refer to the terminal. If + the terminal is on the second serial port + (COM2), use + /dev/ttyu1, and so forth. +
Kernel Configuration &os; supports four serial ports by default. In the - &ms-dos; world, these are known as - COM1, - COM2, - COM3, and + &ms-dos; world, these are known as COM1, + COM2, COM3, and COM4. &os; currently supports dumb multiport serial interface cards, such as the BocaBoard 1008 and 2016, as well as more intelligent @@ -505,19 +499,18 @@ Technologies. However, the default kernel only looks for the standard COM ports. - To see if the kernel recognizes the serial ports, - watch for messages while the kernel is booting, or use - /sbin/dmesg to replay the kernel's - boot messages. Look for messages that start with the - characters uart: + To see if the kernel recognizes the serial ports, watch + for messages while the kernel is booting, or use + /sbin/dmesg to replay the kernel's boot + messages. Look for messages that start with the characters + uart: &prompt.root; /sbin/dmesg | grep 'uart' - If the kernel does not recognize all of the serial - ports, configure /boot/device.hints. - When editing this file, one can comment out or completely - remove lines for devices that do not exist on the - system. + If the kernel does not recognize all of the serial ports, + configure /boot/device.hints. When + editing this file, one can comment out or completely remove + lines for devices that do not exist on the system. port IO_COM1 is a substitution for @@ -528,11 +521,10 @@ addresses for their respective serial ports and interrupts 4, 3, 5, and 9 are fairly common interrupt request lines. Regular serial ports cannot share - interrupts on ISA-bus PCs. Multiport boards have - on-board electronics that allow all the 16550A's on the - board to share one or two interrupt request lines. + interrupts on ISA-bus PCs. Multiport boards have on-board + electronics that allow all the 16550A's on the board to + share one or two interrupt request lines. - @@ -614,7 +606,8 @@ of the port will be stuck with 57600 bps. The initial state and lock state devices should only be - writable by root. + writable by root. @@ -641,9 +634,9 @@ connected network. This section describes how to use terminals with &os;. - The original &unix; systems did not have consoles. - Instead, users logged in and ran programs through terminals - that were connected to the computer's serial ports. + The original &unix; systems did not have consoles. Instead, + users logged in and ran programs through terminals that were + connected to the computer's serial ports. The ability to establish a login session on a serial port still exists in nearly every &unix;-like operating system @@ -668,17 +661,18 @@ to computers over serial lines. They are called dumb because they have only enough computational power to display, send, and receive text. - No programs can be run on these devices. Instead, dumb terminals - connect to a computer that runs the needed programs. + No programs can be run on these devices. Instead, dumb + terminals connect to a computer that runs the needed + programs. - There are hundreds of kinds of dumb terminals made - by many manufacturers, and just about any kind will work - with &os;. Some high-end terminals can even display - graphics, but only certain software packages can take - advantage of these advanced features. + There are hundreds of kinds of dumb terminals made by + many manufacturers, and just about any kind will work with + &os;. Some high-end terminals can even display graphics, + but only certain software packages can take advantage of + these advanced features. - Dumb terminals are popular in work environments - where workers do not need access to graphical + Dumb terminals are popular in work environments where + workers do not need access to graphical applications. @@ -689,9 +683,8 @@ Since a dumb terminal has just enough ability to display, send, and receive text, any spare computer can be a dumb terminal. All that is needed is the proper - cable and some terminal - emulation software to run on the - computer. + cable and some terminal emulation + software to run on the computer. This configuration can be useful. For example, if one user is busy working at the &os; system's console, another @@ -703,25 +696,27 @@ &os; that can be used to work through a serial connection: &man.cu.1; and &man.tip.1;. - For example, to connect from a client system that runs &os; to the - serial connection of another system: + For example, to connect from a client system that runs + &os; to the serial connection of another system: &prompt.root; cu -l serial-port-device - Replace serial-port-device with the device name of - the connected serial port. These device files are called + Replace serial-port-device + with the device name of the connected serial port. These + device files are called /dev/cuauN on &os; versions 8.x and lower and /dev/cuadN on &os; versions 9.x and higher. In either case, - N is the - serial port number, starting from zero. - This means that COM1 - is /dev/cuau0 or - /dev/cuad0 in &os;. + N is the serial port number, + starting from zero. This means that + COM1 is + /dev/cuau0 or + /dev/cuad0 in &os;. - Additional programs are available - through the Ports Collection, such as comms/minicom. + Additional programs are available through the Ports + Collection, such as + comms/minicom. @@ -732,10 +727,11 @@ terminal available. Instead of connecting to a serial port, they usually connect to a network like Ethernet. Instead of being relegated to text-only applications, they - can display any &xorg; application. + can display any &xorg; + application. - This chapter does not cover the - setup, configuration, or use of X terminals. + This chapter does not cover the setup, configuration, + or use of X terminals. @@ -759,13 +755,14 @@ program. To configure terminals for a &os; system, the following - steps should be taken as root: + steps should be taken as root: Add a line to /etc/ttys for the - entry in /dev for - the serial port if it is not already there. + entry in /dev for the serial port if + it is not already there. @@ -806,22 +803,21 @@ /etc/ttys lists all of the ports on the &os; system which allow logins. For example, the - first virtual console, - ttyv0, has an entry in this file, - allowing logins on the console. This file also contains - entries for the other virtual consoles, serial ports, and - pseudo-ttys. For a hardwired terminal, - list the serial port's /dev entry without the - /dev part. For example, + first virtual console, ttyv0, has an + entry in this file, allowing logins on the console. This + file also contains entries for the other virtual consoles, + serial ports, and pseudo-ttys. For a hardwired terminal, + list the serial port's /dev entry + without the /dev part. For example, /dev/ttyv0 would be listed as ttyv0. A default &os; install includes an - /etc/ttys with support for the - first four serial ports: ttyu0 - through ttyu3. When - attaching a terminal to one of those ports, this file does - not need to be edited. + /etc/ttys with support for the first + four serial ports: ttyu0 through + ttyu3. When attaching a terminal to + one of those ports, this file does not need to be + edited. Adding Terminal Entries to @@ -912,13 +908,14 @@ ttyu5 "/usr/libexec/getty std.19200" vt100 on insecure</programlisting> <para>The final field is used to specify whether the port is secure. Marking a port as <literal>secure</literal> means that it is trusted - enough to allow <systemitem class="username">root</systemitem>, or any - account with a <acronym>UID</acronym> of 0, to login - from that port. Insecure ports do not allow - <systemitem class="username">root</systemitem> logins. On an insecure - port, users must login from unprivileged accounts and - then use &man.su.1; or a similar mechanism to gain - superuser privileges.</para> + enough to allow <systemitem + class="username">root</systemitem>, or any account + with a <acronym>UID</acronym> of 0, to login from that + port. Insecure ports do not allow <systemitem + class="username">root</systemitem> logins. On an + insecure port, users must login from unprivileged + accounts and then use &man.su.1; or a similar + mechanism to gain superuser privileges.</para> <para>It is highly recommended to use <literal>insecure</literal>, even for terminals that @@ -935,9 +932,9 @@ ttyu5 "/usr/libexec/getty std.19200" vt100 on insecure</programlisting> <filename>/etc/ttys</filename> After making any changes to - /etc/ttys, send a SIGHUP - (hangup) signal to the init process to - force it to re-read its configuration file: + /etc/ttys, send a SIGHUP (hangup) + signal to the init process to force it to + re-read its configuration file: &prompt.root; kill -HUP 1 @@ -973,47 +970,44 @@ ttyu5 "/usr/libexec/getty std.19200" vt100 on insecure right kind of cable. Make sure the terminal and &os; agree on the - bps rate and parity settings. For a - video display terminal, make sure the contrast and - brightness controls are turned up. If it is a printing - terminal, make sure paper and ink are in good supply. + bps rate and parity settings. For a video + display terminal, make sure the contrast and brightness + controls are turned up. If it is a printing terminal, make + sure paper and ink are in good supply. Make sure that a getty process is - running and serving the terminal. For example, to get a - list of running getty processes with + running and serving the terminal. For example, to get a list + of running getty processes with ps, type: &prompt.root; ps -axww|grep getty There should be an entry for the terminal. For example, - the following display shows that a - getty is running on the second serial - port, ttyu1, and is using the - std.38400 entry in + the following display shows that a getty is + running on the second serial port, ttyu1, + and is using the std.38400 entry in /etc/gettytab: 22189 d1 Is+ 0:00.03 /usr/libexec/getty std.38400 ttyu1 If no getty process is running, make - sure the port is enabled in - /etc/ttys. Remember to run - kill -HUP 1 after modifying + sure the port is enabled in /etc/ttys. + Remember to run kill -HUP 1 after modifying /etc/ttys. - If the getty process is running - but the terminal still does not display a login prompt, - or if it displays a prompt but will not accept typed input, - the terminal or cable may not support hardware handshaking. - Try changing the entry in /etc/ttys - from std.38400 to - 3wire.38400, then run - kill -HUP 1 after modifying - /etc/ttys. The - 3wire entry is similar to - std, but ignores hardware - handshaking. The baud rate may need to be reduced or - software flow control enabled when using - 3wire to prevent buffer overflows. + If the getty process is running but the + terminal still does not display a login prompt, or if it + displays a prompt but will not accept typed input, the + terminal or cable may not support hardware handshaking. Try + changing the entry in /etc/ttys from + std.38400 to + 3wire.38400, then run kill -HUP + 1 after modifying /etc/ttys. + The 3wire entry is similar to + std, but ignores hardware handshaking. The + baud rate may need to be reduced or software flow control + enabled when using 3wire to prevent buffer + overflows. If garbage appears instead of a login prompt, make sure the terminal and &os; agree on the bps rate @@ -1652,7 +1646,7 @@ AT&B2&W does not appear right away, or the prompt shows garbage, try pressing Enter about once per second. If there is still no login: prompt after a - while, try sending a BREAK. When using a + while, try sending a BREAK. When using a high-speed modem, try dialing again after locking the dialing modem's interface speed. @@ -1733,8 +1727,8 @@ AT&B2&W /etc/remote Create a direct entry in - /etc/remote. For example, if the - modem is hooked up to the first serial port, + /etc/remote. For example, if the modem + is hooked up to the first serial port, /dev/cuau0, use the following line: @@ -1744,8 +1738,9 @@ AT&B2&W supports in the br capability. Then, type tip cuau0 to connect to the modem. - Or, use cu as root - with the following command: + Or, use cu as root with the following + command: &prompt.root; cu -lline -sspeed @@ -1817,11 +1812,10 @@ tip57600|Dial any phone number at 57600 bps:\ each time, use tip's cm capability. For example, these entries in /etc/remote will let you type - tip pain or - tip muffin to connect to the hosts - pain or muffin, and - tip deep13 to connect to the terminal - server. + tip pain or tip muffin + to connect to the hosts pain or + muffin, and tip + deep13 to connect to the terminal server. pain|pain.deep13.com|Forrester's machine:\ :cm=CONNECT pain\n:tc=deep13: @@ -2067,8 +2061,9 @@ raisechar=^^ null-modem cable Use either a null-modem cable or a standard serial - cable and a null-modem adapter. See for a discussion - on serial cables. + cable and a null-modem adapter. See for a discussion on serial + cables. @@ -2176,7 +2171,8 @@ raisechar=^^ unavailable for normal access. This flag should not be set to the serial port to use as the serial console. The only use of this flag is to designate - the unit for kernel remote debugging. See The + the unit for kernel remote debugging. See The Developer's Handbook for more information on remote debugging. @@ -2525,10 +2521,10 @@ boot: Recompile the boot blocks with - BOOT_COMCONSOLE_SPEED set to the - new console speed. See for detailed - instructions about building and installing new boot - blocks. + BOOT_COMCONSOLE_SPEED set to the new + console speed. See + for detailed instructions about building and installing + new boot blocks. If the serial console is configured in some other way than by booting with , or if the @@ -2576,7 +2572,8 @@ console="comconsole,vidconsole" - Get the kernel source as described in . + Get the kernel source as described in . @@ -2733,7 +2730,8 @@ ttyu3 "/usr/libexec/getty std.9600" unknown off secure The boot loader needs to be compiled in order to use a serial port other than sio0 for the - serial console. Follow the procedure described in . + serial console. Follow the procedure described in .