Date: Wed, 7 May 2014 16:22:53 +0000 (UTC) From: Dru Lavigne <dru@FreeBSD.org> 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 Message-ID: <201405071622.s47GMrhc061021@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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.</para> </listitem> </itemizedlist> - </sect2> - - <sect2> - <title>Kernel Configuration</title> - - <para>&os; supports four serial ports by default. In the - &ms-dos; world, these are known as <filename>COM1</filename>, - <filename>COM2</filename>, <filename>COM3</filename>, and - <filename>COM4</filename>. &os; currently supports - <quote>dumb</quote> 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.</para> - - <para>To see if the kernel recognizes the serial ports, watch - for messages while the kernel is booting, or use - <command>/sbin/dmesg</command> to replay the kernel's boot - messages. Look for messages that start with the characters - <literal>uart</literal>:</para> - <screen>&prompt.root; <userinput>/sbin/dmesg | grep 'uart'</userinput></screen> - - <para>If the kernel does not recognize all of the serial ports, - configure <filename>/boot/device.hints</filename>. When - editing this file, one can comment out or completely remove - lines for devices that do not exist on the system.</para> - - <note> - <para><literal>port IO_COM1</literal> is a substitution for - <literal>port 0x3f8</literal>, <literal>IO_COM2</literal> is - <literal>0x2f8</literal>, <literal>IO_COM3</literal> is - <literal>0x3e8</literal>, and <literal>IO_COM4</literal> is - <literal>0x2e8</literal>. 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 <emphasis>cannot</emphasis> 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.</para> - </note> - </sect2> - - <sect2> - <title>Device Special Files</title> - - <para>Most devices in the kernel are accessed through - <quote>device special files</quote> which are located in - <filename class="directory">/dev</filename>. The - <filename>sio</filename> devices are accessed through the - <filename>/dev/ttyu<replaceable>N</replaceable></filename> - (dial-in) and - <filename>/dev/cuau<replaceable>N</replaceable></filename> - (call-out) devices. &os; also provides initialization + <para>&os; also provides initialization devices - (<filename>/dev/ttyu<replaceable>N</replaceable>.init</filename> - and - <filename>/dev/cuau<replaceable>N</replaceable>.init</filename>) + (<filename>/dev/ttyu<replaceable>N</replaceable>.init</filename> and + <filename>/dev/cuau<replaceable>N</replaceable>.init</filename> + or + <filename>/dev/cuad<replaceable>N</replaceable>.init</filename>) and locking devices (<filename>/dev/ttyu<replaceable>N</replaceable>.lock</filename> and - <filename>/dev/cuau<replaceable>N</replaceable>.lock</filename>). + <filename>/dev/cuau<replaceable>N</replaceable>.lock</filename> + or + <filename>/dev/cuad<replaceable>N</replaceable>.lock</filename>). The initialization devices are used to initialize communications port parameters each time a port is opened, such as <literal>crtscts</literal> for modems which use @@ -607,28 +558,56 @@ devices, and setting terminal options, respectively.</para> </sect2> - <sect2 xml:id="serial-hw-config"> <title>Serial Port Configuration</title> + <para>By default, &os; supports four serial ports which are + commonly known as <filename>COM1</filename>, + <filename>COM2</filename>, <filename>COM3</filename>, and + <filename>COM4</filename>. &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 <filename>COM</filename> ports.</para> + + <para>To see if the system recognizes the serial ports, look for + system boot messages that start with + <literal>uart</literal>:</para> + + <screen>&prompt.root; <userinput>grep uart /var/run/dmesg.boot</userinput></screen> + + <para>If the system does not recognize all of the needed serial ports, + additional entries can be added to + <filename>/boot/device.hints</filename>. This file already + contains <literal>hint.uart.0.*</literal> entries for + <filename>COM1</filename> and <literal>hint.uart.1.*</literal> entries + for <filename>COM2</filename>. When adding a port entry for + <filename>COM3</filename> use + <literal>0x3E8</literal>, and for <filename>COM4</filename> use + <literal>0x2E8</literal>. Common <acronym>IRQ</acronym> addresses + are <literal>5</literal> for <filename>COM3</filename> and + <literal>9</literal> for <filename>COM4</filename>.</para> + <indexterm><primary><filename>ttyu</filename></primary></indexterm> <indexterm><primary><filename>cuau</filename></primary></indexterm> - <para>The - <filename>ttyu<replaceable>N</replaceable></filename> (or - <filename>cuau<replaceable>N</replaceable></filename>) - 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:</para> + <para>To determine the default set of terminal + <acronym>I/O</acronym> settings used by the port, specify its + device name. This example determines the settings for the + call-in port on <filename>COM2</filename>:</para> - <screen>&prompt.root; <userinput>stty -a -f /dev/ttyu1</userinput></screen> + <screen>&prompt.root; <userinput>stty -a -f /dev/<replaceable>ttyu1</replaceable></userinput></screen> - <para>When the settings are changed for a device, the settings - are in effect until the device is closed. When the device is + <para>System-wide initialization of serial devices is + controlled by <filename>/etc/rc.d/serial</filename>. This + file affects the default settings of serial devices. To + change the settings for a device, use <command>stty</command>. + 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 - <quote>initial state</quote> device. For example, to turn on + initialization device. For example, to turn on <option>CLOCAL</option> mode, 8 bit communication, and <option>XON/XOFF</option> flow control for <filename>ttyu5</filename>, type:</para> @@ -640,24 +619,16 @@ <secondary><filename>rc.serial</filename></secondary> </indexterm> - <para>System-wide initialization of serial devices is - controlled by <filename>/etc/rc.d/serial</filename>. This - file affects the default settings of serial devices.</para> - <para>To prevent certain settings from being changed by an - application, make adjustments to the <quote>lock state</quote> + application, make adjustments to the locking device. For example, to lock the speed of <filename>ttyu5</filename> to 57600 bps, type:</para> <screen>&prompt.root; <userinput>stty -f /dev/ttyu5.lock 57600</userinput></screen> - <para>Now, an application that opens + <para>Now, any application that opens <filename>ttyu5</filename> and tries to change the speed of the port will be stuck with 57600 bps.</para> - - <para>The initial state and lock state devices should only be - writable by <systemitem - class="username">root</systemitem>.</para> </sect2> </sect1>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405071622.s47GMrhc061021>