SETSERIAL(8) SETSERIAL(8) 名前 setserial - Linux シリアルポート情報の設定と取得 書式 setserial [ -abqvVWz ] device [ parameter1 [ arg ] ] ... setserial -g [ -abGv ] device1 ... 説明 setserial は、シリアルポートに関する設定情報を設定または表示するプログ ラムです。この情報には、指定されたシリアルポートが使用している I/O ポー ト ア ドレス や IRQ の情報、およびブレークキーを受信接続通知キー(Secure Attention Key)として使用するかどうかなどの情報が含まれます。 通常のブート処理中には、COM ポートの 1 〜 4 だけが、以下に示すデフォ ル トの I/O ポートアドレスと IRQ の値を使って初期化されます。 setserial は 、追加されたシリアルポートを初期化したり、1 〜 4 の COM ポートを標準 で な い設定にするために使用されます。 setserial は通常、 /etc/rc.local か ら起動される rc.serial スクリプトに登録しておきます。 引数 device には、設定したり表示したいシリアルポートのデバイスファイ ル を指定します。通常、以下のような形式で指定します: /dev/cua[0-3] パラメータが全く指定されなかった場合、 setserial は、ポートの種類 (例え ば、8250, 16450, 16550, 16550A など)、ハードウェアの I/O ポートアドレス 、IRQ 番号、ボーレート、操作可能なフラグのいくつかの内容を表示します。 -g オプションが指定されると、setserial への引数は全て、表示対象となるデ バイスとして解釈され、複数のデバイスの設定内容を表示させることができ ま す。 -g オプションを指定しないと、setserial への最初の引数が、設定したり表示 したりするデバイスとして解釈されます。また、その他の引数は、シリアル デ バイスに与えるパラメータとして解釈されます。 ほ とんどの場合、シリアルポートのパラメータの設定にはスーパーユーザーの 特権が必要です。しかし、少しだけ一般ユーザが設定できるパラメータがあ り ます。それらはこの man ページ中で説明します。 オプション setserial には、以下のオプションを指定することができます: -a シリアルデバイスの設定内容を表示するとき、すべての情報を表示しま す。 -b シリアルデバイスの設定内容を表示するとき、ブート時に /etc/rc ス クリプトで使用する時に適した形でデバイス情報のサマリを表示します 。 -G シリアルポートの設定情報を、setserial のコマンドラインオプション の形で表示します。 -q setserial の出力を抑制します。 -v 詳細モード。いくつかのステータスが追加出力されます。 -V setserial のバージョンを出力して終了します。 -W 割り込みの初期化を荒っぽく行い、終了します。このオプションはバー ジョン 2.1 以降の Linux カーネルに対しては無効です。 -z シリアルフラグをセットする前に全てのフラグをゼロクリアします。こ れは -G オプションを使ったシリアルフラグの自動保存と関係がありま す。 パラメータ シリアルポートに対して、以下のパラメータを設定することができます。 すべての値は、先頭に "0x" があれば 16 進数とみなされます。 port port_number port パラメータは、先に述べたように I/O ポート番号の設定を行ない ます。 irq irq_number irq パラメータは、先に述べたようにハードウェアの IRQ の設定を行 ないます。 uart uart_type このオプションは、シリアルポートの UART の種類を設定するために使 用 さ れ ま す 。 指定できるタイプは、 none, 8250, 16450, 16550, 16550A, 16650, 16650V2, 16654, 16750, 16850, 16950, 16954 です。 UART タイプ none は、ポートを使用できないようにします。 内蔵モデムの中には、「1k のバッファを持った 16550A」を備えている と書かれたものがあります。これは嘘です。実際には 16550A 互 換 の UART ではなく、(受信時のオーバーランを防ぐために) 1k の受信バッ ファのついた 16450 互換 UART が付いているのです。これらには 送信 FIFO が な い ので、この違いは重要です。そういう訳で、これらは 16550A UART と互換性がなく、自動設定処理では 16450 として認識 し ます。もし uart オプションを使ってこれを変更してしまうと、ファイ ル送信中にデータを取りこぼすことになるでしょう。これらの UART は 普 通他の問題も抱えています。大抵の場合 skip_test オプションも指 定しなくてはいけません。 autoconfig このパラメータが設定されると、 setserial はカーネルにシリアル ポ ー トを自動的に設定するよう要求します。 I/O ポートは、正しく設定 しなければいけません。その後カーネルは UART の種類を 決 定 し 、 auto_irq オプションが設定されていれば、IRQ を自動的に設定しよう とします。 autoconfig オプションは、 port、 auto_irq、 skip_test オプションの後に指定すべきです。 auto_irq 自動設定を行なう際、IRQ を自動決定しようとします。この機能は、い つも正しい結果をもたらすとは限りません。ハードウェアの設定によっ ては、Linux のカーネルはだまされてしまいます。一般に auto_irq の 機能を使うよりも、 irq パラメータを使って、使用される IRQ を明示 的に指定した方が信頼性があります。 ^auto_irq 自動設定の際、IRQ の自動決定を行ないません。 skip_test 自 動設定の際、UART のテストをスキップします。内蔵モデムの中には 、National Semiconductor 互換の UART を持っておらず、代わりに 安 い偽物を持っているものがあります。これらの偽物 UART では、カーネ ルが設定する前に指定されたアドレスに本当に UART があることを確認 するために使用する、ループバック検出モードを完全にはサポートして いません。このような内蔵モデムでは、このオプションを 指 定 し て Linux が正しく UART を初期化できるようにしなければなりません。 ^skip_test 自動設定の際、UART のテストをスキップしません。 baud_base baud_base 基本となるボーレートを設定します。ボーレートは、クロック周波数を 16 で割った値です。通常この値は 115,200 に設定されています。これ は UART がサポートできる最も速いボーレートです。 spd_hi アプリケーションが 38.4 Kbps を要求した場合に、57.6 Kbps を使用 します。このオプションは一般ユーザーでも指定できます。 spd_vhi アプリケーションが 38.4 Kbps を要求した場合に、115 Kbps を使用し ます。このオプションは一般ユーザーでも指定できます。 spd_shi アプリケーションが 38.4 Kbps を要求した場合に、230 Kbps を使用し ます。このオプションは一般ユーザーでも指定できます。 spd_warp アプリケーションが 38.4 Kbps を要求した場合に、460 Kbps を使用し ます。このオプションは一般ユーザーでも指定できます。 spd_cust ア プリケーションが 38.4 Kbps を要求した場合に、スピードを設定す るために特別な除数を使用します。この場合 の ボ ー レ ー ト は 、 baud_base を 除数で割った値になります。このオプションは一般ユー ザーでも指定できます。 spd_normal アプリケーションが 38.4 Kbps を要求した場合に、38.4 Kbps を使 用 します。このオプションは一般ユーザーでも指定できます。 divisor divisor 除数を設定します。この除数は、 spd_cust オプションが指定されてい て、アプリケーションがシリアルポートに 38.4 Kbps を設定した場 合 に使用されます。このオプションは一般ユーザーでも指定できます。 sak ブレークキーを受信接続通知キー(Secure Attention Key)に指定します 。 ^sak 受信接続通知キー(Secure Attention Key)を無効にします。 fourport ポートを AST Fourport カードとして設定します。 ^fourport AST Forport の設定を行ないません。 close_delay delay 発信デバイスがクローズされたあと、ブロックされた着信デバイ ス の DTR が再び立ち上がるまでの間、シリアルライン上の DTR を LOW に維 持しておく時間を指定します。この値の単位は、10ms です。デフォ ル トでは、この値は 50、 すなわち 500 ms (0.5 秒)です。 closing_wait delay シリアルポートを閉じようとするとき、ポートへデータを送信するため にカーネルが待つ時間を指定します。この値の単位は 10ms で す 。 "none" が指定されると、待ち時間は発生しません。 "infinite" が指 定されると、バッファリングされたデータが送信し終わるまで無限に待 ち続けます。デフォルト設定は 3000 (30 秒待つ) です。通常これは、 ほとんどのデバイスに対して適切な値です。もし長過ぎる待ち時間を設 定すると、未接続のシリアルポートに送信待ちのデータがある状態でク ローズされた場合にシリアルポートが長い間ハングアップしてしまうか もしれません。もし短すぎる待ち時間を設定すると、送信するべきデー タを送信しきれない可能性があります。もしデバイスがプロッタプリン タのように極めて低速な場合は、 closing_wait の値を大きくする必要 があるかもしれません。 session_lockout 複数のセッションで同一の発信ポート(/dev/cuaXX)を使用できないよう にします。つまり、あるプロセスが一旦ポートをオープンすると、その プロセスがポートをクローズするまで、別のセッション ID を持つプロ セスは、そのポートをオープンできなくなります。 ^session_lockout 複数のセッションで同一の発信ポート(/dev/cuaXX)を使用できるように します。 pgrp_lockout 複数のプロセスグループで同一の発信ポート(/dev/cuaXX)を使用できな いようにします。つまり、あるプロセスが一旦ポートをオープンすると 、そのプロセスがポートをクローズするまで、別のプロセスグループの プロセスはそのポートをオープンできなくなります。 ^pgrp_lockout 複数のプロセスグループで同一の発信ポート(/dev/cuaXX)を使用できる ようにします。 hup_notify 別のプロセスによる発信ラインの使用が終了した(ポートをクローズ し た か、シリアルラインがハングアップした)ことを、着信ラインをオー プンしようとしているプロセスに EAGAIN を返すことで通知します。 このパラメータは、例えばシリアルポートの着信ラインをブロックされ て いる getty 向けに用います。用いると、getty は再びそのポートを オープンしてブロックする前に、モデムをリセットできるようになりま す (そのモデムを発信デバイスとして使用したアプリケーションによっ て、ポートの設定が変更されたかもしれませんから)。 ^hup_notify 発信デバイスがハングアップしたことを、着信回線をオープンしようと しているプロセスに通知しません。 split_termios 発 信デバイスによって使用される termios の設定と、着信デバイスに よって使用される termios の設定とを別々に扱います。 ^split_termios 発信ポートと着信ポートの両方で同じ termios 構造体を使用します 。 これはデフォルトの設定です。 callout_nohup 指定されたシリアルポートが発信デバイスとしてオープンされた場合、 キャリア検出(CD)信号が落ちても tty をハングアップしません。 ^callout_nohup シリアルポートが発信デバイスとしてオープンされているとき 、 tty をハングアップする処理をスキップしません。もちろん、ハングアップ をさせるには termios の HUPCL フラグが有効になっていなければなり ません。 low_latency シ リアルデバイスの受信遅延を最小にします。ただし CPU の利用度は 増加します (通常はオーバーヘッドを最小限にするために、受信キャラ ク タを扱う前に 5-10ms の遅延があります)。これはデフォルトではオ フですが、リアルタイム処理をするアプリケーションの中にはこのオプ ションが有効なものがあるかもしれません。 ^low_latency CPU がシリアルキャラクタを処理する効率を最適化します。ただしキャ ラクタを処理する前に 5-10ms の遅延が発生します。これがデフォルト です。 シリアルポートの設定上の注意事項 注意して欲しいのですが、 setserial が行うのは、指定されたシリアルポート の I/O ポートと IRQ とがどこそこで見つかるはずだ、という情報を Linux カ ーネルに教えることだけなのです。 setserial は、実際のシリアルボードが指 定された 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 は 2 つあるい はそれ以上のシリアルポートで共有することはできません。これを行なうと 、 両 方を同時に使おうとした時に一方あるいは両方のシリアルポートが不安定に なるでしょう。この制約は単一の IRQ を複数のシリアルポートで共有できるよ う に設計された特殊なマルチポートシリアルカードを使うことで克服すること ができます。Linux でサポートされているマルチポートシリアルカードには 、 AST Fourport, Accent Async board, Usenet Serial II board, Bocaboard BB-1004, BB-1008, BB-2016 boards, HUB-6 serial board があります。 別の IRQ を用いるのも困難です (それらは大抵使用されていますから)。以 下 の 表 は、標準的な "MS-DOS" で割り付けられている使用可能な IRQ の一覧で す: IRQ 3: COM2 IRQ 4: COM1 IRQ 5: LPT2 IRQ 7: LPT1 コンピュータにパラレルポートが一つしかなければ、 IRQ 5 が良い選択である ことにほとんどの人が気づくと思います。その他の選択としては IRQ 2 (別名: IRQ 9) があります。ただしこの IRQ はネットワークカードで使われること が あ ります。また非常に稀ですが、VGA カードが垂直同期信号割り込みのために IRQ 2 を使うように設定されていることがあります。自分の VGA カードがこの よ うに設定されている場合は、それを使用しないようにして見てください。そ うすれば、その IRQ を他のカードが使えるようになります。 Linux やその 他 のほとんどの OS では、 IRQ 2 を垂直同期信号割り込みのために使用する必要 はありません。 他に使用できる IRQ が、3, 4, 7 だけですが、これらもおそらく他のシリアル ポ ートやパラレルポートで使用されているでしょう。 (もしお使いのシリアル カードに 16 bit カードエッジコネクタが付いていて、より上位の割り込み 番 号をサポートしているなら、 IRQ 10, 11, 12, 15 も使用できるでしょう。) AT 互換機では、IRQ 2 は IRQ 9 のように見えます。Linux でも、この流儀に したがって解釈します。 2 (9), 3, 4, 5, 7, 10, 11, 12, 15 以外の IRQ は他のハードウェアに割り付 け られており、普通変更できないので、使うべきではありません。「標準的な 」割り付けは、次のようになっています。 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 マルチポート設定 複数のポートで一つの IRQ を共有するようなタイプのマルチポートシリアルボ ー ドには、作業が必要な待ち状態のポートがあるかどうかを示すために、ひと つまたは複数のポートを使うものがあります。使っているマルチポートボー ド が このようなポートをサポートしているなら、これらのポートを使えば、割り 込みがロスト時でもシステムが固まらないようにできます。 これらのポートを設定するためには、 set_multiport パラメータを指定し、そ の 後ろにマルチポートパラメータを指定します。マルチポートパラメータは、 チェックするべき port、レジスタのどのビットが有効かを指定する mask、 す る べき作業がなくなった時にレジスタの有効ビットが一致しなければならない 値を指定する match からなります。 このような port/mask/match の組は 4 つまで指定できます。一つ目 の 組 は port1, mask1, match1 で指定し、二つ目は port2, mask2, match2 で指定しま す。以下同様です。マルチポートのチェックを無効にするためには、 port1 に 0 を指定してください。 現 在のマルチポート設定を見るためには、コマンドラインから get_multiport パラメータを指定してください。 以下にいくつかの一般的なシリアルボードのためのマルチポート設定を示し ま す。 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 設定 setserial は Hayes ESP シリアルボードのポートを設定することもできます。 ESP ポートを設定するには以下のパラメータを使います。 rx_trigger 受信 FIFO のトリガレベル (バイト単位) です。大きい値を設定すると 割り込み回数が減り、性能が向上します。しかし、値を大きくしすぎる とデータを失うことになるかもしれません。有効な値は 1 か ら 1023 です。 tx_trigger 送信 FIFO のトリガレベル (バイト単位) です。大きい値を設定すると 割り込み回数が減り、性能が向上します。しかし、値を大きくしすぎる と 送 信 効率を落とすことになるかもしれません。有効な値は 1 から 1023 です。 flow_off ESP ポートが相手の送信側に対して「フローオフ」を伝える (これ以上 デ ータを送信しないように伝える)レベル(バイト単位)です。有効な値 は 1 から 1023 です。この値は受信トリガレベルとフローオンレベ ル より大きい値にするべきです。 flow_on ESP ポートが相手の送信側に対してフローオフを伝えた後に、「フロー オン」を伝える (これ以上データ送信を再開するように伝える)レベル( バイト単位)です。有効な値は 1 から 1023 です。この値はフローオフ レベルより小さく、受信トリガレベルより大きい値にするべきです。 rx_timeout 最後のキャラクタを受信してから、割り込みを発生させるまで に ESP ポートが待つ時間です。有効な値は 0 から 255 です。値が大きすぎる と遅延が大きくなり、値が小さすぎると不必要な割り込みが発生するこ とになります。 警告 警告: シリアルポートが使用する I/O ポートの設定を間違えると、マシンがハ ングアップしてしまうかもしれません。 ファイル /etc/rc.local /etc/rc.serial SEE ALSO tty(4), ttys(4), kernel/chr_drv/serial.c 著者 setserial のオリジナルバージョンは Rick Sladkey (jrs@world.std.com) に よ って書かれ、 Michael K. Johnson (johnsonm@stolaf.edu) によって変更さ れました。 このバージョンは、1993 年 1 月 1 日 に Theodore Ts’o (tytso@mit.edu) に よ って最初から書き直されたものです。バグおよび問題点は、彼のみの責任で す。 Setserial 2.17 January 2000 SETSERIAL(8)
SETSERIAL(8) SETSERIAL(8) 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 usu- ally 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 follow- ing 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 configu- ration 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 argu- ments. -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 dis- able 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 com- patible UART with a 1k receive buffer to prevent receiver over- runs. 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 parame- ter, you will see dropped characters during file transmissions. These UART’s usually have other problems: the skip_test parame- ter 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 fea- ture 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 fre- quency 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 pro- cess 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 modi- fied by the application using the callout device) before block- ing 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 dis- cpline to minimize overhead.) This is off by default, but cer- tain 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 particu- lar 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 prob- ably 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 sup- ports these ports, you should make use of them to avoid potential lock- ups 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 reg- ister 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 speci- fied 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 perfor- mance; 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 AUTHOR The original version of setserial was written by Rick Sladkey (jrs@world.std.com), and was modified by Michael K. Johnson (john- sonm@stolaf.edu). This version has since been rewritten from scratch by Theodore Ts’o (tytso@mit.edu) on 1/1/93. Any bugs or problems are solely his respon- sibility. Setserial 2.17 January 2000 SETSERIAL(8)
コロナウイルスの日ごとの感染者数・死者数をグラフ化してみました。どの国が増加傾向にあり、どの国が終息に向かっているかを視覚化しています。
Copyright(C) linux-cmd.com All Rights Reserved. Author Takayuki Yukawa