From owner-svn-doc-all@FreeBSD.ORG Wed May 7 16:22:53 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 6588E704; Wed, 7 May 2014 16:22:53 +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 46878D71; Wed, 7 May 2014 16:22:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s47GMr9H061022; Wed, 7 May 2014 16:22:53 GMT (envelope-from dru@svn.freebsd.org) Received: (from dru@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47GMrhc061021; Wed, 7 May 2014 16:22:53 GMT (envelope-from dru@svn.freebsd.org) Message-Id: <201405071622.s47GMrhc061021@svn.freebsd.org> From: Dru Lavigne Date: Wed, 7 May 2014 16:22:53 +0000 (UTC) To: doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org Subject: svn commit: r44785 - 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 16:22:53 -0000 Author: dru Date: Wed May 7 16:22:52 2014 New Revision: 44785 URL: http://svnweb.freebsd.org/changeset/doc/44785 Log: Editorial review of Serial Port Configuration. Minor shuffling to remove redundancy. 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 15:22:51 2014 (r44784) +++ head/en_US.ISO8859-1/books/handbook/serialcomms/chapter.xml Wed May 7 16:22:52 2014 (r44785) @@ -534,68 +534,19 @@ signal. - - - - Kernel Configuration - - &os; supports four serial ports by default. In the - &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 - multi-port cards such as those made by Digiboard and Stallion - 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: - &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. - - - port IO_COM1 is a substitution for - port 0x3f8, IO_COM2 is - 0x2f8, IO_COM3 is - 0x3e8, and IO_COM4 is - 0x2e8. These are fairly common port - 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. - - - - - Device Special Files - - Most devices in the kernel are accessed through - device special files which are located in - /dev. The - sio devices are accessed through the - /dev/ttyuN - (dial-in) and - /dev/cuauN - (call-out) devices. &os; also provides initialization + &os; also provides initialization devices - (/dev/ttyuN.init - and - /dev/cuauN.init) + (/dev/ttyuN.init and + /dev/cuauN.init + or + /dev/cuadN.init) and locking devices (/dev/ttyuN.lock and - /dev/cuauN.lock). + /dev/cuauN.lock + or + /dev/cuadN.lock). The initialization devices are used to initialize communications port parameters each time a port is opened, such as crtscts for modems which use @@ -607,28 +558,56 @@ devices, and setting terminal options, respectively. - Serial Port Configuration + By default, &os; supports four serial ports which are + commonly known as COM1, + COM2, COM3, and + COM4. &os; also supports + dumb multi-port serial interface cards, such as + the BocaBoard 1008 and 2016, as well as more intelligent + multi-port cards such as those made by Digiboard. However, + the default kernel only looks for the + standard COM ports. + + To see if the system recognizes the serial ports, look for + system boot messages that start with + uart: + + &prompt.root; grep uart /var/run/dmesg.boot + + If the system does not recognize all of the needed serial ports, + additional entries can be added to + /boot/device.hints. This file already + contains hint.uart.0.* entries for + COM1 and hint.uart.1.* entries + for COM2. When adding a port entry for + COM3 use + 0x3E8, and for COM4 use + 0x2E8. Common IRQ addresses + are 5 for COM3 and + 9 for COM4. + ttyu cuau - The - ttyuN (or - cuauN) - is the regular device to open for applications. When a - process opens the device, it will have a default set of - terminal I/O settings. These settings can be viewed with the - command: + To determine the default set of terminal + I/O settings used by the port, specify its + device name. This example determines the settings for the + call-in port on COM2: - &prompt.root; stty -a -f /dev/ttyu1 + &prompt.root; stty -a -f /dev/ttyu1 - When the settings are changed for a device, the settings - are in effect until the device is closed. When the device is + System-wide initialization of serial devices is + controlled by /etc/rc.d/serial. This + file affects the default settings of serial devices. To + change the settings for a device, use stty. + By default, the changed settings + are in effect until the device is closed and when the device is reopened, it goes back to the default set. To permanently change the default set, open and adjust the settings of the - initial state device. For example, to turn on + initialization device. For example, to turn on mode, 8 bit communication, and flow control for ttyu5, type: @@ -640,24 +619,16 @@ rc.serial - System-wide initialization of serial devices is - controlled by /etc/rc.d/serial. This - file affects the default settings of serial devices. - To prevent certain settings from being changed by an - application, make adjustments to the lock state + application, make adjustments to the locking device. For example, to lock the speed of ttyu5 to 57600 bps, type: &prompt.root; stty -f /dev/ttyu5.lock 57600 - Now, an application that opens + Now, any application that opens ttyu5 and tries to change the speed of the port will be stuck with 57600 bps. - - The initial state and lock state devices should only be - writable by root.