NAME
setserial - 取得/设置 Linux 串行口的信息
总览
setserial [ -abqvVWZ] 设备 [ 命令参数一 [ 设备变元参数 ] ] ... setserial -g [-abGv ] 设备一 ...
描述
setserial 是一个用来设置和取得与一个串行口有关的信息与设置的程序。这些信息包括某个串行口正在使用的I/o地址与中断号,以及break键是否被当做引起安全注意的键,等等。
在通常的引导的过程中,只有端口 COM1至COM4被初始化,并使用默认的 I/O地址和中断号,正如以下所列。为了初始化其它的串行口,或者是把 COM1至COM4中的设置改为一个非标准的设置。就必须使用 setserial 程序。一般这个程序会在 rc.serial 脚本中使用,此脚本通常会在 /etc/rc.local.
中被执行
设备
由变元参数定义的需要设置的串行设备。它们通常具有以下形式: /dev/cua[0-3].
如果没有设定命令参数, setserial
将打印出此端口的类型(如,8250,16450 ,14330,16550A,等等),
硬件I/O地址,各硬件中也断号,波特数,和一些可操作或更改的标识。
如果选择 -g 选项,命令将列出所给出的设备参数的一些基本信息。
如果没有指定参数 命令所指定的第一个设备变元将被当作修改或者是显示内容的目标设备,而其它的设备变元参数将被当作命令参数赋于目标设备。
对于大多数情况,需要有系统管理员的权限才能设置串行口。当然有一些串行口的参数,也可由普通用户设置,这些参数在本手册中会有另有说明。
选项
Setserial 可接受下列参数:
- -a
- 当输出串行口设备的设置时,显示出所有有效信息.
- -b
- 当输出串行口设备的设置时,输出主要的设备设置信息,此项适合于在引导过程时,在/etc/rc 脚本中输出设备信息.
- -G
- 以特定形式输出串行口的设置信息,此形式可以设置信息以命令行参数的形式返馈回串行口设备.
- -q
- 静默.
- SetSerial
- 命令将以更简洁的形式输出.
- -V
- 输出详细信息. Setserial 可以输出附加的状态的信息.
- -V
- 显示版本信息然后退出.
- -W
- 强制初始化中,断然后退出.些选项在核心版本2.1后的Linux中不在提供. -z 在开始设置标记前清除原有的设置的串行标记.此项与使用-G 标记自动保存串行口的设置标记有关.
命令参数
以下命令参数可以赋于一个串行口.
所有的参数值都被假定为一个八进制数,除非值前标有"0x".
- port 端口号
- port 此选项设置I/O地址如上.
- irq中断号
- irq 此选项设置硬件的中断号IRQ如上.
- uart异步通讯(UART)类型
此选项用来设置异步通讯(UART)的类型.允许的类型有 none, 8250,16450, 16550,16550A,16550,16650V2,and 16750. 并且8250 类型 和 16450 没有FIFO's ,起初的16550 有一些错误致使FIFO's不可用,FIFO 只可用来16550A类型的异步通讯机。设置异步通讯(UART)类型为 8250,16450,或16550 将启用不使用 FIFO的串行口.使用异步通讯类型为 none 将禁用端口.一些内猫标注着"16650A UART带有1K缓冲",这是骗人的.它们没有真正兼容 16550A的UART;相反的它们只有 一个16450兼容的带1K接收缓冲 UART,以防止接 收时溢出.这是非常重要的,因为它们没有一个没有一个可传导的FIFO.因此,他们与16650A UART 并不兼容,自动配置过程将正确的识别它们为16450 类型。如果你想强行使用,需要 uart 参数,这样你在传输文件时会发现有字符遗失.这些 UART 通常还有其它一些问题. skip test 参数也经常被使用. autoconfig 当使用这个参数时, Setserial 将向核心请求自动设置串行口.I/O地址一要正确设置;核心将会试图检测UART类型,如果 auto_irq 参数选用,Linux将试图自动分配中断号IRQ. autoconfig 参数应在 port,auto_irq,and skip_test 等参数使用后也被指定.
- auto_irq
- 在自动配置的过程中,会自动分配中断号IRQ. 此功能不能保证一定有一个正确的结果;一些硬件的配置可能会迷惑Linux的核心.一般来说不使用参数 auto_irq
的功能更安全一些,宁可明确地定IRQ中断号. irq
参数指定中断号. - ^auto_irq
- 在自动配置的过程中.并 不 试图分配中断号IRQ.
- skip_test
- 在自动配置的过程中,忽略UART检测.一些内猫没有国际半导体公司兼容的UART设备类型,只有一些便宜的仿制品.有一些甚至不完全支持 loopback检测模式,此模式是核心在试图配置之前用来确定在特定的地址上是不真有UART设备.因此对于某些内猫你可能需要指定这个参数以便Linux能正确的初始化UART.
- ^skip_tet
- 在自动配置过程中, 不 忽略UART的检测.
- baud_base波特基率
- 此选项设端口的波特率,此值为时钟频率除以16. 一般情况此项值为 115200, 这也是UART能支持的最快波特率.
- spd_hi
- 当程序要求 38.4kb时,使用57.6kb的连接速度. 这个参数可以用由无特权的用户指定.
- spd_vhi
- 当要求38.4kb时,使用115kb的连接速度. spd_cust 当要求38.4kb时,使用指定的divisor(除数)来计算速度.这时波特率由 baud_base(波特基率)
除以 divisor(除数) 得到 - spd_normal
- 当要求38.4kb 时使用38.4kb的速度. 此参数可以由无特权的用户指定.
- divisordivisor(除数)
- 此选项指定了自定义的除数.这个除数将被用在 spd_cust 选项中被指定时,当要求38.4kb的速度时,用来自行设置串行口连接速度此参数可由无特权的普通用户设定.
- sak
- 设置break键为引发安全注意键.
- ^sak
- 禁用引发安全注意键.
- fourport
- 配置端口为一AST Fouroart 卡.
- ^fourport
- 禁用 AST Fourport 配置.
- closedelaydelay(延时)
- 指定时间长度,单位是百分之一秒,DTR在联出设备被关闭后,仍会保持一个低速串行通路,在有数据进来之前会重新起动DTR.这选项的默认值为50,即半秒延时.
- close_delaydelay(延时)
- 指定时间长度,单位是百分之一秒,在接受端被禁之前关闭端口时,核心需要等待从串行口传来的数据. 如果指定为"none",将不会有延时.如果指定"infinite" 时,核心将会以不确定的时间等待缓冲数据的传输.此选项的默认值为是 "none" .
- closing_wait2delay(延时)
- 指定时间的长度,单位是百分之一秒,在接受端被禁用后,在关闭端口时核心会等待从串行口传来的数据.而用 closing_wait 命令,"none" 和 "infinite" 两参数都将被指定,此项的默认值是 3000,也就是30 秒延时。 closing_wait 和 closing_wait2的默认值对大多数的设备都会适用。如果选择的延时太长,当串行口断开后,它会挂起太长时间,致使数据挂起而被消除。如果设太短,将会有可能致使一些传输的数据溢出。
如果设备非常慢,像一个绘图仪,那么,两项值可能要增大一些。
如果设备使用 XON/XOFF 信号交换,那么默认值将会反过来。然而这可能会致使在linux 与回波猫之间有一个"回波冲突"。
- session_lockout
- 对不同的任务,锁定联出设备的端口(/dev/cuaXX),也就是说,一但有一个进程打开端口,就不允许其它不同号的任务打开此端口,直到前一个进程放开此端口。
- ^session_lockout
- 对联出的端口不开启上述功能。
- pgrp_lockout
- 对不同进程组,锁定联出的端口(/dev/cuaXX)。也就是说,一但一个进程打开一个端口,不允其它进程组的进程共享此端口,直到前一个进程释放它。
此参数的一个应用就是在当一个登陆端被一个拨号的串行口锁定。它将允许登陆端重置调制解调器(使用指定设备的程序可能会修改它的设置) 在锁定被打开之前。
- ^hup_notify
- 当进程锁定在打一个拨号时,而此时联邮设备正挂起的话,不通知进程。
- split_termios
- 对于联出设备的终端设置与联入设备的终端设置分开对待。
- ^split)termios
对以上两者相同对待.此值为默认选项。- callout_nohup
如果这个特殊串行口被当成一个联出设备打开,那么当载波检测消失时,不挂起通讯端口。- ^callout_nohup
- 当串行口当作联出设备打开时,不忽略挂起通讯端口。当然,如果挂起的话HUPCL终端标识将会被启用。
- ^low_latency
以更高的CPU占用率来使得接受滞延达到最小。(通常传输中的5-10ms的滞延以使系统开销最小.) 此项默认值为关闭,但某些实时程序可能会用到此参数。
CONISIDERATIONS OF CONFIGURING SERIAL PORTS
明白setserial 命令只是告诉linux核心它想找到某个特定的端口的 I/O地址各中断号IRQ是很重要的。它并不操作硬件,串行设备实际使用的一个特定的I/O地址。为了达到更改实际的硬件参数,你需要手动设置硬件,通常是设置跳线,或更改DIP开关。
以下一节将针对设置你的串行端口给于一些帮助。
以下是"标准MS-dos"的端口设置:
- /dev/ttys0(COM1), port 0x3f8, irq 4 /dev/ttys1(COM2), port 0x2f8, irq 3 /dev/ttys2(COM3), port 0x3e8, irq 4 /dev/ttys3(COM4), port 0x2e8, irq 3
根据AT/ISA总线结构的限定,通常中断号IRQ不能被两个以上的串行口共享。如果你试图这这样做,那么当你同时启用两个端口时,它们中的一个或全部将会不可靠。这和限制可由一多端口的串行口板来克服,它用来让多个串行口共享一个中断号IRQ。此种板对linux的支持已加入到AST FourPort, Accent Async 板,Usenet Serial II 板,Bocabord BB-1004, BB-1008,和 BB-2016 板,以及HUB-6 serial 板之中。
修改一个设备的中断号IRQ是比较困难的,因为大多数中断号已经被使用了,以下是"标准MS-DOS"设定的有效的中断号列表:
- IRQ 3: COM2 IRQ 4: COM1 IRQ 5: LPT2 IRQ 7: LPT1
许多人都发现中断号IRQ 5 是一个好的选择,假设电脑中只有一个并行口是正在使用的。那么中断号IRQ 2 也是一个好的选择(也可能是9); 虽然这个中断号IRQ有时也被网卡使用,也有极个别的的显卡可能要使用中断号IRQ 2作为一个垂直回扫的中断。如果你的显卡是这样设置的;那你可能要禁用此项功能,以便能给其它的设备释放一个中断。当然这对于linux或是其它操作系统不一定是必须的。
另外其它可用的中断号有 3 ,4,和 7,这些中断可能也被另一些串行或是并行口所用。(如果你的串行卡有一个16位的电子数据收集器的接线口,并且支持更高的中断号,那么中断号IRQ 10 ,11, 12,和 15 也是可用的。)
在一些AT类的机器上,中断号IRQ 2 被当作中断号IRQ 9,所以linux 会如此认为。
其它中断号除了2(9),3, 4, 5, 7, 10, 11, 12 和15 不 能被使用,因为他们被安排给了其它的硬件,而且一般上不能更改。以下是一些“标准”的设置:
- IRQ 0 时钟发生器 0 IRQ 1 键盘 IRQ 2 可编程的中断控制器 2 IRQ 3 串行口 2 IRQ 4 串行口 1 IRQ 5 并行口 2(保留给PS/2) IRQ 6 软盘驱动器 IRQ 7 并行口 1 IRQ 8 系统实时名钟 IRQ 9 重定向给中断号IRQ 2 IRQ 10 保留 IRQ 11 保留 IRQ 12 保留(ps/2兼容的设备) IRQ 13 数学协处理器 IRQ 14 硬盘控制器 IRQ 15 保留
MULTIPORT CONFIGURATION
一些多端口的串行板可以让多的端中共享一个中断号,使用一个或是多个端口以显示是否有端口需要服务。如果你的多端口吕行板支持这些端口,你须保证如果中断丢失时,能避免潜在的死锁。
为了详细设置这些端口,使用 set_multiport 为参数,紧接其后的是多端口的参数。这个多端中的参数须指定为以下形式 port 这需要检测一下,参数 mask 可以显示在已注册的位中那个是重要的,最后参数 math 用来指定在已注册的位中,当没有进一步工作要做时,那一位必须匹配。
当有四个这种 /port/mask/match时,就要指定联合。第一个这种联合应该使用如下参数 port1, mask1, 和 match1. 第二个这种联合需要用如下参数指定 port2, mask2, 和 match2, 等等。为了禁用这个多端口检测,设置 port1 为零。
如果想查看当前多端口的设置,指定命令行参数 get_multiport
以下是一些通常的串行板的设置:
- AST FourPort port1 0x1BF match1 0xf mask1 0xf Boca BB-1004/8 port1 0x107 match1 0xff match1 0 Boca BB-2016 port1 0x107 match1 0xff match1 0 port2 0x147 match2 0xff match2 0
Hayes ESP 的设置
Setserial 也可以用来在贺氏的ESP串行板上设置端口。
以下参数在设置时使用:
- rx_trigger
- 这是一个接收的FIFO的触发水平(以字节为单位),较大的值可减少中断时间提高性能;然而值太大会引起数据丢失。有效值在1 到 1023 之间.
- tx_trigger
- 这是一个传送的FIFO的触发水平(安节为单位),较在的值可减少中断时间提高性能,但值太大会引起传输效率下降。有效值在1 到 1023之间.
- flow_off
- 这是通知ESP端口断开远端的传输(如,告诉它停止发送数据).有效值在1 到 1023之间,这个值要比接收的触发等级和联接的水平值高.
- flow_on
- 这是ESP端口通知联接的等级(单位字节),(如,通知重新开始发送数据)在挂断之后,有效值在1 到 1023之间.这个值应在断开(flow off)等级值之下但要比接收的触发等级高.
- rx_timeout
- 这是ESP端口在接收完最后一个字符,且在中断信号之前将要等待的时间。有效值是0到255.值太大会增加延时,太小会引起不必要的中断。
警告
警告:设置一个串行端口时使用一个不正确的I/O地址可能会造成死机.
文件
/etc/rc.local /etc/rc.serial
另见,
tty(4), ttys(4), kernel/chr_drv/serial.c
#p#
NAME
setserial - get/set Linux serial port information
SYNOPSIS
setserial [ -abqvVWz ] device [ parameter1 [ arg ] ] ...
setserial -g [ -abGv ] device1 ...
DESCRIPTION
setserial is a program designed to set and/or report the configuration information associated with a serial port. This information includes what I/O port and IRQ a particular serial port is using, and whether or not the break key should be interpreted as the Secure Attention Key, and so on.
During the normal bootup process, only COM ports 1-4 are initialized, using the default I/O ports and IRQ values, as listed below. In order to initialize any additional serial ports, or to change the COM 1-4 ports to a nonstadard configuration, the setserial program should be used. Typically it is called from an rc.serial script, which is usually run out of /etc/rc.local.
The device argument or arguments specifies the serial device which should be configured or interrogated. It will usually have the following form: /dev/cua[0-3].
If no parameters are specified, setserial will print out the port type (i.e., 8250, 16450, 16550, 16550A, etc.), the hardware I/O port, the hardware IRQ line, its "baud base," and some of its operational flags.
If the -g option is given, the arguments to setserial are interpreted as a list of devices for which the characteristics of those devices should be printed.
Without the -g option, the first argument to setserial is interpreted as the device to be modified or characteristics to be printed, and any additional arguments are interpreted as parameters which should be assigned to that serial device.
For the most part, superuser privilege is required to set the configuration parameters of a serial port. A few serial port parameters can be set by normal users, however, and these will be noted as exceptions in this manual page.
OPTIONS
Setserial accepts the following options:
- -a
- When reporting the configuration of a serial device, print all available information.
- -b
- When reporting the configuration of a serial device, print a summary of the device's configuration, which might be suitable for printing during the bootup process, during the /etc/rc script.
- -G
- Print out the configuration information of the serial port in a form which can be fed back to setserial as command-line arguments.
- -q
- Be quiet. Setserial will print fewer lines of output.
- -v
- Be verbose. Setserial will print additional status output.
- -V
- Display version and exit.
- -W
- Do wild interrupt initialization and exit. This option is no longer relevant in Linux kernels after version 2.1.
- -z
- Zero out the serial flags before starting to set flags. This is related to the automatic saving of serial flags using the -G flag.
PARAMETERS
The following parameters can be assigned to a serial port.
All argument values are assumed to be in decimal unless preceeded by "0x".
- port port_number
- The port option sets the I/O port, as described above.
- irq irq_number
- The irq option sets the hardware IRQ, as described above.
- uart uart_type
- This option is used to set the UART type. The permitted types are none, 8250, 16450, 16550, 16550A, 16650, 16650V2, 16654, 16750, 16850, 16950, and 16954. Using UART type none will disable the port.
Some internal modems are billed as having a "16550A UART with a 1k buffer". This is a lie. They do not have really have a 16550A compatible UART; instead what they have is a 16450 compatible UART with a 1k receive buffer to prevent receiver overruns. This is important, because they do not have a transmit FIFO. Hence, they are not compatible with a 16550A UART, and the autoconfiguration process will correctly identify them as 16450's. If you attempt to override this using the uart parameter, you will see dropped characters during file transmissions. These UART's usually have other problems: the skip_test parameter also often must be specified.
- autoconfig
- When this parameter is given, setserial will ask the kernel to attempt to automatically configure the serial port. The I/O port must be correctly set; the kernel will attempt to determine the UART type, and if the auto_irq parameter is set, Linux will attempt to automatically determine the IRQ. The autoconfig parameter should be given after the port,auto_irq, and skip_test parameters have been specified.
- auto_irq
- During autoconfiguration, try to determine the IRQ. This feature is not guaranteed to always produce the correct result; some hardware configurations will fool the Linux kernel. It is generally safer not to use the auto_irq feature, but rather to specify the IRQ to be used explicitly, using the irq parameter.
- ^auto_irq
- During autoconfiguration, do not try to determine the IRQ.
- skip_test
- During autoconfiguration, skip the UART test. Some internal modems do not have National Semiconductor compatible UART's, but have cheap imitations instead. Some of these cheasy imitations UART's do not fully support the loopback detection mode, which is used by the kernel to make sure there really is a UART at a particular address before attempting to configure it. So for certain internal modems you will need to specify this parameter so Linux can initialize the UART correctly.
- ^skip_test
- During autoconfiguration, do not skip the UART test.
- baud_base baud_base
- This option sets the base baud rate, which is the clock frequency divided by 16. Normally this value is 115200, which is also the fastest baud rate which the UART can support.
- spd_hi
- Use 57.6kb when the application requests 38.4kb. This parameter may be specified by a non-privileged user.
- spd_vhi
- Use 115kb when the application requests 38.4kb. This parameter may be specified by a non-privileged user.
- spd_shi
- Use 230kb when the application requests 38.4kb. This parameter may be specified by a non-privileged user.
- spd_warp
- Use 460kb when the application requests 38.4kb. This parameter may be specified by a non-privileged user.
- spd_cust
- Use the custom divisor to set the speed when the application requests 38.4kb. In this case, the baud rate is the baud_base divided by the divisor. This parameter may be specified by a non-privileged user.
- spd_normal
- Use 38.4kb when the application requests 38.4kb. This parameter may be specified by a non-privileged user.
- divisor divisor
- This option sets the custom divison. This divisor will be used then the spd_cust option is selected and the serial port is set to 38.4kb by the application. This parameter may be specified by a non-privileged user.
- sak
- Set the break key at the Secure Attention Key.
- ^sak
- disable the Secure Attention Key.
- fourport
- Configure the port as an AST Fourport card.
- ^fourport
- Disable AST Fourport configuration.
- close_delay delay
- Specify the amount of time, in hundredths of a second, that DTR should remain low on a serial line after the callout device is closed, before the blocked dialin device raises DTR again. The default value of this option is 50, or a half-second delay.
- closing_wait delay
- Specify the amount of time, in hundredths of a second, that the kernel should wait for data to be transmitted from the serial port while closing the port. If "none" is specified, no delay will occur. If "infinite" is specified the kernel will wait indefinitely for the buffered data to be transmitted. The default setting is 3000 or 30 seconds of delay. This default is generally appropriate for most devices. If too long a delay is selected, then the serial port may hang for a long time if when a serial port which is not connected, and has data pending, is closed. If too short a delay is selected, then there is a risk that some of the transmitted data is output at all. If the device is extremely slow, like a plotter, the closing_wait may need to be larger.
- session_lockout
- Lock out callout port (/dev/cuaXX) accesses across different sessions. That is, once a process has opened a port, do not allow a process with a different session ID to open that port until the first process has closed it.
- ^session_lockout
- Do not lock out callout port accesses across different sessions.
- pgrp_lockout
- Lock out callout port (/dev/cuaXX) accesses across different process groups. That is, once a process has opened a port, do not allow a process in a different process group to open that port until the first process has closed it.
- ^pgrp_lockout
- Do not lock out callout port accesses across different process groups.
- hup_notify
- Notify a process blocked on opening a dial in line when a process has finished using a callout line (either by closing it or by the serial line being hung up) by returning EAGAIN to the open.
The application of this parameter is for getty's which are blocked on a serial port's dial in line. This allows the getty to reset the modem (which may have had its configuration modified by the application using the callout device) before blocking on the open again.
- ^hup_notify
- Do not notify a process blocked on opening a dial in line when the callout device is hung up.
- split_termios
- Treat the termios settings used by the callout device and the termios settings used by the dialin devices as separate.
- ^split_termios
- Use the same termios structure to store both the dialin and callout ports. This is the default option.
- callout_nohup
- If this particular serial port is opened as a callout device, do not hangup the tty when carrier detect is dropped.
- ^callout_nohup
- Do not skip hanging up the tty when a serial port is opened as a callout device. Of course, the HUPCL termios flag must be enabled if the hangup is to occur.
- low_latency
- Minimize the receive latency of the serial device at the cost of greater CPU utilization. (Normally there is an average of 5-10ms latency before characters are handed off to the line discpline to minimize overhead.) This is off by default, but certain real-time applications may find this useful.
- ^low_latency
- Optimize for efficient CPU processing of serial characters at the cost of paying an average of 5-10ms of latency before the characters are processed. This is the default.
CONSIDERATIONS OF CONFIGURING SERIAL PORTS
It is important to note that setserial merely tells the Linux kernel where it should expect to find the I/O port and IRQ lines of a particular serial port. It does *not* configure the hardware, the actual serial board, to use a particular I/O port. In order to do that, you will need to physically program the serial board, usually by setting some jumpers or by switching some DIP switches.
This section will provide some pointers in helping you decide how you would like to configure your serial ports.
The "standard MS-DOS" port associations are given below:
- /dev/ttys0 (COM1), port 0x3f8, irq 4 /dev/ttys1 (COM2), port 0x2f8, irq 3 /dev/ttys2 (COM3), port 0x3e8, irq 4 /dev/ttys3 (COM4), port 0x2e8, irq 3
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.
The selection of an alternative IRQ line is difficult, since most of them are already used. The following table lists the "standard MS-DOS" assignments of available IRQ lines:
- IRQ 3: COM2 IRQ 4: COM1 IRQ 5: LPT2 IRQ 7: LPT1
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.
The only other available IRQ lines are 3, 4, and 7, and these are probably used by the other serial and parallel ports. (If your serial card has a 16bit card edge connector, and supports higher interrupt numbers, then IRQ 10, 11, 12, and 15 are also available.)
On AT class machines, IRQ 2 is seen as IRQ 9, and Linux will interpret it in this manner.
IRQ's other than 2 (9), 3, 4, 5, 7, 10, 11, 12, and 15, should not be used, since they are assigned to other hardware and cannot, in general, be changed. Here are the "standard" assignments:
- IRQ 0 Timer channel 0 IRQ 1 Keyboard IRQ 2 Cascade for controller 2 IRQ 3 Serial port 2 IRQ 4 Serial port 1 IRQ 5 Parallel port 2 (Reserved in PS/2) IRQ 6 Floppy diskette IRQ 7 Parallel port 1 IRQ 8 Real-time clock IRQ 9 Redirected to IRQ2 IRQ 10 Reserved IRQ 11 Reserved IRQ 12 Reserved (Auxillary device in PS/2) IRQ 13 Math coprocessor IRQ 14 Hard disk controller IRQ 15 Reserved
MULTIPORT CONFIGURATION
Certain multiport serial boards which share multiple ports on a single IRQ use one or more ports to indicate whether or not there are any pending ports which need to be serviced. If your multiport board supports these ports, you should make use of them to avoid potential lockups if the interrupt gets lost.
In order to set these ports specify set_multiport as a parameter, and follow it with the multiport parameters. The multiport parameters take the form of specifying the port that should be checked, a mask which indicate which bits in the register are significant, and finally, a match parameter which specifies what the significant bits in that register must match when there is no more pending work to be done.
Up to four such port/mask/match combinations may be specified. The first such combinations should be specified by setting the parameters port1, mask1, and match1. The second such combination should be specified with port2, mask2, and match2, and so on. In order to disable this multiport checking, set port1 to be zero.
In order to view the current multiport settings, specify the parameter get_multiport on the command line.
Here are some multiport settings for some common serial boards:
- AST FourPort port1 0x1BF mask1 0xf match1 0xf Boca BB-1004/8 port1 0x107 mask1 0xff match1 0 Boca BB-2016 port1 0x107 mask1 0xff match1 0 port2 0x147 mask2 0xff match2 0
Hayes ESP Configuration
Setserial may also be used to configure ports on a Hayes ESP serial board.
The following parameters when configuring ESP ports:
- rx_trigger
- This is the trigger level (in bytes) of the receive FIFO. Larger values may result in fewer interrupts and hence better performance; however, a value too high could result in data loss. Valid values are 1 through 1023.
- tx_trigger
- This is the trigger level (in bytes) of the transmit FIFO. Larger values may result in fewer interrupts and hence better performance; however, a value too high could result in degraded transmit performance. Valid values are 1 through 1023.
- flow_off
- This is the level (in bytes) at which the ESP port will "flow off" the remote transmitter (i.e. tell him to stop stop sending more bytes). Valid values are 1 through 1023. This value should be greater than the receive trigger level and the flow on level.
- flow_on
- This is the level (in bytes) at which the ESP port will "flow on" the remote transmitter (i.e. tell him to resume sending bytes) after having flowed it off. Valid values are 1 through 1023. This value should be less than the flow off level, but greater than the receive trigger level.
- rx_timeout
- This is the amount of time that the ESP port will wait after receiving the final character before signaling an interrupt. Valid values are 0 through 255. A value too high will increase latency, and a value too low will cause unnecessary interrupts.
CAUTION
CAUTION: Configuring a serial port to use an incorrect I/O port can lock up your machine.
FILES
/etc/rc.local /etc/rc.serial
SEE ALSO
tty(4), ttys(4), kernel/chr_drv/serial.c