Penguin
Blame: setserial(8)
EditPageHistoryDiffInfoLikePages
Annotated edit history of setserial(8) version 2, including all changes. View license author blame.
Rev Author # Line
1 perry 1 SETSERIAL
2 !!!SETSERIAL
3 NAME
4 SYNOPSIS
5 DESCRIPTION
6 OPTIONS
7 PARAMETERS
8 CONSIDERATIONS OF CONFIGURING SERIAL PORTS
9 MULTIPORT CONFIGURATION
10 Hayes ESP Configuration
11 CAUTION
12 FILES
13 SEE ALSO
14 AUTHOR
15 ----
16 !!NAME
17
18
19 setserial - get/set Linux serial port information
20 !!SYNOPSIS
21
22
23 __setserial [[ -abqvVWz ]__ device __[[__ parameter1
24 __[[__ arg __] ] ...__
25
26
27 __setserial -g [[ -abGv ]__ device1 ...
28 !!DESCRIPTION
29
30
31 __setserial__ is a program designed to set and/or report
32 the configuration information associated with a serial port.
33 This information includes what I/O port and IRQ a particular
34 serial port is using, and whether or not the break key
35 should be interpreted as the Secure Attention Key, and so
36 on.
37
38
39 During the normal bootup process, only COM ports 1-4 are
40 initialized, using the default I/O ports and IRQ values, as
41 listed below. In order to initialize any additional serial
42 ports, or to change the COM 1-4 ports to a nonstadard
43 configuration, the __setserial__ program should be used.
44 Typically it is called from an ''setserial'' script,
45 which is usually run out of ''/etc/init.d''.
46
47
48 The ''device'' argument or arguments specifies the serial
49 device which should be configured or interrogated. It will
50 usually have the following form:
51 __/dev/ttyS[[0-3]__.
52
53
54 If no parameters are specified, __setserial__ will print
55 out the port type (i.e., 8250, 16450, 16550, 16550A, etc.),
56 the hardware I/O port, the hardware IRQ line, its
57 __
58
59
60 If the __-g__ option is given, the arguments to setserial
61 are interpreted as a list of devices for which the
62 characteristics of those devices should be
63 printed.
64
65
66 Without the __-g__ option, the first argument to
67 setserial is interpreted as the device to be modified or
68 characteristics to be printed, and any additional arguments
69 are interpreted as parameters which should be assigned to
70 that serial device.
71
72
73 For the most part, superuser privilege is required to set
74 the configuration parameters of a serial port. A few serial
75 port parameters can be set by normal users, however, and
76 these will be noted as exceptions in this manual
77 page.
78 !!OPTIONS
79
80
81 __Setserial__ accepts the following options:
82
83
84 __-a__
85
86
87 When reporting the configuration of a serial device, print
88 all available information.
89
90
91 __-b__
92
93
94 When reporting the configuration of a serial device, print a
95 summary of the device's configuration, which might be
96 suitable for printing during the bootup process, during the
97 /etc/rc script.
98
99
100 __-G__
101
102
103 Print out the configuration information of the serial port
104 in a form which can be fed back to setserial as command-line
105 arguments.
106
107
108 __-q__
109
110
111 Be quiet. __Setserial__ will print fewer lines of
112 output.
113
114
115 __-v__
116
117
118 Be verbose. __Setserial__ will print additional status
119 output.
120
121
122 __-V__
123
124
125 Display version and exit.
126
127
128 __-W__
129
130
131 Do wild interrupt initialization and exit. This option is no
132 longer relevant in Linux kernels after version
133 2.1.
134
135
136 __-z__
137
138
139 Zero out the serial flags before starting to set flags. This
140 is related to the automatic saving of serial flags using the
141 -G flag.
142 !!PARAMETERS
143
144
145 The following parameters can be assigned to a serial
146 port.
147
148
149 All argument values are assumed to be in decimal unless
150 preceeded by
151
152
153 __port__ port_number
154
155
156 The __port__ option sets the I/O port, as described
157 above.
158
159
160 __irq__ irq_number
161
162
163 The __irq__ option sets the hardware IRQ, as described
164 above.
165
166
167 __uart__ uart_type
168
169
170 This option is used to set the UART type. The permitted
171 types are __none__, 8250, 16450, 16550, 16550A, 16650,
172 16650V2, 16654, 16750, 16850, 16950, and 16954. Using UART
173 type __none__ will disable the port.
174
175
176 Some internal modems are billed as having a
177 uart__ parameter, you will see
178 dropped characters during file transmissions. These UART's
179 usually have other problems: the __skip_test__ parameter
180 also often must be specified.
181
182
183 __autoconfig__
184
185
186 When this parameter is given, __setserial__ will ask the
187 kernel to attempt to automatically configure the serial
188 port. The I/O port must be correctly set; the kernel will
189 attempt to determine the UART type, and if the
190 __auto_irq__ parameter is set, Linux will attempt to
191 automatically determine the IRQ. The __autoconfig__
192 parameter should be given after the
193 __port__,__auto_irq__, and __skip_test__ parameters
194 have been specified.
195
196
197 __auto_irq__
198
199
200 During autoconfiguration, try to determine the IRQ. This
201 feature is not guaranteed to always produce the correct
202 result; some hardware configurations will fool the Linux
203 kernel. It is generally safer not to use the __auto_irq__
204 feature, but rather to specify the IRQ to be used
205 explicitly, using the __irq__ parameter.
206
207
208 __^auto_irq__
209
210
211 During autoconfiguration, do ''not'' try to determine the
212 IRQ.
213
214
215 __skip_test__
216
217
218 During autoconfiguration, skip the UART test. Some internal
219 modems do not have National Semiconductor compatible UART's,
220 but have cheap imitations instead. Some of these cheasy
221 imitations UART's do not fully support the loopback
222 detection mode, which is used by the kernel to make sure
223 there really is a UART at a particular address before
224 attempting to configure it. So for certain internal modems
225 you will need to specify this parameter so Linux can
226 initialize the UART correctly.
227
228
229 __^skip_test__
230
231
232 During autoconfiguration, do ''not'' skip the UART
233 test.
234
235
236 __baud_base__ baud_base
237
238
239 This option sets the base baud rate, which is the clock
240 frequency divided by 16. Normally this value is 115200,
241 which is also the fastest baud rate which the UART can
242 support.
243
244
245 __spd_hi__
246
247
248 Use 57.6kb when the application requests 38.4kb. This
249 parameter may be specified by a non-privileged
250 user.
251
252
253 __spd_vhi__
254
255
256 Use 115kb when the application requests 38.4kb. This
257 parameter may be specified by a non-privileged
258 user.
259
260
261 __spd_shi__
262
263
264 Use 230kb when the application requests 38.4kb. This
265 parameter may be specified by a non-privileged
266 user.
267
268
269 __spd_warp__
270
271
272 Use 460kb when the application requests 38.4kb. This
273 parameter may be specified by a non-privileged
274 user.
275
276
277 __spd_cust__
278
279
280 Use the custom divisor to set the speed when the application
281 requests 38.4kb. In this case, the baud rate is the
282 __baud_base__ divided by the __divisor__. This
283 parameter may be specified by a non-privileged
284 user.
285
286
287 __spd_normal__
288
289
290 Use 38.4kb when the application requests 38.4kb. This
291 parameter may be specified by a non-privileged
292 user.
293
294
295 __divisor__ divisor
296
297
298 This option sets the custom divison. This divisor will be
299 used then the __spd_cust__ option is selected and the
300 serial port is set to 38.4kb by the application. This
301 parameter may be specified by a non-privileged
302 user.
303
304
305 __sak__
306
307
308 Set the break key at the Secure Attention Key.
309
310
311 __^sak__
312
313
314 disable the Secure Attention Key.
315
316
317 __fourport__
318
319
320 Configure the port as an AST Fourport card.
321
322
323 __^fourport__
324
325
326 Disable AST Fourport configuration.
327
328
329 __close_delay__ delay
330
331
332 Specify the amount of time, in hundredths of a second, that
333 DTR should remain low on a serial line after the callout
334 device is closed, before the blocked dialin device raises
335 DTR again. The default value of this option is 50, or a
336 half-second delay.
337
338
339 __closing_wait__ delay
340
341
342 Specify the amount of time, in hundredths of a second, that
343 the kernel should wait for data to be transmitted from the
344 serial port while closing the port. If
345
346
347 __session_lockout__
348
349
350 Lock out callout port (/dev/cuaXX) accesses across different
351 sessions. That is, once a process has opened a port, do not
352 allow a process with a different session ID to open that
353 port until the first process has closed it.
354
355
356 __^session_lockout__
357
358
359 Do not lock out callout port accesses across different
360 sessions.
361
362
363 __pgrp_lockout__
364
365
366 Lock out callout port (/dev/cuaXX) accesses across different
367 process groups. That is, once a process has opened a port,
368 do not allow a process in a different process group to open
369 that port until the first process has closed
370 it.
371
372
373 __^pgrp_lockout__
374
375
376 Do not lock out callout port accesses across different
377 process groups.
378
379
380 __hup_notify__
381
382
383 Notify a process blocked on opening a dial in line when a
384 process has finished using a callout line (either by closing
385 it or by the serial line being hung up) by returning EAGAIN
386 to the open.
387
388
389 The application of this parameter is for getty's which are
390 blocked on a serial port's dial in line. This allows the
391 getty to reset the modem (which may have had its
392 configuration modified by the application using the callout
393 device) before blocking on the open again.
394
395
396 __^hup_notify__
397
398
399 Do not notify a process blocked on opening a dial in line
400 when the callout device is hung up.
401
402
403 __split_termios__
404
405
406 Treat the termios settings used by the callout device and
407 the termios settings used by the dialin devices as
408 separate.
409
410
411 __^split_termios__
412
413
414 Use the same termios structure to store both the dialin and
415 callout ports. This is the default option.
416
417
418 __callout_nohup__
419
420
421 If this particular serial port is opened as a callout
422 device, do not hangup the tty when carrier detect is
423 dropped.
424
425
426 __^callout_nohup__
427
428
429 Do not skip hanging up the tty when a serial port is opened
430 as a callout device. Of course, the HUPCL termios flag must
431 be enabled if the hangup is to occur.
432
433
434 __low_latency__
435
436
437 Minimize the receive latency of the serial device at the
438 cost of greater CPU utilization. (Normally there is an
439 average of 5-10ms latency before characters are handed off
440 to the line discpline to minimize overhead.) This is off by
441 default, but certain real-time applications may find this
442 useful.
443
444
445 __^low_latency__
446
447
448 Optimize for efficient CPU processing of serial characters
449 at the cost of paying an average of 5-10ms of latency before
450 the characters are processed. This is the
451 default.
452 !!CONSIDERATIONS OF CONFIGURING SERIAL PORTS
453
454
455 It is important to note that setserial merely tells the
456 Linux kernel where it should expect to find the I/O port and
457 IRQ lines of a particular serial port. It does *not*
458 configure the hardware, the actual serial board, to use a
459 particular I/O port. In order to do that, you will need to
460 physically program the serial board, usually by setting some
461 jumpers or by switching some DIP switches.
462
463
464 This section will provide some pointers in helping you
465 decide how you would like to configure your serial
466 ports.
467
468
469 The
470
471
472 /dev/ttyS0 (COM1), port 0x3f8, irq 4
473 /dev/ttyS1 (COM2), port 0x2f8, irq 3
474 /dev/ttyS2 (COM3), port 0x3e8, irq 4
475 /dev/ttyS3 (COM4), port 0x2e8, irq 3
2 perry 476 Due to the limitations in the design of the AT/ISA bus architecture, normally an IRQ line may not be shared between two or more serial ports. If you attempt to do this, one or both serial ports will become unreliable if you try to use both simultaneously. This limitation can be overcome by special multi-port serial port boards, which are designed to share multiple serial ports over a single IRQ line. Multi-port serial cards supported by Linux include the AST !FourPort, the Accent Async board, the Usenet Serial II board, the Bocaboard BB-1004, BB-1008, and BB-2016 boards, and the HUB-6 serial board.
1 perry 477
478
479 The selection of an alternative IRQ line is difficult, since
480 most of them are already used. The following table lists the
481
482
483 IRQ 3: COM2
484 IRQ 4: COM1
485 IRQ 5: LPT2
486 IRQ 7: LPT1
487 Most people find that IRQ 5 is a good choice, assuming that there is only one parallel port active in the computer. Another good choice is IRQ 2 (aka IRQ 9); although this IRQ is sometimes used by network cards, and very rarely VGA cards will be configured to use IRQ 2 as a vertical retrace interrupt. If your VGA card is configured this way; try to disable it so you can reclaim that IRQ line for some other card. It's not necessary for Linux and most other Operating systems.
488
489
490 The only other available IRQ lines are 3, 4, and 7, and
491 these are probably used by the other serial and parallel
492 ports. (If your serial card has a 16bit card edge connector,
493 and supports higher interrupt numbers, then IRQ 10, 11, 12,
494 and 15 are also available.)
495
496
497 On AT class machines, IRQ 2 is seen as IRQ 9, and Linux will
498 interpret it in this manner.
499
500
501 IRQ's other than 2 (9), 3, 4, 5, 7, 10, 11, 12, and 15,
502 should ''not'' be used, since they are assigned to other
503 hardware and cannot, in general, be changed. Here are the
504 ''
505
506
507 IRQ 0 Timer channel 0
508 IRQ 1 Keyboard
509 IRQ 2 Cascade for controller 2
510 IRQ 3 Serial port 2
511 IRQ 4 Serial port 1
512 IRQ 5 Parallel port 2 (Reserved in PS/2)
513 IRQ 6 Floppy diskette
514 IRQ 7 Parallel port 1
515 IRQ 8 Real-time clock
516 IRQ 9 Redirected to IRQ2
517 IRQ 10 Reserved
518 IRQ 11 Reserved
519 IRQ 12 Reserved (Auxillary device in PS/2)
520 IRQ 13 Math coprocessor
521 IRQ 14 Hard disk controller
522 IRQ 15 Reserved
523 !!MULTIPORT CONFIGURATION
524
525
526 Certain multiport serial boards which share multiple ports
527 on a single IRQ use one or more ports to indicate whether or
528 not there are any pending ports which need to be serviced.
529 If your multiport board supports these ports, you should
530 make use of them to avoid potential lockups if the interrupt
531 gets lost.
532
533
534 In order to set these ports specify __set_multiport__ as
535 a parameter, and follow it with the multiport parameters.
536 The multiport parameters take the form of specifying the
537 ''port'' that should be checked, a ''mask'' which
538 indicate which bits in the register are significant, and
539 finally, a ''match'' parameter which specifies what the
540 significant bits in that register must match when there is
541 no more pending work to be done.
542
543
544 Up to four such port/mask/match combinations may be
545 specified. The first such combinations should be specified
546 by setting the parameters __port1__, __mask1__, and
547 __match1__. The second such combination should be
548 specified with __port2__, __mask2__, and
549 __match2__, and so on. In order to disable this multiport
550 checking, set __port1__ to be zero.
551
552
553 In order to view the current multiport settings, specify the
554 parameter __get_multiport__ on the command
555 line.
556
557
558 Here are some multiport settings for some common serial
559 boards:
560
561
2 perry 562 AST !FourPort port1 0x1BF mask1 0xf match1 0xf
1 perry 563 Boca BB-1004/8 port1 0x107 mask1 0xff match1 0
564 Boca BB-2016 port1 0x107 mask1 0xff match1 0
565 port2 0x147 mask2 0xff match2 0
566 !!Hayes ESP Configuration
567
568
569 __Setserial__ may also be used to configure ports on a
570 Hayes ESP serial board.
571
572
573 The following parameters when configuring ESP
574 ports:
575
576
577 __rx_trigger__
578
579
580 This is the trigger level (in bytes) of the receive FIFO.
581 Larger values may result in fewer interrupts and hence
582 better performance; however, a value too high could result
583 in data loss. Valid values are 1 through 1023.
584
585
586 __tx_trigger__
587
588
589 This is the trigger level (in bytes) of the transmit FIFO.
590 Larger values may result in fewer interrupts and hence
591 better performance; however, a value too high could result
592 in degraded transmit performance. Valid values are 1 through
593 1023.
594
595
596 __flow_off__
597
598
599 This is the level (in bytes) at which the ESP port will
600
601
602 __flow_on__
603
604
605 This is the level (in bytes) at which the ESP port will
606
607
608 __rx_timeout__
609
610
611 This is the amount of time that the ESP port will wait after
612 receiving the final character before signaling an interrupt.
613 Valid values are 0 through 255. A value too high will
614 increase latency, and a value too low will cause unnecessary
615 interrupts.
616 !!CAUTION
617
618
619 CAUTION: Configuring a serial port to use an incorrect I/O
620 port can lock up your machine.
621 !!FILES
622
623
624 __/etc/serial.conf /etc/init.d/setserial__
625 !!SEE ALSO
626
627
628 tty(4), ttys(4),
629 kernel/chr_drv/serial.c
630 !!AUTHOR
631
632
633 The original version of setserial was written by Rick
634 Sladkey (jrs@world.std.com), and was modified by Michael K.
635 Johnson (johnsonm@stolaf.edu).
636
637
638 This version has since been rewritten from scratch by
639 Theodore Ts'o (tytso@mit.edu) on 1/1/93. Any bugs or
640 problems are solely his responsibility.
641
642
643 Debian related problems with this system should be sent to
644 Gordon Russell (gor@debian.org).
645 ----
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.