]> git.ipfire.org Git - thirdparty/util-linux.git/blame - sys-utils/setserial.8
Imported from util-linux-2.5 tarball.
[thirdparty/util-linux.git] / sys-utils / setserial.8
CommitLineData
6dbe3af9
KZ
1.\" Copyright 1992, 1993 Rickard E. Faith (faith@cs.unc.edu)
2.\" May be distributed under the GNU General Public License
3.\" Portions of this text are from the README in setserial-2.01.tar.z,
4.\" but I can't figure out who wrote that document. If anyone knows,
5.\" please tell me
6.\"
7.\" [tytso:19940519.2239EDT] I did... - Ted Ts'o (tytso@mit.edu)
8.\" Sat Aug 27 17:08:38 1994 Changes from Kai Petzke
9.\" (wpp@marie.physik.tu-berlin.de) were applied by Rik Faith
10.\" (faith@cs.unc.edu)
11.\" "
12.TH SETSERIAL 8 "27 August 1994" "Setserial 2.10" "Linux Programmer's Manual"
13.SH NAME
14setserial \- get/set Linux serial port information
15.SH SYNOPSIS
16.B setserial
17.B "[ \-abqvVW ]"
18device
19.BR "[ " parameter1 " [ " arg " ] ] ..."
20
21.B "setserial -g"
22.B "[ \-abv ]"
23device1 ...
24.SH DESCRIPTION
25.B setserial
26is a program designed to set and/or report the configuration information
27associated with a serial port. This information includes what I/O
28port and IRQ a particular serial port is using, and whether or not the
29break key should be interpreted as the Secure Attention Key, and so
30on.
31
32During the normal bootup process, only COM ports 1-4 are initialized,
33using the default I/O ports and IRQ values, as listed below. In order
34to initialize any additional serial ports, or to change the COM 1-4
35ports to a nonstadard configuration, the
36.B setserial
37program should be used. Typically it is called from an
38.I rc.serial
39script, which is usually run out of
40.IR /etc/rc.local .
41
42The
43.I device
44argument or arguments specifies the serial device which should be configured or
45interrogated. It will usually have the following form:
46.BR /dev/cua[0-3] .
47
48If no parameters are specified,
49.B setserial
50will print out the port type (i.e., 8250, 16450, 16550, 16550A), the
51hardware I/O port, the hardware IRQ line, its "baud base," and some of
52its operational flags.
53
54If the
55.B \-g
56option is given, the arguments to setserial are interpreted as a list
57of devices for which the characteristics of those devices should be
58printed.
59
60Without the
61.B \-g
62option, the first argument to setserial is interpreted as the device
63to be modified or characteristics to be printed, and any additional
64arguments are interpreted as parameters which should be assigned
65to that serial device.
66
67For the most part, superuser privilege is required to set the
68configuration parameters of a serial port. A few serial port parameters
69can be set by normal users, however, and these will be noted as
70exceptions in this manual page.
71
72.SH OPTIONS
73.B Setserial
74accepts the following options:
75
76.TP
77.B \-a
78When reporting the configuration of a serial device, print all
79available information.
80.TP
81.B \-b
82When reporting the configuration of a serial device, print a summary
83of the device's configuration, which might be suitable for printing
84during the bootup process, during the /etc/rc script.
85.TP
86.B \-q
87Be quiet.
88.B Setserial
89will print fewer lines of output.
90.TP
91.B \-v
92Be verbose.
93.B Setserial
94will print additional status output.
95.TP
96.B \-V
97Display version and exit.
98.TP
99.B \-W
100Do wild interrupt initialization and exit.
101
102.SH PARAMETERS
103The following parameters can be assigned to a serial port.
104
105All argument values are assumed to be in decimal unless preceeded by "0x".
106
107.TP
108.BR port " port_number"
109The
110.B port
111option sets the I/O port, as described above.
112.TP
113.BR irq " irq_number"
114The
115.B irq
116option sets the hardware IRQ, as described above.
117.TP
118.BR uart " uart_type"
119This option is used to set the UART type. The permitted types are
120.BR none ,
1218250, 16450, 16550, and 16550A. Since the 8250 and 16450 UARTS do not have
122FIFO's, and since the original 16550 have bugs which make the FIFO's unusable,
123the FIFO will only be used on chips identifiied as 16550A UARTs.
124Setting the UART type to 8250, 16450, or 16550 will enable the serial
125port without trying to use the FIFO. Using UART type
126.B none
127will disable the port.
128
129Some internal modems are billed as having a "16550A UART with a 1k
130buffer". This is a lie. They do not have really have a 16550A
131compatible UART; instead what they have is a 16450 compatible UART
132with a 1k receive buffer to prevent receiver overruns. This is
133important, because they do not have a transmit FIFO. Hence, they are
134not compatible with a 16550A UART, and the autoconfiguration process
135will correctly identify them as 16450's. If you attempt to override
136this using the
137.B uart
138parameter, you will see dropped characters during file transmissions.
139These UART's usually have other problems: the
140.B skip_test
141parameter also often must be specified.
142.TP
143.B autoconfig
144When this parameter is given,
145.B setserial
146will ask the kernel to attempt to automatically configure the serial
147port. The I/O port must be correctly set; the kernel will attempt to
148determine the UART type, and if the
149.B auto_irq
150parameter is set, Linux will attempt to automatically determine the
151IRQ. The
152.B autoconfigure
153parameter should be given after the
154.BR port , auto_irq ", and" skip_test
155parameters have been specified.
156.TP
157.B auto_irq
158During autoconfiguration, try to determine the IRQ. This feature is
159not guaranteed to always produce the correct result; some hardware
160configurations will fool the Linux kernel. It is generally safer not
161to use the
162.B auto_irq
163feature, but rather to specify the IRQ to be used explicitly, using
164the
165.B irq
166parameter.
167.TP
168.B ^auto_irq
169During autoconfiguration, do
170.I not
171try to determine the IRQ.
172.TP
173.B skip_test
174During autoconfiguration, skip the UART test. Some internal modems do
175not have National Semiconductor compatible UART's, but have cheap
176imitations instead. Some of these cheasy imitations UART's do not
177fully support the loopback detection mode, which is used by the kernel
178to make sure there really is a UART at a particular address before
179attempting to configure it. So for certain internal modems you will
180need to specify this parameter so Linux can initialize the UART
181correctly.
182.TP
183.B ^skip_test
184During autoconfiguration, do
185.I not
186skip the UART test.
187.TP
188.BR baud_base " baud_base"
189This option sets the base baud rate, which is the clock frequency divided
190by 16. Normally this value is 115200, which is also the fastest baud
191rate which the UART can support.
192.TP
193.B
194spd_hi
195Use 57.6kb when the application requests 38.4kb.
196This parameter may be specified by a non-privileged user.
197.TP
198.B spd_vhi
199Use 115kb when the application requests 38.4kb.
200This parameter may be specified by a non-privileged user.
201.TP
202.B spd_cust
203Use the custom divisor to set the speed when the application requests
20438.4kb. In this case, the baud rate is the
205.B baud_base
206divided by the
207.BR divisor .
208This parameter may be specified by a non-privileged user.
209.TP
210.B spd_normal
211Use 38.4kb when the application requests 38.4kb.
212This parameter may be specified by a non-privileged user.
213.TP
214.BR divisor " divisor"
215This option sets the custom divison. This divisor will be used then the
216.B spd_cust
217option is selected and the serial port is set to 38.4kb by the
218application.
219This parameter may be specified by a non-privileged user.
220.TP
221.B sak
222Set the break key at the Secure Attention Key.
223.TP
224.B ^sak
225disable the Secure Attention Key.
226.TP
227.B fourport
228Configure the port as an AST Fourport card.
229.TP
230.B ^fourport
231Disable AST Fourport configuration.
232.TP
233.BR close_delay " delay"
234Specify the amount of time, in hundredths of a second, that DTR should
235remain low on a serial line after the callout device is closed, before
236the blocked dialin device raises DTR again. The default value of this
237option is 50, or a half-second delay.
238.TP
239.B session_lockout
240Lock out callout port (/dev/cuaXX) accesses across different sessions.
241That is, once a process has opened a port, do not allow a process with
242a different session ID to open that port until the first process has
243closed it.
244.TP
245.B ^session_lockout
246Do not lock out callout port accesses across different sessions.
247.TP
248.B pgrp_lockout
249Lock out callout port (/dev/cuaXX) accesses across different process groups.
250That is, once a process has opened a port, do not allow a process in a
251different process group to open that port until the first process has
252closed it.
253.TP
254.B ^pgrp_lockout
255Do not lock out callout port accesses across different process groups.
256.TP
257.B hup_notify
258Notify a process blocked on opening a dial in line when a process has
259finished using a callout line (either by closing it or by the serial
260line being hung up) by returning EAGAIN to the open.
261
262The application of this parameter is for getty's which are blocked on
263a serial port's dial in line. This allows the getty to reset the
264modem (which may have had its configuration modified by the
265application using the callout device) before blocking on the open again.
266.TP
267.B ^hup_notify
268Do not notify a process blocked on opening a dial in line when the
269callout device is hung up.
270.TP
271.B split_termios
272Treat the termios settings used by the callout device and the termios
273settings used by the dialin devices as separate.
274.TP
275.B ^split_termios
276Use the same termios structure to store both the dialin and callout
277ports. This is the default option.
278.TP
279.B callout_nohup
280If this particular serial port is opened as a callout device, do not
281hangup the tty when carrier detect is dropped.
282.TP
283.B ^callout_nohup
284Do not skip hanging up the tty when a serial port is opened as a
285callout device. Of course, the HUPCL termios flag must be enabled if
286the hangup is to occur.
287.SH CONSIDERATIONS OF CONFIGURING SERIAL PORTS
288It is important to note that setserial merely tells the Linux kernel
289where it should expect to find the I/O port and IRQ lines of a
290particular serial port. It does *not* configure the hardware, the
291actual serial board, to use a particular I/O port. In order to do
292that, you will need to physically program the serial board, usually by
293setting some jumpers or by switching some DIP switches.
294
295This section will provide some pointers in helping you decide how you
296would like to configure your serial ports.
297
298The "standard MS-DOS" port associations are given below:
299
300.nf
301.RS
302/dev/ttyS0 (COM1), port 0x3f8, irq 4
303/dev/ttyS1 (COM2), port 0x2f8, irq 3
304/dev/ttyS2 (COM3), port 0x3e8, irq 4
305/dev/ttyS3 (COM4), port 0x2e8, irq 3
306.RE
307.fi
308
309Due to the limitations in the design of the AT/ISA bus architecture,
310normally an IRQ line may not be shared between two or more serial
311ports. If you attempt to do this, one or both serial ports will
312become unreliable if you try to use both simultaneously. This
313limitation can be overcome by special multi-port serial port boards,
314which are designed to share multiple serial ports over a single IRQ
315line. Multi-port serial cards supported by Linux include the AST
316FourPort, the Accent Async board, the Usenet Serial II board, the
317Bocaboard BB-1004, BB-1008, and BB-2016 boards, and the HUB-6 serial
318board.
319
320The selection of an alternative IRQ line
321is difficult, since most of them are already used. The following table
322lists the "standard MS-DOS" assignments of available IRQ lines:
323
324.nf
325.RS
326IRQ 3: COM2
327IRQ 4: COM1
328IRQ 5: LPT2
329IRQ 7: LPT1
330.RE
331.fi
332
333Most people find that IRQ 5 is a good choice, assuming that there is
334only one parallel port active in the computer. Another good choice is
335IRQ 2 (aka IRQ 9); although this IRQ is sometimes used by network
336cards, and very rarely VGA cards will be configured to use IRQ 2 as a
337vertical retrace interrupt. If your VGA card is configured this way;
338try to disable it so you can reclaim that IRQ line for some other
339card. It's not necessary for Linux and most other Operating systems.
340
341The only other available IRQ lines are 3, 4, and 7, and these are
342probably used by the other serial and parallel ports. (If your serial
343card has a 16bit card edge connector, and supports higher interrupt
344numbers, then IRQ 10, 11, 12, and 15 are also available.)
345
346On AT class machines, IRQ 2 is seen as IRQ 9, and Linux will interpret it
347in this manner.
348
349IRQ's other than 2 (9), 3, 4, 5, 7, 10, 11, 12, and 15, should
350.I not
351be used, since they are assigned to other hardware and cannot, in general,
352be changed. Here are the "standard" assignments:
353
354.nf
355.RS
356IRQ 0 Timer channel 0
357IRQ 1 Keyboard
358IRQ 2 Cascade for controller 2
359IRQ 3 Serial port 2
360IRQ 4 Serial port 1
361IRQ 5 Parallel port 2 (Reserved in PS/2)
362IRQ 6 Floppy diskette
363IRQ 7 Parallel port 1
364IRQ 8 Real-time clock
365IRQ 9 Redirected to IRQ2
366IRQ 10 Reserved
367IRQ 11 Reserved
368IRQ 12 Reserved (Auxillary device in PS/2)
369IRQ 13 Math coprocessor
370IRQ 14 Hard disk controller
371IRQ 15 Reserved
372.RE
373.fi
374
375
376.SH CAUTION
377CAUTION: Using an invalid port can lock up your machine.
378.SH FILES
379.BR /etc/rc.local
380.BR /etc/rc.serial
381.SH "SEE ALSO"
382.BR tty (4),
383.BR ttys (4),
384kernel/chr_drv/serial.c
385.SH AUTHOR
386The original version of setserial was written by Rick Sladkey
387(jrs@world.std.com), and was modified by Michael K. Johnson
388(johnsonm@stolaf.edu).
389
390This version has since been rewritten from scratch by Theodore Ts'o
391(tytso@mit.edu) on 1/1/93. Any bugs or problems are solely his
392responsibility.