From owner-svn-doc-all@FreeBSD.ORG Wed May 7 19:51:05 2014 Return-Path: Delivered-To: svn-doc-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B67AD158; Wed, 7 May 2014 19:51:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2407686; Wed, 7 May 2014 19:51:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s47Jp5o7051864; Wed, 7 May 2014 19:51:05 GMT (envelope-from dru@svn.freebsd.org) Received: (from dru@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47Jp5cu051863; Wed, 7 May 2014 19:51:05 GMT (envelope-from dru@svn.freebsd.org) Message-Id: <201405071951.s47Jp5cu051863@svn.freebsd.org> From: Dru Lavigne Date: Wed, 7 May 2014 19:51:05 +0000 (UTC) To: doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org Subject: svn commit: r44789 - head/en_US.ISO8859-1/books/handbook/serialcomms X-SVN-Group: doc-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-doc-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire doc trees \(except for " user" , " projects" , and " translations" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 19:51:05 -0000 Author: dru Date: Wed May 7 19:51:05 2014 New Revision: 44789 URL: http://svnweb.freebsd.org/changeset/doc/44789 Log: Editorial review of first 1/2 of Dial-in Service. Sponsored by: iXsystems Modified: head/en_US.ISO8859-1/books/handbook/serialcomms/chapter.xml Modified: head/en_US.ISO8859-1/books/handbook/serialcomms/chapter.xml ============================================================================== --- head/en_US.ISO8859-1/books/handbook/serialcomms/chapter.xml Wed May 7 18:57:40 2014 (r44788) +++ head/en_US.ISO8859-1/books/handbook/serialcomms/chapter.xml Wed May 7 19:51:05 2014 (r44789) @@ -971,48 +971,51 @@ ttyu5 "/usr/libexec/getty std.19200" - - Dial-in Service + dial-in service Configuring a &os; system for dial-in service is similar - to connecting terminals except that modems are used instead of + to configuring terminals, except that modems are used instead of terminal devices. &os; supports both external and internal modems. - External modems are more convenient for dial-up because - they often can be semi-permanently configured via parameters - stored in non-volatile RAM and they usually provide lighted - indicators that display the state of important RS-232 signals, + External modems are more convenient because + they often can be configured via parameters + stored in non-volatile RAM and they usually provide lighted + indicators that display the state of important RS-232 signals, indicating whether the modem is operating properly. - Internal modems usually lack non-volatile RAM, so their - configuration may be limited to setting DIP switches. If the + Internal modems usually lack non-volatile RAM, so their + configuration may be limited to setting DIP switches. If the internal modem has any signal indicator lights, they are difficult to view when the system's cover is in place. modem When using an external modem, a proper cable is needed. A - standard RS-232C serial cable should suffice. + standard RS-232C serial cable should suffice. &os; needs the RTS and CTS signals for flow control at speeds @@ -1022,7 +1025,8 @@ ttyu5 "/usr/libexec/getty std.19200" after a session is complete. Some cables are wired without all of the needed signals, so if a login session does not go away when the line hangs up, there may be a problem with the - cable. + cable. Refer to for more + information about these signals. Like other &unix;-like operating systems, &os; uses the hardware signals to find out when a call has been answered or a @@ -1030,78 +1034,57 @@ ttyu5 "/usr/libexec/getty std.19200" call. &os; avoids sending commands to the modem or watching for status reports from the modem. - - Serial Interface Considerations - - &os; supports the NS8250-, NS16450-, NS16550-, and - NS16550A-based EIA RS-232C (CCITT V.24) communications + &os; supports the NS8250, + NS16450, NS16550, and + NS16550A-based RS-232C + (CCITT V.24) communications interfaces. The 8250 and 16450 devices have single-character buffers. The 16550 device provides a 16-character buffer, which allows for better system performance. Bugs in plain - 16550's prevent the use of the 16-character buffer, so use - 16550A's if possible. Because single-character-buffer + 16550 devices prevent the use of the 16-character buffer, so use + 16550A devices if possible. Because single-character-buffer devices require more work by the operating system than the 16-character-buffer devices, 16550A-based serial interface cards are preferred. If the system has many active serial ports or will have a heavy load, 16550A-based cards are better for low-error-rate communications. - - - Quick Overview + The rest of this section demonstrates how to configure a + modem to receive incoming connections, how to communicate + with the modem, and offers some troubleshooting tips. + + + Modem Configuration getty As with terminals, init spawns a getty process for each configured serial - port for dial-in connections. For example, if a modem is - attached to /dev/ttyu0, - ps ax might show this: - - 4850 ?? I 0:00.09 /usr/libexec/getty V19200 ttyu0 - - When a user dials the modem's line and the modems connect, - the Carrier Detect (CD) line is reported by + port used for dial-in connections. When a user dials the + modem's line and the modems connect, + the Carrier Detect signal is reported by the modem. The kernel notices that the carrier has been detected and instructs getty to open the - port. getty sends a + port and display a login: prompt at the specified initial line - speed. getty watches to see if legitimate - characters are received, and, in a typical configuration, if - it finds junk (probably due to the modem's connection speed - being different than getty's speed), + speed. In a typical configuration, if garbage characters are + received, usually due to the modem's connection speed + being different than the configured speed, getty tries adjusting the line speeds until - it receives reasonable characters. - - - /usr/bin/login - - After the user enters their login name, + it receives reasonable characters. After the user enters their login name, getty executes - /usr/bin/login, which completes the login + login, which completes the login process by asking for the user's password and then starting the user's shell. - - - - Configuration Files - - There are three system configuration files in - /etc that probably - need to be edited to allow dial-up access to the &os; system. - /etc/gettytab contains configuration - information for the /usr/libexec/getty - daemon. /etc/ttys holds information that - tells init which - ttys should have - getty processes running on them. Lastly, - port initialization commands can be placed in - /etc/rc.d/serial. + + /usr/bin/login + - There are two schools of thought regarding dial-up modems - on &unix;. One group likes to configure their modems and + There are two schools of thought regarding dial-up modems. + One confiuration method is to set the modems and systems so that no matter at what speed a remote user dials - in, the local computer-to-modem RS-232 interface runs at a + in, the dial-in RS-232 + interface runs at a locked speed. The benefit of this configuration is that the remote user always sees a system login prompt immediately. The downside is that the system does not know what a user's @@ -1110,68 +1093,44 @@ ttyu5 "/usr/libexec/getty std.19200" screen-painting methods to make their response better for slower connections. - The other group configures their modems' RS-232 interface + The second method is to configure the RS-232 interface to vary its speed based on the remote user's connection speed. - For example, V.32bis (14.4 Kbps) connections to the modem - might make the modem run its RS-232 interface at - 19.2 Kbps, while 2400 bps connections make the - modem's RS-232 interface run at 2400 bps. Because + Because getty does not understand any particular - modem's connection speed reporting, getty + modem's connection speed reporting, it gives a login: message at an initial speed and watches the characters that come back in response. If the - user sees junk, it is assumed that they know they should press + user sees junk, they should press Enter until they see a recognizable prompt. If the data rates do not match, getty sees - anything the user types as junk, tries going to - the next speed and gives the login: prompt + anything the user types as junk, tries + the next speed, and gives the login: prompt again. This procedure normally only takes a keystroke or two before the user sees a good prompt. This login sequence does - not look as clean as the locked-speed method, + not look as clean as the locked-speed method, but a user on a low-speed connection should receive better interactive response from full-screen programs. - This section will try to give balanced configuration - information, but is biased towards having the modem's data - rate follow the connection rate. - - - <filename>/etc/gettytab</filename> - - - /etc/gettytab - - /etc/gettytab is a - &man.termcap.5;-style file of configuration information for - &man.getty.8;. Refer to &man.gettytab.5; for complete - information on the format of the file and the list of - capabilities. - When locking a modem's data communications rate at a particular speed, no changes to - /etc/gettytab should be needed. - - However, a change is needed to create a matching-speed - configuration. Create an entry in - /etc/gettytab to give - getty information about the speeds to use - for the modem. For a 2400 bps modem, use the existing - D2400 entry. - - # -# Fast dialup terminals, 2400/1200/300 rotary (can start either way) -# -D2400|d2400|Fast-Dial-2400:\ - :nx=D1200:tc=2400-baud: -3|D1200|Fast-Dial-1200:\ - :nx=D300:tc=1200-baud: -5|D300|Fast-Dial-300:\ - :nx=D2400:tc=300-baud: - - For a higher speed modem, add an entry in - /etc/gettytab. This entry is for a + /etc/gettytab should be needed. + However, for a matching-speed + configuration, additional entries may be required in + order to define the speeds to use + for the modem. This example configures a 14.4 Kbps modem with a top interface speed of - 19.2 Kbps: + 19.2 Kbps using 8-bit, no parity connections. It + configures getty to start the + communications rate for a V.32bis connection at + 19.2 Kbps, then cycles + through 9600 bps, 2400 bps, + 1200 bps, 300 bps, and back to 19.2 Kbps. + Communications rate cycling is implemented with the + nx= (next table) + capability. Each line uses a + tc= (table continuation) + entry to pick up the rest of the + settings for a particular data rate. # # Additions for a V.32bis Modem @@ -1187,24 +1146,9 @@ up|V9600|High Speed Modem at 9600,8-bit: uq|V19200|High Speed Modem at 19200,8-bit:\ :nx=V9600:tc=std.19200: - This will result in 8-bit, no parity connections. - - The example above starts the communications rate at - 19.2 Kbps (for a V.32bis connection), then cycles - through 9600 bps (for V.32), 2400 bps, - 1200 bps, 300 bps, and back to 19.2 Kbps. - Communications rate cycling is implemented with the - nx= (next table) - capability. Each of the lines uses a - tc= (table continuation) - entry to pick up the rest of the standard - settings for a particular data rate. - - For a 28.8 Kbps modem or to take advantage of + For a 28.8 Kbps modem, or to take advantage of compression on a 14.4 Kbps modem, use a higher - communications rate than 19.2 Kbps. Here is an - example of a gettytab entry starting - a 57.6 Kbps: + communications rate, as seen in this example: # # Additions for a V.32bis or V.34 Modem @@ -1221,116 +1165,71 @@ vp|VH9600|Very High Speed Modem at 9600, vq|VH57600|Very High Speed Modem at 57600,8-bit:\ :nx=VH9600:tc=std.57600: - For a slow CPU or a heavily loaded system without - 16550A-based serial ports, there may be + For a slow CPU or a heavily loaded system without + 16550A-based serial ports, this configuration may produce sio silo errors at 57.6 Kbps. - - - - <filename>/etc/ttys</filename> /etc/ttys - Configuration of /etc/ttys - is covered in . - Configuration for modems is similar, but a different - argument is passed to getty and a - different terminal type is specified. The general format - for both locked-speed and matching-speed configurations - is: + The configuration of /etc/ttys + is similar to , + but a different + argument is passed to getty and + dialup is used for the terminal type. + Replace + xxx with the process + init will run on the device: ttyu0 "/usr/libexec/getty xxx" dialup on - The first item in the above line is the device special - file for this entry. ttyu0 indicates - that getty is watching - /dev/ttyu0. The - xxx will replace the initial - gettytab capability and is the process - init will run on the device. The third - item, dialup, is the default terminal - type. The fourth parameter, on, - indicates to init that the line is - operational. There can be a fifth parameter, - secure, but it should only be used for - terminals which are physically secure, such as the system - console. - - The default terminal type, dialup in - this example, may depend on local preferences. - dialup is the traditional default - terminal type on dial-up lines so that users may customize - their login scripts to notice when the terminal is - dialup and automatically adjust their - terminal type. Setting vt102 as the - default terminal type allows users to use VT102 emulation on + The dialup terminal type can be + changed. For example, setting vt102 as the + default terminal type allows users to use VT102 emulation on their remote systems. - After editing /etc/ttys, send the - init process a HUP - signal to re-read the file: - - &prompt.root; kill -HUP 1 - - Wait until the modem is properly configured and - connected before signaling init. - - For a locked-speed configuration, the - ttys entry needs to have a - fixed-speed entry provided to getty. - For a modem whose port speed is locked at 19.2 Kbps, - the ttys entry might look like - this: - - ttyu0 "/usr/libexec/getty std.19200" dialup on - - If the modem is locked at a different data rate, - substitute the appropriate value for - std.speed - instead of std.19200. Make sure to use + For a locked-speed configuration, specify the speed with a valid type listed in - /etc/gettytab. + /etc/gettytab. + This example is for a modem whose port speed is locked at + 19.2 Kbps: + + ttyu0 "/usr/libexec/getty std.19200" dialup on In a matching-speed configuration, the - ttys entry needs to reference the + entry needs to reference the appropriate beginning auto-baud entry in - /etc/gettytab. For example, for the - above suggested entry for a matching-speed modem that - starts at 19.2 Kbps, the - /etc/ttys entry might look like - this: + /etc/gettytab. To continue the example + for a matching-speed modem that + starts at 19.2 Kbps, use this entry: ttyu0 "/usr/libexec/getty V19200" dialup on - - - <filename>/etc/rc.d/serial</filename> + After editing /etc/ttys, wait until + the modem is properly configured and + connected before signaling init: + + &prompt.root; kill -HUP 1 rc files rc.serial - High-speed modems, like V.32, V.32bis, and V.34 modems, - need to use hardware (RTS/CTS) flow - control. stty can be used to set the - hardware flow control flag in the &os; kernel for the modem - ports. - - For example, to set the termios flag - crtscts on + High-speed modems, like V.32, + V.32bis, and V.34 modems, + use hardware (RTS/CTS) flow + control. Use stty to set the + hardware flow control flag for the modem + port. This example sets the + crtscts flag on COM2's dial-in and dial-out - initialization devices, the following lines could be added - to /etc/rc.d/serial: + initialization devices: - # Serial port initial configuration -stty -f /dev/ttyu1.init crtscts -stty -f /dev/cuau1.init crtscts - - + &prompt.root; stty -f /dev/ttyu1.init crtscts +&prompt.root; stty -f /dev/cuau1.init crtscts @@ -1462,9 +1361,6 @@ AT&B1&W ATZ AT&B2&W - - Checking the Modem's Configuration - Most high-speed modems provide commands to view the modem's current operating parameters in a somewhat human-readable fashion. On the &usrobotics; &sportster; @@ -1477,7 +1373,6 @@ AT&B2&W For a different brand of modem, check the modem's manual to see how to double-check the modem's configuration parameters. -