<!doctype linuxdoctr system>
<article>
<title> The Linux Plug-and-Play-HOWTO </title>
<author>David S.Lawyer
  <tt>&lt;dave@lafn.org&gt;</tt>
<date> v0.11, May 2000 
<trans>Linux Japanese FAQ Project
  <tt>&lt;JF@linux.or.jp&gt;</tt>
<tdate>v0.11j, May 08, 2000

<!--
Change log:
v0.11 scanport utility, many typos fixed.
v0.10 2 March 2000 typo: /bus/pnp/devices, lspci+, book "Programming
..."
v0.09 /proc/bus/pci/devices too cryptic,
v0.08 my new email
v0.07 in Windows: remove devices
v0.06 Oct. 1999 in Windows: forced+, legacy into ESCD, pause key (bios)
v0.05 Aug. 1999 lspci, url for isapnp, tell the dev. driver, PCI still
    needs PnP
v0.04 June 1999 alternatives to reinstall Windows?, add D.H. url
v0.03 May 1999 typos, reinstall Windows, clarity, removed D.H. url
v0.02 Apr. 1999 /proc/... doesn't show hdw config (except pci)
v0.01 Mar. 1999 serial PnP spec, PCI interrupts, no DMA on PCI,
dumpregs for pnpdump , Bus Mastering DMA, clarity rewrites, pciutils
kernel 2.2 /proc tree, IO range check, Windows may not update ESCD
v0.00 Nov. 1998 
-->
<abstract>
<!--
Help with understanding and dealing with the complex Plug-and-Play
issue.  How to get your Linux system to support Plug-and-Play. </abstract>
-->
複雑なプラグ&amp;プレイ(Plug-and-Play)について理解し，これを扱うための
お手伝いをします．また Linux システムをプラグ&amp;プレイ対応にする方法
を紹介します．
</abstract>
<toc>

<!--
<sect> Introduction
-->
<sect>はじめに

<!--
<sect1> Copyright, Trademarks, Disclaimer, &amp; Credits
-->
<!--O license.H begin -->
<sect1> 著作権表示，登録商標，免責事項，クレジット
<p>
<em/訳注/: ライセンス関係については原文をそのまま示します．

<sect2> Copyright
<p> Copyright (c) 1998-2000 by David S. Lawyer <url url="mailto:dave@lafn.org">

Please freely copy and distribute (sell or give away) this document
in any format.  Forward any corrections and comments to the document
maintainer.  You may create a derivative work and distribute it
provided that you:

<enum>
<item> Send your derivative work (in the most suitable format such as
  sgml) to the LDP (Linux Documentation Project) or the like for
  posting on the Internet.  If not the LDP, then let the LDP know
  where it is available.  Except for a translation, send a copy to the
  previous maintainer's url as shown in the latest version.
<item>License the derivative work in the spirit of this license or use
  GPL.  Include a copyright notice and at least a pointer to the 
  license used.
<item>Give due credit to previous authors and major contributors.
</enum>

If you're considering making a derived work other than a
translation, it's requested that you discuss your plans with the
current maintainer. 

<sect2>Disclaimer
<p> While I haven't intentionally tried to mislead you, there are
likely a number of errors in this document.  Please let me know about
them.  Since this is free documentation, it should be obvious that I
cannot be held legally responsible for any errors.

<sect2>Trademarks.
<p> Any brand names (starts with a capital letter) should be assumed to
be a trademark).  Such trademarks belong to their respective owners.
<!--O copyright.H end -->

<sect2> Credits
<p> Daniel Scott proofread this in March 2000 and found many typos, etc.

<!--
<sect1> Future Plans; You Can Help
-->
<sect1> 将来の計画: 助けてください
<!--
<p> Please let me know of any errors in facts, opinions, logic,
spelling, grammar, clarity, links, etc.  But first, if the date is
over a month old, check to see that you have the latest version.
Please send me any info that you think belongs in this document.
-->
<p> 事実，意見，論理の組み立て，単語の綴り，文法，文章の分かりやすさ，
リンク等に問題があれば，筆者にお知らせください．ただし 1 ヵ月以上古い
版の文書であれば，先に最新版かどうかを確認してください．また，この文書
に関連すると思われる情報があればお知らせください．

<!--
I haven't studied in detail either isapnptools or David Howells'
patches to the kernel (but I plan to).  Nor do I fully understand how
PnP is configured by the BIOS (it depends on which BIOS) nor how
Windows9x updates the ESCD.  Thus this HOWTO is still incomplete and
may be inaccurate (let me know where I'm wrong).  In this HOWTO I've
sometimes used ??  to indicate that I don't really know the answer.
-->
筆者は isapnptools についても David Howells さんのカーネルパッチについ
ても詳しく調べていません(調べようと考えてはいます)．BIOS が PnP をどの
ように初期化するのか(これは BIOS によって異なります)や，Windows9x によ
る ESCD の更新方法についても完全には理解していません．したがって，この 
HOWTO は未完成ですし，不正確かもしれません(間違いがあればお知らせくだ
さい)．この HOWTO では，筆者が正しい答えを知らないことを示す記号として
「??」をいくつか使っています．

<!--
<sect1> New Versions of this HOWTO
-->
<sect1> この HOWTO の最新版について
<!--
<p> New versions of the Plug-and-Play-HOWTO should appear every
month or so and will be available to browse and/or download at LDP
mirror sites.  For a list of mirror sites see: <url 
url="http://linuxdoc.org/mirrors.html">.  Various formats are
available.  If you only want to quickly check the date of the latest
version look at: <url
url="http://linuxdoc.org/HOWTO/Plug-and-Play-HOWTO.html">.
The version you are now reading is: v0.11, May 2000 .  New is this version are:
scanport utility, many typos fixed, setpci hard to
use .
-->
<p> Plug-and-Play-HOWTO の最新版はだいたい毎月出るはずであり，LDP とその
ミラーサイトで閲覧または入手することができます．ミラーサイトの一覧は 
<url url="http://linuxdoc.org/mirrors.html"> にあります．この文書は様々
なフォーマットで入手できます．最新版の日付をちょっと確認したいだけなら，
<url url="http://linuxdoc.org/HOWTO/Plug-and-Play-HOWTO.html"> を見ると
よいでしょう．あなたが読んでいるこの文書のバージョンは v0.11(2000年5月版)
です．今回新しく追加された項目は scanport ユーティリティ，多くの typo 修
正，setpci の簡単な使い方です．

<sect2> 日本語訳について
<p> 
この HOWTO 文書の日本語訳は Linux Japanese FAQ Project(JF Project)が
行いました．v0.09 までは翻訳：藤原輝嘉 &lt;fujiwara@linux.or.jp&gt;，
校正: 長谷川靖 &lt;yaz-hase@qb3.so-net.ne.jp&gt;,
武井伸光 &lt;takei@cc.kochi-u.ac.jp&gt; が、v0.10 からは
早川仁 &lt;cz8cb01@linux.or.jp&gt; が翻訳を引き継いでいます．

誤字・誤訳等があれば当プロジェクト(JF@linux.or.jp)までお知らせください．
また，この翻訳に関する配布条件および免責事項については，
オリジナルに準ずるものとします．

<!--
<sect> What PnP Should Do: Allocate "Bus-Resources"
-->
<sect> PnP の仕事: 「バスリソース」の割り当て
<!--
<sect1> What is Plug-and-Play (PnP)?
-->
<sect1> プラグ&amp;プレイ(PnP)とは何か?
<!--
<p> Oversimplified, Plug-and-Play automatically tells the software
(device drivers) where to find various pieces of hardware (devices)
such as modems, network cards, sound cards, etc.  Plug-and-Play's task
is to match up physical devices with the software (device drivers)
that operates them and to establish channels of communication between
each device and its driver.  In order to achieve this, PnP allocates
the following "bus-resources" to both drivers and hardware: I/O
addresses, IRQs, DMA channels (ISA bus only), and memory regions.  If
you don't understand what these 4 bus-resources are, read the following
subsections of this HOWTO: I/O Addresses, IRQs, DMA Channels, Memory
Regions.  An article in Linux Gazette about 3 of these bus-resources
is <htmlurl url="http://www.linuxgazette.com/issue38/blanchard.html"
name="Introduction to IRQs, DMAs and Base Addresses">.  Once these
bus-resources have been assigned (and if the correct driver is
installed), the names for such devices in the /dev directory are ready
to use.
-->
<p> ごく簡単に説明すると，プラグ&amp;プレイはモデムやネットワークカー
ド，サウンドカード等の各種ハードウェア(デバイス)を見つけられる場所を自
動的に，ソフトウェアに通知します．プラグ&amp;プレイの仕事は，物理デバイス
とこれを操作するソフトウェア(デバイスドライバ)と一致させ，デバイスとド
ライバの間に通信「チャンネル」を作ることです．これを実現するために，
PnP は以下の「バスリソース」をドライバとハードウェアの両方に割り当てます:
I/O アドレス，IRQ, (ISA バスのみ)DMA チャンネル，メモリ領域です．
これら 4 つのバスリソースが何のことか分からなければ，後述の 
I/O アドレス，IRQ, DMA チャンネル，メモリ領域の節を読んでください．
またこれらのバスリソースのうち 3 つに関する Linux Gazette の記事が
<htmlurl url="http://www.linuxgazette.com/issue38/blanchard.html"
name="Introduction to IRQs, DMAs and Base Addresses">
にあります．一度これらのバスリソースが割り当てられると(そして正しい
ドライバがインストールされると)，/dev ディレクトリにあるデバイスの
ファイルが使えるようになります．

<!--
This PnP assignment of bus-resources is sometimes called
"configuring" but it is only a low level type of configuring.  Even
with PnP fully utilized, much configuring of devices is done by other
than PnP.  For example, for modem configuration an "init string" is
sent to the modem over the I/0 address "channel".  This "init string"
has nothing to do with PnP although the "channel" used to send it to
the modem was allocated by PnP.  Setting the speed (and many other
parameters) of a serial port is done by sending messages to the device
driver from programs run by the user (often automatically boot-time).
This configuring also has nothing to do with PnP.  Thus when talking

about PnP "configuring" means only a certain type of configuring.
While other documentation (such a for MS Windows) simply calls
bus-resources "resources",  I have coined the term "bus-resources" so
as to distinguish it from the multitude of other kinds of resources.

about PnP, "resources" means only a limited subset of resources and
"configuring" means only a certain type of configuring.
-->
このようなバスリソースの PnP 割り当てが「設定(configuring)」と呼ばれ
ることもありますが，これは低レベルな種類の設定に過ぎません．つまり，
PnP を最大限利用した場合でもデバイスの設定の多くは PnP 以外で行われま
す．例えばモデムの設定であれば，「初期化文字列」が I/O アドレスの
「チャンネル」を使ってモデムに送られます．モデムに文字列を送るために使
われる「チャンネル」は PnP が割り当てたものですが，「初期化文字列」そ
のものは PnP とは無関係です．シリアルポートの速度(および他のパラメー
タの多く)の設定は，ユーザが実行した(起動時に自動的に実行されることもよ
くあります)プログラムからデバイスドライバへメッセージを送ることによっ
て行います．この設定もやはり PnP とは関係ありません．このように，PnP 
の話題においては「設定」は特定の種類の設定に過ぎません．他の文書
(MS Windows 向けの文書など)ではバスリソースを「リソース」と読んでいる
ことがありますが，この文書では他にもたくさんあるリソースと区別するため
に，「バスリソース」という用語を使うことにします．

<!--
<sect1> How a Computer Finds Devices (and conversely)
-->
<sect1> コンピュータによるデバイスの見つけ方(またはその逆)
<!--
<p> A computer consists of a CPU/processor to do the computing and
memory to store programs and data.  In addition, there are a number of
devices such as various kinds of disk-drives, a video card, a
keyboard, network cards, modem cards, sound cards, serial and parallel
ports, etc.  There is also a power supply to provide electric energy,
various buses on a motherboard to connect the devices to the CPU,
and a case to put all this into.  
-->
<p> コンピュータは計算を行う CPU とデータを格納するメモリで
構成されています．これに加えて，各種ディスクドライブやビデオカード，キー
ボード，ネットワークカード，モデムカード，サウンドカード，シリアルポー
ト，パラレルポート等があります．また，電力を供給する電源ユニット，デバ
イスを CPU に接続するマザーボード上のバス，そしてこれら全てを格納する
ケースがあります．

<!--
In olden days most all devices had their own plug-in cards (printed
circuit boards).  Today, in addition to plug-in cards, many "devices"
are small chips permanently mounted on the "motherboard".  Cards which
plug into the motherboard may contain more than one device.  Memory
chips are also sometimes considered to be devices but are not
plug-and-play in the sense used in this HOWTO.
-->
昔はほとんど全てのデバイスには専用のプラグインカード(プリント回路基板)
がありました．最近の多くの「デバイス」は，差し込むカードとしてだけでな
く，「マザーボード」に取り付けられた小さいチップの集まりとしても提供さ
れています．マザーボードに差し込むカードには 1 つ 以上のデバイスが入っ
ていることもあります．メモリチップをデバイスとして考えることもあります
が，本 HOWTO における意味でのプラグ&amp;プレイではありません．

<!--
For the computer system to work right, each device must be under the
control of its "device driver".  This is software which is a part of
the operating system (perhaps loaded as a module) and runs on the CPU.
Device drivers are associated with "special files" in the /dev
directory although they are not really files.  They have names such as
hda1 (first partition on hard drive a), ttyS0 (the first serial port),
eth1 (the second ethernet card), etc.  To make matters more
complicated, the particular device driver selected, say for eth1, will
depend on the type of ethernet card you have.  Thus eth1 can't just be
assigned to any ethernet driver.  It must be assigned to a certain
driver that will work for the type of ethernet card you have
installed.  To control a device, the CPU (under the control of the
device driver) sends commands (and data) to and reads info from the
various devices.  In order to do this each device driver must know the
address of the device it controls.  Knowing such an address is
equivalent to setting up a communication channel, even though the
physical "channel" is actually the data bus inside the PC which is
shared with almost everything else.
-->
コンピュータシステムを正しく動作させるためには，それぞれのデバイスは
「デバイスドライバ」の制御下になければなりません．デバイスドライバはオ
ペレーティングシステムの一部であり(モジュールとしてロードされることも
あります)，CPU 上で動作す
るソフトウェアです．デバイスドライバは /dev ディレクトリにある
「特殊ファイル」に関連付けられています．このファイルは実際のファイルで
はありません．このファイルの名前は hda1(ハードディスク a の最初のパー
ティション)，ttyS0(最初のシリアルポート)，eth1 (2番目のイーサネットカー
ド)のようになっています．混み入った話になるのですが，選択されるデバイ
スドライバ(例えば eth1 とします)は使っているイーサネットカードの種類に
よって決まります．つまり，全てのイーサネットドライバが eth1 を割り当て
られるのではありません．取り付けたイーサネットカードの機種に対応する，
ある特定のドライバが割り当てられなければなりません．デバイスを制御する
ために，(デバイスドライバを制御している)CPU は各種デバイスにコマンド
(およびデータ)を送ったり，情報を読み出したりします．このような通信を行
うため，各デバイスドライバは制御するデバイスの唯一のアドレス値を知って
いなければなりません．このようなアドレス値を知ることが「通信チャンネル
を設定する」ことなのです．この「チャンネル」が実際には PC 内部のデータ
バスであり，他のほとんど全てのものに共有されている場合でも同じです．
<!--
The communication channel is actually a little more complex than
described above.  An "address" is actually a range of addresses and
there is a reverse part of the channel (known as interrupts) which
allows devices to send an urgent "help" request to their device
driver.
-->
実際の通信チャンネルはここでの説明より少し複雑です．「アドレス値」は実
際には幅を持ったアドレスですし，チャンネルには(割り込みとして知られて
いる)逆向きの部分があり，デバイスはこれを使って緊急の「ヘルプ」要求を
デバイスドライバに送ることができます．

<!--
<sect1> I/O Addresses, etc.
-->
<sect1> I/O アドレス等
<!--
<p> PC's have 3 address spaces: I/O, main memory, and configuration
(only on the PCI bus).  All of these 3 types of addresses share the
same address bus inside the PC.  But the voltage on certain dedicated
wires on the PC's bus tells which "space" an address is in: I/O, main
memory, or configuration.  See <ref id="addresses_" name="Addresses">
for more details.  Devices were originally located in I/O address space
although today they may use space in main memory.  An I/0 address is
sometimes just called "I/O", "IO", "i/o" or "io".  The term "I/O port"
also used.  There are two main steps to allocate the I/O addresses (or
other bus-resources such as interrupts):
-->
<p> PC には 3 つのアドレス空間(I/O, メインメモリ，(PCI バスに限り)設定)
があります．これら 3 種類のアドレスは，PC 内部では同じバスを共有していま
す．しかし，あるアドレスがどの空間(I/O, メインメモリ，設定)のものかは，
PC のバス上にある専用の配線の電圧を使って伝えられます．詳しくは<ref
id="addresses_" name="アドレス"> の節を参照してください．元々はデバイス
は I/O アドレス空間に配置されていましたが，現在はメインメモリ内の空間を
使うこともあります．I/O アドレスは単に "I/O", "IO", "i/o", "io" と呼ばれ
ることもあります．また「I/O ポート」という言葉も使われます．I/O アドレス
(または割り込み等の他のバスリソース)は以下の 2 つの主なステップにより割
り当てられます:

<enum>
<!--
<item> Set the I/O address, etc. on the card (in one of its registers) 
-->
<item> I/O アドレス等をカード(のレジスタの 1 つ)に設定する
<!--
<item> Let its device driver know what this I/O address, etc. is
-->
<item> この I/O アドレス等をデバイスドライバに教える
</enum> 

<!--
The two step process above is something like the two part problem of
finding someone's house number on a street.  You must obtain (and
write down) the house number and someone must install a number on the
front of the house so that it may be found.  In computers, the device
driver must obtain the address and the device hardware must get
the same address set in one of its registers.  Both of these must be done,
but some people make the mistake of doing only one of these and then
wonder why the computer can't find the device.  For example, they will
use "setserial" to assign an address to a serial port without


realizing that this only tells the driver an address.  It doesn't set
the address in the serial port hardware itself.  If the serial port
actually had a different address (or none at all) and you told
setserial wrong, then you're in trouble.  

realizing that this only tells the driver the address.  It doesn't set
the address in the serial port hardware itself.  If you told the
driver the wrong address, you're in trouble.  
-->
先程述べた 2 ステップの処理は，道で誰かの家の番地を見つける問題を 2 つ
に分けたものと似ています．あなたは番地を見つけなければ(そして書き留め
なければ)なりませんし，この家の持ち主は，見つけてもらえるように家の前に
番地を表示していなければなりません．コンピュータの場合には，デバイスド
ライバはアドレスを取得しなければならず，デバイスのハードウェアは同じア
ドレスを特定のレジスタに設定していなければなりません．この作業は両方と
も行わなければならないのですが，片方しか設定しないようなミスをユーザが
することがあります．このような場合には，コンピュータはデバイスを検出で
きずに困ってしまうことになります．例えば，シリアルポートにアドレスを割
り当てる目的で "setserial" を使っても，"setserial" はドライバにしかア
ドレスを教えません．setserial はシリアルポート自体のアドレスは設定しま
せん．実際にシリアルポートがのアドレスが違っていたら(あるいは全く設定
されていなければ)，誤ったアドレスをドライバに設定していることになり，
問題が起こります．

<!--
Another obvious requirement is that before the device driver can use
an address it must be first set on the card.  Since device drivers
often start up soon after you start the computer, they sometimes try
to access a card (to see if it's there, etc.) before the address has
been set in the card by a PnP configuration program.  Then you see an
error message that they can't find the card even though it's there
(but doesn't yet have an address).
-->
この他にも明らかに必要なこととして，あるアドレスをデバイスドライバが使
えるようになる前には，そのアドレスがカードに設定されていなければならな
いことが挙げられます．デバイスドライバはコン
ピュータが起動した直後に動作を始めることが多いので，PnP 設定プログラム
がカードのアドレス設定を行う前にデバイスドライバが(カードがあるかどう
かを調べる等のために)カードにアクセスしようとすることも時々あります．
このような場合には，たとえカードがあっても(ただし，まだアドレスを持っ
ていない)，カードが見つからないというエラーメッセージが表示されます．

<!--
What was said in the last 2 paragraphs regarding I/O addresses applies
with equal force to other bus-resources: <ref id="interrupt_over"
name="IRQs -/-Overview">, <ref id="dma_" name="DMA Channels">, and <ref
id="mem_" name="Memory Regions">.  What these are will be explained
in the next 3 sections.
-->
先の 2 つの段落での I/O アドレスに関する説明は，他のリソース(
<ref id="interrupt_over" name="IRQ &#045;&#045;概要">,
<ref id="dma_" name="DMA チャンネル">,
<ref id="mem_" name="メモリ領域">
)についても同じように当てはまります．これらについては以下の 3 つの章で
説明します．

<!--
<sect1> IRQs &#045;&#045;Overview <label id="interrupt_over">
-->
<sect1> IRQ &#045;&#045;概要<label id="interrupt_over"> 
<!--
<p> After reading this you may read <ref id="interrupt_detail" name=
"Interrupts &#045;&#045;Details"> for some more details.  The following is
intentionally oversimplified:  Besides the address, there is also an
interrupt number to deal with (such as IRQ 5).  It's called an IRQ
(Interrupt ReQuest) number.  We already mentioned above that the
device driver must know the address of a card in order to be able to
communicate with it.  But what about communication in the opposite
direction?  Suppose the device needs to tell its device driver
something immediately?  For example, the device may have just received
a lot of bytes destined for main memory and the device needs to call
its driver to fetch these bytes at once and transfer them from the
device's nearly full buffer into main memory.  
-->
<p> この説明を読んだ後にもっと詳しいことを知りたくなった場合には
<ref id="interrupt_detail" name="割り込み --詳細">を読んでください．
ここでの説明はごく簡単に行います: アドレスの他にも，扱わなければな
らない割り込み番号(IRQ 5 等)というものがあります．これは IRQ(Interrupt
ReQuest, 割り込み要求)番号と呼ばれます．デバイスドライバが通信を行うた
めにはカードのアドレスを知っている必要があることは既に述べました．しか
し，逆方向の通信についてはどうでしょうか? また，デバイスがデバイスドラ
イバに急いで伝えなくてはならないことがあるとしたら? 例えばデバイスは，
メインメモリに送らなければならない大量のバイト列を受け取るようなことが
あるかもしれません．このような場合には，デバイスはすかさずドライバを呼
び出してデータを一度に受け取り，バッファ一杯に詰まったデータを急いでメ
インメモリに移してもらう必要があります．

<!--
How should the device call for help?  It can't use the main data bus
since it's likely already in use.  Instead it puts a voltage on a
dedicated interrupt wire (part of the bus) which is often reserved for
that device alone.  This signal is called an interrupt.  There are the
equivalent of 16 such wires in a PC and each wire leads (indirectly) to
a certain device driver.  Each wire has a unique IRQ (Interrupt
ReQuest) number.  The device must put its interrupt on the correct
wire and the device driver must listen for the interrupt on the
correct wire.  Which wire it's put on is determined by the IRQ number
stored in the device.  This same IRQ number must be known to the
device driver so that the device driver knows which IRQ line to listen
to.
-->
デバイスはどのようにして助けを求めなければならないのでしょうか? メイン
データバスは既に使われているでしょうから，これを使うことはできません．
その代わりに，デバイスは専用の割り込み線(バスの一部です)に電圧を設定し
ます．この線は多くの場合，そのデバイスのためだけに予約されています．
この信号は割り込みと呼ばれます．割り込み線には等価な線が 16 個あり，こ
れらはそれぞれ(間接的に)特定のデバイスドライバに繋がっています．それぞ
れの線には固有の IRQ (Interrupt ReQuest)番号がついています．デバイスは
割り込みを正しい線に送らなければならず，デバイスドライバは正しい線で割
り込みを待たなければなりません．どの線に割り込みが起こるかはデバイスに
格納されている IRQ 番号によって決まります．監視する IRQ がデバイスドラ
イバにわかるように，デバイスドライバにはこれと同じ IRQ 番号を設定しな
ければなりません．

<!--
Once the device driver gets the interrupt (a call for help) it must
find out why the interrupt was issued and take appropriate action to
service the interrupt.  On the ISA bus each device needs its own
unique IRQ number.  For the PCI bus and other special cases the sharing of IRQs
is allowed.
-->
デバイスドライバが割り込み(助けの求め)を受け取ると，デバイスドライバは
割り込みが発行された理由を調べ，割り込みを処理する適切な動作を行わなけ
ればなりません．ISA バスの場合には，それぞれにデバイスに固有の IRQ 番
号が必要です．PCI バスや，(ISA でも)特別な場合には IRQ を共有することが
できます．

<!--
<sect1> DMA Channels <label id="dma_">
-->
<sect1> DMA チャンネル <label id="dma_">
<!--
<p> DMA channels are only for the ISA bus.  DMA stands for "Direct Memory
Access".  This is where a device is allowed to take over the main
computer bus from the CPU and transfer bytes directly to main memory.
-Normally the CPU would make such a transfer in a two step process: 1.
-reading from the I/O memory space of the device and putting these
-bytes into the CPU itself  2. writing these bytes from the CPU to main
-memory.  With DMA it's usually a one step process of sending the bytes
-directly from the device to memory.  
 The device must have such capabilities built into its hardware and 
 thus not all devices can do
-DMA.  While DMA is going on the CPU can't do too much since the main
-bus is being used by The DMA transfer.
+Normally the CPU would make such a transfer in a two step process: 
+<enum>
+<item>reading from the I/O memory space of the device and putting these
+bytes into the CPU itself
+<item> writing these bytes from the CPU to main memory
+</enum>
+<enum>

+<item> With DMA it's usually a one step process of sending the bytes
+directly from the device to memory  
+</enum>
+The device must have such capabilities built into its hardware and
+thus not all devices can do DMA.  While DMA is going on the CPU can't
+do too much since the main bus is being used by the DMA transfer.

-->
<p> DMA チャンネルを使うのは ISA バスだけです．DMA は
「Direct Memory Access(直接メモリアクセス)」という意味です．これはデバ
イスが CPU からコンピュータのメインバスを引き継ぎ，バイト列を
メインメモリへ直接転送をすることが許可されている場所です．通常は CPU 
はこのような転送を 2 ステップの処理で行います:
<enum>
<item>デバイスの I/O メモリ空間から読み込んだバイト列を CPU そのものに送る．
<item>このバイト列を CPU からメインメモリに送る．
</enum>
DMA を使うとこの処理は，デバイスからメモリへ直接バイト列を送るという 1 
つのステップになります．ただし，デバイスのハードウェアにこの機能が組み込
まれていなければならないため，必ずしも全てのデバイスで DMA を使用できる
わけではありません．またメインバスが DMA 転送に使われてしまうため，
DMA が動作している時には CPU の動作が制限されます．

<!--
The PCI bus doesn't really have any DMA but instead it has something
even better: bus mastering.  It works something like DMA and is
sometimes called DMA (for example, hard disk drives that call
themselves "UltraDMA").  It allows devices to temporarily become bus
masters and to transfer bytes almost like the bus master was the CPU.
It doesn't use any channel numbers since the organization of the PCI
bus is such that the PCI hardware knows which device is currently the
bus master and which device is requesting to become a bus master.
Thus there is no allocation of DMA channels for the PCI bus.
-->
実は PCI バスには DMA がないのですが，その代わりに DMA よりももっと良
い機能があります．それはバスマスタリングです．バスマスタリングの動作は 
DMA と似ており，DMA と呼ばれることもあります(例えば，"UltraDMA" と呼ば
れるハードディスクドライブ)．この機能を使うと，デバイスは一時的にバス
の所有者(バスマスタ)になり，バスマスタが CPU であるかのようにバイト列
を転送することができます．バスマスタリングはチャンネル番号を全く使いま
せん．なぜなら PCI バスの仕組みでは，PCI のハードウェアは現在のバスマ
スタやバスマスタになろうとしてリクエストを出しているデバイスを知ること
ができるからです．したがって，PCI バスに対する DMA チャンネルの割り当
てはありません．

<!--
When a device on the ISA bus wants to do DMA it issues a DMA-request
using dedicated DMA request wires much like an interrupt request.  DMA
actually could have been handled by using interrupts but this would
introduce some delays so it's faster to do it by having a special type
of interrupt known as a DMA-request.  Like interrupts, DMA-requests 
are numbered so as to identify which device is making the request.
This number is called a DMA-channel.  Since DMA transfers all use the
main bus (and only one can run at a time) they all actually use the
ame channel but the "DMA channel" number serves to identify who is
using the "channel".  Hardware registers exist on the motherboard
which store the current status of each "channel".  Thus in order to
issue a DMA-request, the device must know its DMA-channel number which
must be stored in a register on the physical device.
-->
ISA バス上のデバイスが DMA を行おうとする際，このデバイスは割り込み要
求によく似た DMA 要求を専用の要求線を使って発行します．実際には DMA は
割り込みを使って処理することもできるはずなのですが，そうすると遅延が起
こるため，DMA 要求と呼ばれる特別なタイプの割り込みを使う方が速いのです．
割り込みと同様に，DMA 要求には番号が付けられており，要求を行ったデバイ
スを識別することができます．この番号は DMA チャンネルと呼ばれます．DMA 
チャンネルはメインバスを全て使う(また同時に 1 つしか動作できない)ので，
実際にはこれらすべてが同じチャンネルを使うのですが，「DMA チャンネル」
番号を使うと「チャンネル」を使っているデバイスを識別することができます．
各「チャンネル」の現在の状態を格納しているハードウェアレジスタがマザー
ボード上にあります．このように，DMA 要求を行うためには，デバイスは物理
デバイスのレジスタに格納されている DMA チャンネル番号を知っていなけれ
ばなりません．

<!--
<sect1> Memory Ranges <label id="mem_">
-->
<sect1> メモリ領域 <label id="mem_">
<!--
<p> Some devices are assigned address space in main memory.  It's
often "shared memory" or "memory-mapped I/O".  Sometimes it's ROM
memory on the device.  When discussing bus-resources it's often just
called "memory".  Such a device might also use I/O address space.  
-->
<p> 一部のデバイスにはメインメモリ内のアドレス空間が割り当てられていま
す．これは多くの場合「共有メモリ(shared memory)」または
「メモリマップト I/O(memory mapped I/O)」です．デバイス上の ROM である
こともあります．バスリソースの議論をする時には，これは単に「メモリ」と
呼ばれます．このようなデバイスも I/O アドレス空間を使用します．

<!--
When you plug in such a card, you are in effect also plugging in a
memory module for main memory.  This memory can either be ROM (Read
Only Memory) or shared memory.  Shared memory is shared between the
device and the CPU (running the device driver).  This memory can serve
as a means of direct data "transfer" between the device and main
memory.  It's not really a transfer since the device puts data into
its own memory on its card which also happens to be in main memory.
Both the card and the device driver need to know where it is.  The
memory address is likely to be very high so that they do not conflict
with the lower addresses of the memory chips in your computer.
-->
このようなカードを挿した時は，実際には(I/O メモリでなく)メインメモリに
対するメモリモジュールを挿していることになります．これは
ROM(Read Only Memory)と共有メモリのどちらでも構いません．このメモリは
デバイスとメインメモリ間の直接データ「転送」の手段として使われます．
しかし，これは実際には転送ではありません．というのも，デバイスは自分自
身のメモリにデータを書き込み，それがメインメモリにも書き込まれたことに
なっているだけだからです．カードとデバイスドライバのいずれも，この領域
がどこであるかを意識する必要はありません．メモリアドレスは多分非常に高
い位置に取られるため，低い位置にあるコンピュータのメモリチップのアドレ
スと重なってしまうことはありません．

<!--
ROM is different.  It is likely a program (perhaps a device driver)
which will be used with the device.  Hopefully, it may work with Linux
and not just Windows ??  It may need to be shadowed which means that it
is copied to your main memory chips in order to run faster.  Once it's
shadowed it's no longer "read only".
-->
ROM の扱いは異なります．これはプログラム(多分デバイスドライバ)であるこ
とが多く，デバイスと一緒に使われます．多分これは Windows 上だけでなく 
Linux 上でも動作します(??)．これはシャドウ化する必要があるかもしれませ
ん．シャドウ化と言うのは，高速な動作を行わせるために ROM の内容をメイ
ンメモリにコピーすることです．一旦シャドウ化を行うと，この領域はもはや
「読み取り専用」ではなくなります．

<!--
<sect1> "Resources" to both Device and Driver
-->
<sect1> デバイスとドライバの両方にとっての「リソース」
<!--
<p> Thus device drivers must be "attached" in some way to the hardware
they control.  This is done by supplying bus-resources (I/O, Memory,
IRQ's, DMA's) to both the physical device and the device driver
software.  For example, a serial port uses only 2 (out of 4 possible)
resources: an IRQ and an I/O address.  Both of these values must be
supplied to the device driver and the physical device.  The driver
(and its device) is also given a name in the /dev directory (such as
ttyS1).  The address and IRQ number is stored by the physical device
in registers on the card (or in a chip on the motherboard).  For the
case of jumpers, this info is always stored in the device hardware (on
the card, etc.).  But for the case of PnP, the register data is
usually lost when the PC is powered down (turned off) so that the
resource data must be supplied to each device anew each time the PC is
powered on.
-->
<p>このように，デバイスドライバは自分が制御するハードウェアに対して何
らかの方法で「割り当て」られなければなりません．これはバスリソース
(I/O, メモリ，IRQ, DMA)を物理デバイスとデバイスドライバのソフトウェア
の両方に与えることによって行います．例えば，シリアルポートは(4 つのう
ち)2 つのリソース，すなわち IRQ と I/O アドレスしか使いません．この値
は両方ともデバイスドライバと物理デバイスに与えなければなりません．ドラ
イバ(とそのデバイス)は /dev ディレクトリ内にも名前を与えられます(ttyS1 
等)．アドレスと IRQ 番号 は物理デバイスのカードのレジスタ内(またはマザー
ボード上のチップ内)に格納されます．ジャンパの場合には，この情報は必ず
デバイスのハードウェア(カード等)に格納されます．しかし PnP の場合には
通常，PC の電源を切るとレジスタのデータは無くなるので，リソースデータ
は PC の電源を入れるたびに毎回，各デバイスに対して新しく与えなければな
りません．

<!--
<sect1> The Problem
-->
<sect1> 問題
<!--
<p> The architecture of the PC provides only a limited number of
IRQ's, DMA channels, I/O address, and memory regions.  If there were
only several devices and they all had standardized bus-resource (such
as unique I/O addresses and IRQ numbers) there would be no problem of
attaching device drivers to devices.  Each device would have a fixed
resources which would not conflict with any other device on your
computer.  No two devices would have the same addresses, there would
be no IRQ conflicts, etc.  Each driver would be programmed with the
unique addresses, IRQ, etc. hard-coded into the program.  Life would
be simple.
-->
<p> PC のアーキテクチャでは IRQ, DMA チャンネル，I/O アドレス，メモリ
領域の数に制限があります．仮にデバイスの数が少なく，これら全てが標準化
されたバスリソース(固有の I/O アドレスと IRQ 番号)を持っているならば，デバ
イスドライバをデバイスに割り当てる際の問題は起こらないでしょう．
コンピュータ上の各デバイスは他のデバイスと衝突しないような固定のリソー
スを持てるからです．違うデバイスが同じ I/O アドレスや IRQ を持つことも
ないでしょう．ですから，各デバイスドライバのプログラム中に I/O アドレ
スやIRQ をハードコーディングすれば良いのです．とても話が簡単になりますね．

<!--
But it's not.  Not only are there so many different devices today that
conflicts are frequent, but one sometimes needs to have more than one of
the same type of device.  For example, one may want to have a few
different disk-drives, a few serial ports, etc.  For these reasons
devices need to have some flexibility so that they can be set to
whatever address, IRQ, etc. is needed to avoid conflicts.  But some
IRQ's and addresses are pretty standard such as the ones for the clock
and keyboard.  These don't need such flexibility.
-->
しかし，現実はそうではありません．最近では異なるデバイスがたくさんある
ので衝突は良く起きますし，同じタイプのデバイスを複数使わなければならな
い場合もあります．例えば，複数の異なるディスクドライブや複数のシリアル
ポートを使いたい場合などです．このような理由のため，デバイスには衝突を
回避できるように， IRQ やアドレスを設定できるような自由度が必要となり
ます．しかし，クロックやキーボードのような一部の IRQ やアドレスは標準
値が使われます．このようなデバイスにはこういった自由度は必要ありません．

<!--
Besides the problem of conflicting allocation of bus-resources, there
is a problem of making a mistake in telling the device driver what the
bus-resources are.  For example, suppose that you enter IRQ 4 in a
configuration file when the device is actually set at IRQ 5.  This is
another type of bus-resource allocation error.
-->
バスリソース割り当ての衝突の問題とは別に，デバイスドライバのバスリソー
ス設定を誤ってしまう問題があります．例えば，本当はデバイスに IRQ 5 が
設定されているのに設定ファイルには IRQ 4 と書いているような場合です．
これは別の種類のバスリソース割り当てエラーです．

<!--
The allocation of bus-resources, if done correctly, establishes
channels of communication between physical hardware and their device
drivers.  For example, if a certain I/O address range (resource) is
allocated to both a device driver and a piece of hardware, then this
has established a one-way communication channel between them.  The
driver may send commands and info to the device.  It's actually a
little more than one-way since the driver may get information from the
device by reading its registers.  But the device can't initiate any
communication this way.  To initiate communication the device needs an
IRQ in order to create a two-way communication channel where both the
driver and the device can initiate communication.
-->
バスリソースの割り当てを正しく行えば，物理デバイスとこれに対応するデバイス
ドライバの間に通信チャンネルが確立されます．例えば，ある範囲の I/O ア
ドレス(リソース)がデバイスドライバとハードウェアに割り当てられた場合，
両者の間に一方通行の通信チャンネルが確立したことになります．ドライバは
コマンドと情報をデバイスに送ることができます．ドライバはレジスタを読む
ことによってデバイスから情報を取得することができるので，実際には単なる
一方通行というわけではありません．しかし，この方法ではデバイス側から通
信を始めることはできません．双方向通信チャンネルを作るためには，デバイス
は IRQ を必要とします．双方向通信チャンネルとは，デバイスドライバからも
デバイスからも通信を始めることができる通信のことです．

<!--
<sect1> PnP Finds Devices Plugged Into Serial Ports
-->
<sect1>  シリアルポートに挿したデバイスの PnP による検出
<!--
<p> External devices that connect to the serial port via a cable (such
as external modems) can also be called Plug-and-Play.  Since only the
serial port itself needs bus-resources (an IRQ and I/O address) there are
no bus-resources to allocate to such plug-in devices.  Thus PnP is not
really needed for them.  Even so, there is a PnP specification for
such external serial devices.
-->
<p>シリアルポートにケーブルで接続した外部デバイス(外付けモデムなど)も
プラグ&amp;プレイと呼ばれます．バスリソース(IRQ と I/O ポート)を必要と
するのはシリアルポート自身だけなので，このような接続デバイス自体にバス
リソースは割り当てられません．ですから，実際はこれらのデバイスには PnP 
は必要ではありません．
そうであっても，このような外部シリアルデバイスに対しても PnP の仕様が
決められています．

<!--
A PnP operating system will find such an external device and read its
model number, etc.  Then it may be able to find a device driver for it
so that you don't have to tell an application program that you have a
certain device on say /dev/ttyS1.  Since you should be able to
manually inform your application program (via a configuration file,
etc.) what serial port the device is on (and possibly what model
number it is) you should not really need this "serial port" feature of
PnP.
-->
PnP OS はこのような外部デバイスを検出し，そのデバイスのモデル番号等を
読み込みます．これにより，そのデバイス用のデバイスドライバを見つけるこ
とができるので，特定のデバイス(例えば /dev/ttyS1)を使っていることをア
プリケーションプログラムに対して指示する必要が無くなります．デバイスが
接続されているシリアルポートを(設定ファイル等を使って)手動で指定するこ
ともできるはず(デバイスのモデル番号を指定することがあるかもしれません)
なので，どうしても PnP の「シリアルポート」機能が必要だということはな
いでしょう．

<!--
<sect> The Plug-and-Play (PnP) Solution
-->
<sect> プラグ&amp;プレイ(PnP)の解決方法
<!--
<sect1> Introduction to PnP
-->
<sect1> はじめに
<!--
<p> The term Plug-and-Play (PnP) has various meanings.  In the broad
sense it is just auto-configuration where one just plugs in a device
and it configures itself.  In the sense used in this HOWTO, the
configuration is only that of configuring PnP bus-resources and letting
the device drivers know about it.  In a more narrow sense it is just
setting bus-resources in the hardware devices.  It may also mean the PnP
specifications which (among other things) specify how PnP resource
data is to be read and written to devices (often cards) on the ISA
bus.  The standard PCI (and not PnP) specifications do the same for
the PCI bus.
-->
<p>プラグ&amp;プレイという言葉には色々な意味があります．広い意味では，
デバイスを繋げばその設定が行われる単なる自動設定を指します．本 HOWTO 
における意味では設定というのは PnP バスリソースの設定と，デバイスドライバ
にその設定内容を知らせることだけを指します．もっと狭い意味では，ハード
ウェアデバイスのバスリソースを設定することだけを指します．これは PnP の仕
様を指すこともあります．この仕様は(他のことも書かれていますが特に) ISA 
バス上のデバイス(多くの場合はカードです)に対して PnP リソースデータを
読み書きする方法の仕様を定めています．標準の PCI(PnP ではありません)の
仕様は，同じことがPCI バスでできるように作られています．

<!--
PnP matches up devices with their device drivers and specifies their
communication channels.  On the ISA bus before Plug-and-Play the
bus-resources were set in hardware devices by jumpers.  Software drivers
were assigned bus-resources by configuration files (or the like) or by
probing the for the device at addresses where it's expected to reside.
The PCI bus was PnP-like from the beginning so it was trivial to
implement PnP for this bus.  Since the PCI bus specifications don't
use the term PnP it's not clear whether or not the PCI bus should be
called PnP (but it supports in hardware what today is called PnP).
-->
PnP はデバイスとデバイスドライバの設定を一致させ，両者の通信チャンネルを
指定します．プラグ&amp;プレイが使われる前の ISA バスの場合には，ジャン
パを使ってハードウェアデバイスのバスリソースを設定していました．ソフト
ウェアドライバへのバスリソースの割り当ては，設定ファイル(等)またはデバ
イスが存在する
と思われるアドレスを調べることによって行っていました．PCI バスは作られ
た時から PnP のようになっていたので，PCI バス用に PnP を実装するのは非
常に簡単でした．PCI バスの仕様では PnP という用語が使われていないので，
PCI バスを PnP と呼んでよいのかどうかははっきりしていません(ですが，
PCI バスは，現在 PnP と呼ばれているものをハードウェア的にサポートして
います)．

<!--
<sect1> How It Works (simplified)
-->
<sect1> PnP の動作 (簡単な説明)
<!--
<p> Here's an oversimplified view of how PnP works.  The PnP
configuration program (perhaps a program in the BIOS) finds all PnP
devices and asks each what bus-resources it needs.  Then it checks what
bus-resources (IRQs, etc.) it has to give away.  Of course if it has
reserved bus-resources used by non-PnP (legacy) devices (if it knows about
them) it doesn't give these away.  Then it uses some criteria (not
specified by PnP specifications) to give out the bus-resources so that
there are no conflicts and so that all devices get what they need (if
possible).  It then tells each physical device what bus-resources are
assigned to it and the devices set themselves up to use only the
assigned bus-resources.  Then the device drivers somehow find out what
bus-resources their devices use and are thus able to communicate
effectively with the devices they control.  
-->
<p> PnP の動作の概要をごく簡単に説明します．PnP 設定プログラム(多分
BIOS 内にあるプログラムです)は全ての PnP デバイスを検出し，各デバイス
が必要とするバスリソースを問い合わせます．次に，この設定プログラムは
渡さなければならないバスリソース(IRQ 等)をチェックします．当然ながら非 PnP
(レガシー)デバイスが使っている予約済みバスリソースがあれば(設定プログラム
が知っていれば)，このような予約済みリソースは PnP デバイスに渡されませ
ん．次に，設定プログラムは(PnP の仕様では決められていない)何らかの基準
を用いて，衝突が起きず，かつ全てのデバイスに必要なバスリソースを(可能なら
ば)割り当てます．それから，設定プログラムは割り当てたバスリソースを各物理
デバイスに設定し，デバイスは割り当てられたバスリソースを使うように自分自身
の設定を行います．そしてデバイスドライバは制御するデバイスが使う
バスリソースを何らかの方法で検出し，これによりデバイスと効率的に通信が
行えるようになります．

<!--
For example, suppose a card needs one interrupt (IRQ number) and 1 MB
of shared memory.  The PnP program reads this request from the card.
It then assigns the card IRQ5 and 1 MB of memory addresses space,
starting at address 0xe9000000.  It's not always this simple as the
card may specify that it can only use certain IRQ numbers (ISA only)
or that the 1 MB of memory must lie within a certain range of
addresses.  The details are different for the PCI and ISA buses with
more complexity on the ISA bus.
-->
例えば，割り込み(IRQ 番号) 1 つと共有メモリ 1MB を必要とするカードがあ
るものとします．PnP プログラムはこのリクエストをカードから受け取ります．
PnP プログラムは IRQ5 と，アドレス 0xe9000000 から始まる 1MB のアドレ
ス空間を割り当てます．いつもこのように簡単に設定できるとは限りません．
というのも，(ISA の場合は)特定の IRQ 番号しか使えないことや，1MB のメ
モリ領域が特定の範囲のアドレスに入っていなければならないことをカードが
指定してくる場合があるからです．細かい部分は PCI バスと ISA バスで異な
りますが，ISA バスの方が問題が込み入っています．

<!--
There are some shortcuts that PnP software may use.  One is to keep
track of how it assigned bus-resources at the last configuration (when the
computer was last used) and reuse this.   Windows9x and PnP BIOSs do
this but standard Linux doesn't.  Windows9x stores this info in its
"Registry" on the hard disk and a PnP BIOS stores it in non-volatile
memory in your PC (known as ESCD; see <ref id="escd_" name="The BIOS's
ESCD Database">).-->
PnP 設定プログラムが使える簡易的な設定方法がいくつかあります．その 1 
つは前回の設定時(コンピュータを前回使った時)のバスリソースの割り当てを保存
しておき，これを再利用することです．Windows9x と PnP BIOS の組み合わせ
はこの動作を行いますが，標準の Linux ではこれを行いません．Windows9x 
はこの情報をハードディスク上の「レジストリ」に保存し，PnP BIOS はこの
情報を PC の不揮発メモリ(これは ESCD として知られています．
<ref id="escd_" name="BIOS の ESCD データベース"> を参照してください)
に保存します．

<!--
Under Linux it's each device for itself and there is no centralized
non-volatile registry of resource assignments.  Some device drivers
store the last configuration they used and use it next time the
computer is powered on.  They implicitly assume that the rest of the
hardware will not need to use its bus-resources. 
-->
Linux においては，この処理はそれぞれのデバイスが自力で行い，リソースの
割り当てを集中管理する不揮発性のレジストリはありません．デバイスドライバ
によっては，最後に用いた設定を格納しておき，次に電源を入れた時にその設定
を使うものもあります．このようなデバイスは，残りのハードウェアが
バスリソースを必要としないことを暗黙的に仮定しています．

<!--
If the device hardware remembered their previous configuration, then
there wouldn't be any hardware to configure at the next boot-time, but
they seem to forget their configuration when the power is turned off.
Some devices contain a default configuration (but not necessarily the
last one used).  Thus a PnP configuration program needs to be run each
time the PC is powered on.  Also, if a new device has been added, then
it too needs to be configured.  Allocating bus-resources to this new
device might involve taking some bus-resources away from an existing
device and assigning the existing device alternative bus-resources that it
can use instead.
-->
デバイスのハードウェアが前の設定を記憶していれば，次の起動時にはほとん
ど何も設定しなくてもよいのですが，デバイスは電源を切ると設定を忘れるよ
うです．デフォルトの設定を持っているデバイスもあります(ですが，これは
必ずしも前回使った設定とは限りません)．したがって，PnP 設定プログラム
は PC を起動するたびに毎回実行する必要があります．また，新しいデバイス
を追加したら，デバイスの設定を行う必要があります．この新しいデバイスに
バスリソースを割り当てる際には，既にあるデバイスから一部のバスリソースを取り上
げ，代わりに使うことができる別のバスリソースをそのデバイスに割り当てること
になるかもしれません．

<!--
<sect1> Starting Up the PC
-->
<sect1> PC の起動
<!--
<p> When the PC is first turned on the BIOS chip runs its program to
get the computer started (the first step is to check out the
hardware).  If the operating system is stored on the hard-drive (as it
normally is) then the BIOS must know about the hard-drive.  If the
hard-drive is PnP then the BIOS may use PnP methods to find it.  Also,
in order to permit the user to manually configure the BIOS's CMOS and
respond to error messages when the computer starts up, a screen (video
card) and keyboard are also required.  Thus the BIOS must
PnP-configure these devices on its own.
-->
<p> コンピュータの電源を最初に入れたとき，BIOS チップはコンピュータを
起動させるために BIOS のプログラムを実行します(最初のステップはハード
ウェアのチェックです)．オペレーティングシステムがハードディスクに格納
されている場合(普通はそうです)，BIOS はハードディスクの情報を取得しな
ければなりません．ハードディスクが PnP であれば，BIOS はこれを見つける
ために PnP を使うことができます．また，コンピュータの起動時にユーザが 
BIOS の CMOS を手動で設定できるようにしたり，エラーメッセージが出せる
ようにするためには，スクリーン(ビデオカード)とキーボードが必要となりま
す．これらのデバイスがあれば BIOS は PnP 設定を行わなければなりません．

<!--
Once the BIOS has identified the hard-drive, the video card, and the
keyboard it is ready to start booting (loading the operating system
into memory from the hard-disk).  If you've told the BIOS that you a
have a PnP operating system (PnP OS), it should start booting the PC
as above and let the operating system finish the PnP configuring.
Otherwise, a PnP-BIOS will (prior to booting) likely try to do the
rest of the PnP configuring of devices (but not their drivers).
-->
一度 BIOS がハードディスク，ビデオカード，キーボードを認識したら，BIOS
によるブート(ハードディスクからメモリにオペレーティングシステムをロード
すること)開始の準備は完了です．PnP 対応のオペレーティングシステム(PnP OS)
を使っていることを BIOS で指定している場合には，BIOS は前に述べたよう
に PC のブートを開始し，オペレーティングシステムに PnP 設定を行わせな
ければなりません．そうでない場合は，(ブートの前に)PnP BIOS 自身が残り
のデバイスの PnP 設定を行おうとします(ただし，ドライバの設定は行いません)．

<!--
<sect1> Buses
-->
<sect1> バス
<!--
<p> ISA is the old bus of the old IBM PC's while PCI is a newer and
faster bus from Intel.  The PCI bus was designed for what is today
called PnP.  It makes it easy (as compared to the ISA bus) to find out

-how PnP bus-resources have been assigned to hardware devices.  To see what
-has happened look at the /proc/pci "file" (/proc/bus/pnp/devices for
-kernel 2.2+), the boot-up messages on your display (use shift-PageUp
-to back up), or use PCI Utilities (for kernel 2.2+).
+how PnP bus-resources have been assigned to hardware devices.  To see
+what has happened use the <tt/lspci/ command and/or look at
+<tt>/proc/pci</tt> or possibly <tt>/proc/bus/pci</tt>.  The boot-up
+messages on your display are useful (use shift-PageUp to back up).
+See <ref id="boot_time_msgs" name="Boot-time Messages">
-->
<p> ISA は古い IBM-PC のバスで，PCI はインテルが提唱した新しく高速なバス
です．PCI バスは，現在 PnP と呼ばれている機能が実現できるように設計され
ています．PCI バスでは，PnP バスリソースがハードウェアデバイスにどのよう
に割り当てられたのかを調べることが(ISA バスと比べて)簡単です．どんな設定
になっているかを知るには <tt/lspci/ コマンドを使用したり，
<tt>/proc/pci</tt> あるいは <tt>/proc/bus/pci</tt> ファイルを見るとよい
でしょう。起動時にディスプレイに表示されるメッセージ(前の表示を見るには 
Shift-PageUp を使います)も役にたちます。<ref id="boot_time_msgs"
name="起動時のメッセージ"> も参照してください。

<!--
For the ISA bus there is a real problem with implementing PnP since no
one had PnP in mind when the ISA bus was designed and there are almost
no I/O addresses available for PnP to use for sending configuration info
to physical device.  As a result, the way PnP was shoehorned onto the
ISA bus is very complicated.  A whole book has been written about it.
See <ref id="pnp_book" name="PnP Book">.  Among other things, it
requires that each PnP device be assigned a temporary "handle" by the
PnP program so that one may address it for PnP configuring.  Assigning
these "handles" is call "isolation".  See <ref id="isolation_"
name="Isolation"> for the complex details.
-->
ISA バスの場合には，PnP の実装に関する難問があります．この原因は ISA 
バスの設計当時には誰も PnP のことを想定していなかったことや，設定情報
を物理デバイスに送るために PnP が使える I/O アドレスがほとんどないこと
です．結局，ISA バス上で PnP を行う方法はとても面倒になってしまいまし
た．これに関しては本が丸一冊書かれています．
<ref id="pnp_book" name="PnP Book"> をご覧ください．特に，それぞれの 
PnP デバイスに PnP プログラム用の一時的な「ハンドル(handle)」を割り当
てて，プログラムが PnP 設定を行うときにデバイスを特定できるようにする
ことが必要です．この「ハンドル」を割り当てることを「アイソレーション
(isolation)」と言います．細かい点については付録の
<ref id="isolation_" name="アイソレーション">を参照してください．

<!--
Eventually, the ISA bus should become extinct.  When it does, PnP will
be easier since it will be easy to find out how the BIOS has
configured the hardware.  There will still be the need to match up
device drivers with devices and also a need to configure devices that
are added when the PC is up and running.  These needs would be
satisfied if Linux was a PnP operating system.
-->
ISA バスはいつかはなくなるはずです．そうなれば PnP はもっと簡単になる
でしょう．というのも，BIOS がどのようにハードウェアを設定したのかが容
易にわかるようになるからです．それでも，デバイスドライバをデバイスとう
まく組み合わせる必要はあるでしょうし，PC の起動・実行時には追加された
デバイスを設定する必要もあるでしょう．このような必要性は，Linux が PnP 
オペレーティングシステムだったなら満たされていたことでしょう．

<!--
<sect1> Linux Needs to Cope Better with PnP <label id="linux_needs_PnP">
-->
<sect1> Linux で PnP をうまくやっていくことの必要性 <label id="linux_needs_PnP">
<!--
<p> PnP (for the ISA bus) was invented by Compaq, Intel, and Phoenix.
Microsoft has been a leading promoter of it.  Linux would have been
better off if PnP had never been "invented".  Eventually the ISA bus
will have become extinct and the PnP-like PCI bus will prevail so that
we will have in effect gotten an easy-to-implement PnP.  But like it
or not, most all new ISA hardware today is PnP and Linux has no choice
but to deal effectively with PnP.  But standard Linux (as of early
1999) makes dealing with PnP complicated (especially on the ISA bus)
while the purpose of PnP was to make it simple.  
-->
<p> PnP 規格(ISA バス用)は Compaq, Intel, Phoenix が作りました．
Microsoft は先頭に立って PnP の普及を進めました．PnP が「発明」されて
いなければ，Linuxは幸せだったことでしょう．いつかは ISA バスは廃れ，
PnP に似た機能を持つ PCI バスが普及し，実装が容易な PnP を実際に使える
ようになるでしょう．ですが好むと好まざるとに係わらず，最近の新しい ISA 
ハードウェアはほとんど全てが PnP なので，Linux には PnP とうまく付き合っ
ていく以外の道はありません．しかし，標準の Linux (1999 の初めの時点)で
は，PnP の扱いが(特に ISA バスの場合には)複雑になっています．PnP の元々
の目的は設定を簡単にすることだったはずなのですが…．

<!--
In a sense, Linux is already somewhat PnP for the PCI bus.  When the
PC starts up you may note from the messages on the screen that some
Linux device drivers often find their hardware devices (and the
bus-resources the BIOS has assigned them).  But there are situations that
a PnP operating system could handle better: 
<itemize>
<item>A shortage of bus-resources
<item>More than one driver for a physical device  
<item>An activated driver which can't find its physical device 
<item>Hot installation of a device (docking, etc.)
</itemize>
-->
ある意味では，Linux は PCI バスに対しては既にある程度の PnP 機能を持っ
ているとも言えます．PC を起動した時，スクリーンに表示されるメッセージ
から一部のデバイスドライバが自分が制御するハードウェアデバイス(および 
BIOS がこれらに割り当てたバスリソース)を検出するしたことに読者の皆さんもお
気づきかもしれません．しかし，PnP オペレーティングシステムならもっとう
まく処理できる状況がいくつかあります: 
<itemize>
<item>バスリソース不足の場合．
<item>1 つの物理デバイスに複数のドライバがある場合．
<item>アクティブにされたデバイスが物理デバイスを見つけられない場合．
<item>デバイスの活線挿入(ドックとの接続など)の場合．
</itemize>

<!--
Linux users should not need to delve into the details of PnP to
configure ISA PnP devices as they now need to.  One solution would be
a standardized version of the Linux kernel that supports Plug-and-Play
on the ISA, PCI, and other buses.  A patch to the kernel has been written
although most drivers don't support it.  It's not part of standard
Linux.  See <ref id="patch_kernel" name="Patch Kernel">.
-->
Linux ユーザは，使いたい ISA PnP デバイスの設定を行うために PnP そのも
のについて詳しく調べる必要はないはずです．解決方法の 1 つは，標準化さ
れたバージョンの Linux が ISA バスや PCI バス，その他のバスにおいてプ
ラグ&amp;プレイをサポートすることです．カーネルへのパッチが書かれてい
ますが，ほとんどのドライバはこのパッチに対応していません．
このパッチは標準の Linux の一部ではありません．
<ref id="patch_kernel" name="カーネルにパッチを当てて Linux を PnP 対応にする">
を参照してください．

<!--
<sect> Configuring a PnP BIOS <label id="conf_pnp_bios">
-->
<sect> PnP BIOS の設定 <label id="conf_pnp_bios">
<!--
<p> When the computer is first turned on, the BIOS runs before the
operating system is loaded.  Newer BIOSs are PnP and will configure
some or all of the PnP devices.  For most PnP BIOSs there is no way to
disable PnP so you have to live with it.  Here are some of the choices
which may exist in your BIOS's CMOS menu:
-->
<p> コンピュータの電源を入れると，オペレーティングシステムがロードされ
る前に BIOS が実行されます．最近の BIOS は PnP 対応であり，一部あるい
は全ての PnP デバイスを設定します．ほとんどの PnP BIOS では PnP を無効
にできないので，PnP とうまく共存していくしかありません．BIOS の CMOS 
メニューにあるかもしれない選択肢を以下にいくつか示します:

<itemize>
<!--
<item> <ref id="bios_pnp_os" name="Do you have a PnP operating
 system?">
<item> <ref id="bios_resources" name="How are bus-resources to be controlled?">
<item> <ref id="bios_reset" name="Reset the configuration?">
-->
<item> <ref id="bios_pnp_os" name="Do you have a PnP operating system?(PnP オペレーティングシステムを持っているか?">
<item> <ref id="bios_resources" name="How are resources to be controlled?(どのようにバスリソースを制御するか?)">
<item> <ref id="bios_reset" name="(Reset the configuration?)設定をリセットするか?">
</itemize>

<!--
<sect1> Do you have a PnP operating system? <label id="bios_pnp_os">
-->
<sect1>PnP オペレーティングシステムを持っているか? <label id="bios_pnp_os"> 
<!--
<p> If you say yes, then the PnP BIOS will PnP-configure the
hard-drive, video card, and keyboard to make the system bootable.  But
it will leave it up to the operating system to finish the
configuration job.  It may do an <ref id="isolation_"
name="Isolation"> on the ISA bus leaving the devices disabled but
ready to be configured by the operating system.  For Linux you should
probably tell it that you don't have a PnP operating system.  If you
don't do this, the BIOS might leave the ISA devices it hasn't
configured in a disabled state ??  Also PCI devices might not get
configured ??

ready to be configured by the operating system.  You should probably
tell it that you don't have a PnP operating system.  If you don't do
this, the BIOS might leave the ISA devices it hasn't configured in a
disabled state ??  Also PCI devices might not get configured ??
-->
<p> これに「yes」を設定している場合，PnP BIOS はハードディスク・ビデオ
カード・キーボードの PnP 設定を行って，システムを起動できるようにします．
しかし，PnP BIOS は設定作業の仕上げをオペレーティングシステムに任せます．
BIOS は ISA バス上で <ref id="isolation_" name="アイソレーション"> を
行い，デバイスは無効であるけれどオペレーティングシステムで設定できる状
態にします．Linux の場合にはおそらく，PnP オペレーティングシステムを持っ
ていないとBIOS に設定しなければなりません．このように答えないと，BIOS 
は設定していない ISA デバイスを無効な状態のままにするかもしれません(??)．
PCI デバイスも設定されないかもしれません(??)．

<!--
If you tell the BIOS you don't have a PnP OS, then the BIOS will do
the configuring itself.  Unless you have added new PnP devices, it
should use the configuration which it has stored in its non-volatile
memory (ESCD).  See <ref id="escd_" name="The BIOS's ESCD Database">.
If the last session on your computer was with Linux, then there should
be no change in configuration.  See <ref id="bios_conf" name= "BIOS

Configures PnP">.  But if the last session was with Windows9x (which
is PnP) then Windows could have modified the ESCD.  It supposedly does
this only if you "force" a configuration or install a legacy device.
See <ref id="W9x_ESCD" name="Using Windows to set ESCD">.  If you are
using the isapnp or PCI Utilities program(s) to do configuring, they
will run after the BIOS runs and change things the way you told them
to.
-->
PnP OS を持っていないと BIOS に設定した場合，BIOS は自分自身でデバイス
の設定を行います．新しい PnP デバイスを追加しない限り，BIOS は不揮発性
メモリ(ESCD)に保存されている設定を使うはずです．
<ref id="escd_" name="BIOS の ESCD データベース"> を参照してください．
コンピュータの前回のセッションで Linux を使っていれば設定は変わらない
はずです．<ref id="bios_conf" name= "BIOS での PnP 設定"> を参照してく
ださい．しかし，前回のセッションで (PnP OSである) Windows9x を使った場
合，Windows が ESCD を変更しているかもしれません．
これが行われるのは多分，「設定」を強制した時か，レガシーデバイスを
インストールした時だけです．
<ref id="W9x_ESCD" name="Windows を用いた ESCD の設定が問題を起こす場合">
を参照してください．読者の皆さんが isapnp や PCI Utilities 等のプログ
ラムを使って設定を行った場合，これらのプログラムは BIOS の実行後に実行
され，ユーザが指示した通りに PnP の設定を変更します．

<!--
<sect2> Interoperability with Windows9x
-->
<sect2> Windows9x と組み合わせての利用
<!--
<p> If you are running both Linux and Windows on the same PC, how do
you answer the BIOS's question: Do you have a PnP OS?  Normally (and
truthfully) you would say no for standard Linux and yes for Windows9x.
But it's a lot of bother to have to set up the BIOS's CMOS menu
manually each time you want to switch OSs.  One solution is set the
CMOS for no PnP OS, including when you start Windows.  One might
expect that Windows would be able to handle this situation where it is
presented hardware that has been fully configured by the BIOS.  In
addition, one might expect that even if Windows didn't realize that
the hardware was already configured, it would redo this configuration
and then work OK.  But it doesn't seem to work this way.  It seems
that Windows may just tell its device drivers what has been stored in
the Windows' Registry.  But the actual hardware configuration (done by
the BIOS) is what was stored in the ESCD and may not be the same as
the Registry => trouble.
-->
<p>Linux と Windows を同じ PC 上で使っている場合には，BIOS の
「PnP OS を使っているか?(Do you have a PnP OS?)」という問いにどう答え
れば良いのでしょうか? 通常(そして正しく)は，標準の Linux については
「no」と答え，Windows9x については「yes」と答えるべきでしょう．しかし，
OS を切替えようとする度に BIOS の CMOS メニューを手動で設定しなければ
ならないというのは非常に面倒です．これを解決する方法の 1 つは，Windows 
使用時も含めて「PnP OS を持っていない」と CMOS に設定することです．
Windows はこの状況(BIOS が与えられたハードウェアを完全に設定している)
に対応できることが期待できます．さらに，ハードウェアが既に設定されてい
ることをWindows が 認識できなくても，Windows がもう一度この設定を行っ
てうまく動作することが期待できます．しかし，こんなにうまくは行かないよ
うです．
Windows は単に，レジストリに格納している情報をドライバに伝えるだけのよ
うです．しかし(BIOS が行った)実際のハードウェア設定は，ESCD に格納され
ている設定であり，レジストリとは異なるかもしれず，問題を起こすかもしれ
ません．

<!--
One way to try to get the Registry and the ESCD the same is to install
(or reinstall) Windows when the BIOS is set for "not a PnP OS".  This
should present Windows with hardware configured by the BIOS.  If this
configuration is without conflicts, Windows will hopefully leave it
alone and save it in it's Registry.  Then the ESCD and the registry
are in sync.  If this works for you (and this is the latest version of
this HOWTO), let me know as I only have one report of this working out
OK.  
-->
CMOS の設定とレジストリの設定を合わせる方法の 1 つは，BIOS の設定が
「PnP OS を持っていない(not a PnP OS)」である状態で Windows を
インストール(または再インストール)することです．これを行うと，
Windows には BIOS が設定したシステムが見せられるはずです．この設定にお
いてリソースの衝突がなければ，Windows はたぶん設定をいじらず，これをレ
ジストリに保存するでしょう．こうして ESCD とレジストリが同期します．
これで正しく動作したら(そしてこの HOWTO が最新版であれば)，筆者にお知
らせください．というのも，筆者は正しく動作したという報告を 1 件しか受
けていないからです．

<!--
Another method is to "remove" devices that are causing problems in
Windows by clicking on remove in the Device Manager.  Then reboot with
"Not a PnP OS" (set it in the CMOS as you start to boot).  Windows
will then reinstall the devices, hopefully using the bus-resource
settings configured by the BIOS.  Be warned that Windows will likely
ask you to insert the Window installation CD since it sometimes can't
find the driver files (and the like) even thought they are still
there.  As a test I "removed" the NIC card which had a Novell
compatible drivers.  Upon rebooting, Windows reinstalled it with
Microsoft networking instead of Novell.  This meant that the Novell
Client needed to be reinstalled.  Let me know about your problems with
this method (only if this is the latest version of this HOWTO).
-->
別の方法は，Windows で問題を起こすデバイスをデバイスマネージャ上で「削
除」することです．それから「PnP OS を持っていない(Not a PnP OS)」の状
態でPC を再起動します(設定は起動時に CMOS で行います)．すると，Windows 
上でデバイスドライバを再インストールしますが，うまくすると BIOS が設定
したバスリソースをこの際に使います．Windows は多分 Windows のインストー
ル用 CD を入れることを求めるので注意してください．というのも， Windows 
はドライバファイル(の類)が残っていても，これを見つけられない場合がある
からです．テストとして，筆者は Novell 互換のドライバを持っている NIC 
カードを「削除」しました．再起動の時，Windows は Novell でなく 
Microsoft のネットワークドライバを使って再インストールを行いました．
これはつまり，Novell クライアントを再インストールする必要があるという
ことです．この方法で問題が起こったら筆者にお知らせください
(この HOWTO が最新版の場合に限ります)．

<!--
<sect1> How are bus-resources to be controlled? <label id="bios_resources">
-->
<sect1> どのようにバスリソースを制御するか? <label id="bios_resources">
<!--
<p> This may involve just deciding how to allocate IRQ and DMA
bus-resources.  If set to "auto", the BIOS will do the allocation.  If set
to manual, you manually reserve some IRQ's for use on "legacy"
(non-pnp) cards.  The BIOS may or may not otherwise know about your
legacy cards.  The BIOS will only know about your legacy cards if you
ran ICU (or the like) under Windows to tell the BIOS about them.  If
the BIOS knows about them, then try using "auto".  If it doesn't know
about them then manually reserve the IRQ's needed for the legacy ISA
cards and let the rest be for the BIOS PnP to allocate.
-->
<p> この項目は IRQ バスリソースと DMA バスリソースの割り当て方法だけを
決めます．この項目に「auto(自動)」を設定すると，BIOS が割り当てを行います．
「マニュアル(手動)」を設定すると，ユーザの入力によって
「レガシー(legacy)」(非 PnP) カードのための IRQ をいくつか予約すること
ができます．指定を行わなければ，カードがレガシーカードであるかどうかは 
BIOS が認識できることも認識できないこともあります．BIOS がレガシーカー
ドの情報を知ることができるのは，ユーザが Windows 上で ICU(または同様の
もの)を実行して BIOS にその情報を与えている場合だけです．BIOS がこれを
知っていれば "auto" を試してください．知らなければ，レガシー ISA カー
ド用の IRQ は手動で予約し，残りの IRQ を BIOS の PnP で 割り当てるよう
にします．

<!--
<sect1> Reset the configuration? <label id="bios_reset">
-->
<sect1> 設定をリセットするか? <label id="bios_reset">
<!--
<p> This will erase the BIOSs ESCD data-base of how your PnP devices
should be configured as well as the list of how legacy (non-PnP)
devices are configured.  Never do this unless you are convinced that
this data-base is wrong and needs to be remade.  It was stated
somewhere that you should do this only if you can't get your computer
to boot.  If the BIOS loses the data on legacy devices, then you'll
need to run ICA again under DOS/Windows to reestablish this data.
-->
<p> この項目はPnP デバイスの設定に関する BIOS の ESCD データベースを消
去します．さらに，レガシー(非 ISA)のデバイスの設定に関するリストも消去
します．データベースが間違っていて，作り直す必要があると確信している場
合でなければ，消去を行ってはいけません．消去を行うのは，ユーザがコンピュー
タを起動できない場合に限る，と何かに書いてあったと思います．BIOS がレ
ガシーデバイスのデータを失くした場合には，ユーザが Windows で ICA を実
行してこのデータを作り直す必要があるでしょう．

<!--
<sect> How to Deal with PnP Cards
-->
<sect> PnP カードの扱い方
<!--
<sect1> Introduction to Dealing with PnP Cards
-->
<sect1> PnP カードを扱うにあたって
<!--
<p> Today most all new internal boards (cards) are Plug-and-Play
(PnP).  Although some software exists in Linux to handle PnP, it is
not always easy to use.  There are 6 different methods listed below to
cope with PnP (but some may not be feasible in your situation).  Which
one(s) you should use depends on your goals.  What may be most
expedient to do now may not be the easiest and best in the long run.
A seemingly simple way is to do nothing and just let a PnP-BIOS
configure it but then you may need to do some exploring to to find out
what the BIOS has done.  A comparison of these methods needs to be
written by someone who has tried them all.  You may need to use more
than one method to do the job.
-->
<p> 現在は新しい内蔵ボード(カード)のほとんど全てがプラグ&amp;プレイ
(PnP)です．Linux にも PnP を扱うソフトウェアはあるのですが，これは必ず
しも使いやすいとは言えません．PnP とうまく共存するための方法を以下に 6 
つ示します(状況によっては使えないものもあります)．この中のどれを使う
べきかは目的によって異なります．その場しのぎの方法は，簡単でないかもし
れない上に，長く使えるとも限りません．簡単と思われる方法は，自分では何
もしないで PnP-BIOS に設定を行わせることですが，調査を行わないと BIOS 
が行った設定を調べることができないかもしれません．これらの方法を比較す
るには，誰かが全てを試してそれを文章にする必要があります．作業を行うに
あたって複数の方法を使う必要があるかもしれません．

<itemize>
<!--
<item> <ref id="disable_pnp" name="Disable PnP">  by jumpers or
 DOS/Windows software (but many cards can't do this) 
-->
<item><ref id="disable_pnp" name="PnP を無効にします">．これには
ジャンパまたは DOS/Windows 用のソフトウェアを使います(これができない
カードも多くあります)．
<!--
<item>  <ref id="bios_conf" name= "BIOS Configures PnP"> (For the PCI bus
 you only need a PCI BIOS, otherwise you need a PnP BIOS)
-->
<item> <ref id="bios_conf" name= "BIOS に PnP を設定します">(PCI バス
の場合に必要なのは PCI BIOS だけです．それ以外の場合には PnP BIOS が必
要となります)．
<!--
<item> <ref id="isapnp_" name="Isapnp"> is a program you can always 
 use to configure PnP devices on the ISA bus only
-->
<item> <ref id="isapnp_" name="isapnp"> は ISA バス専用ではありますが，
必ず PnP デバイスを設定できるプログラムです．
<!--
<item> <ref id="pciutils_" name="PCI Utilities"> is for configuring the PCI
 bus
-->
<item> <ref id="pciutils_" name="PCI Utilities"> は PCI バスを設定する
ためのユーティリティです．
<!--
<item> <ref id="windows_conf" name="Windows Configures"> and then you
 boot Linux from within Windows/DOS.  Use as a last resort
-->
<item> <ref id="windows_conf" name="Windows を使った設定">を行い，
Windows/DOS 内部から Linux を起動します．最後の手段として使ってくださ
い．
<!--
<item> <ref id="patch_kernel" name="Patch Kernel"> to transform
 Linux into a PnP operating system
-->
<item> <ref id="patch_kernel" name="カーネルにパッチを当て">，Linux を 
PnP オペレーティングシステムに変えます．
<!--
<item> <ref id="dev_d_conf" name="Device Driver Configures"> but few do
-->
<item> <ref id="dev_d_conf" name="デバイスドライバを設定します">．ただ
し，これを行うことはほとんどありません．
</itemize>

<!--
Any of the above will set the bus-resources in the hardware.  But only the
last two should tell device driver what it's done.  Only the last one
definitely tells the driver (since it is the driver).  How the driver
gets informed depends on the driver and you may need to do something to
inform it.  See <ref id="tell_driver_config" name="Tell the Driver the
Configuration">
-->
以上の方法のいずれを使っても，ハードウェア内のバスリソースが設定されるでしょ
う．しかし，行った設定をデバイスドライバに伝えるのは最後の 2 つだけで
す．確実に伝えるのは最後の 1 つだけです(というのも，それ自身がドライバ
だからです)．ドライバに情報がどのようにして伝えられるかはドライバに依
存し，情報を伝えるためにはユーザが何かを行わなければならないこともあり
ます．詳しくは，<ref id="tell_driver_config" name="ドライバに設定を教える">
の章をご覧ください．

<!--
<sect1> Disable PnP ? <label id="disable_pnp">
-->
<sect1> PnP を無効にする <label id="disable_pnp">
<!--
<p> Many devices are PnP only with no option for disabling PnP.  But
for some, you may be able to disable PnP by jumpers or by running a
Windows program that comes with the device (jumperless configuration).
This will avoid the often complicated task of configuring PnP.  Don't
forget to tell the BIOS that these bus-resources are reserved.  There are
also some reasons why you might not want to disable PnP:
-->
<p> 多くのデバイスは PnP 専用であり，PnP を無効にすることはできません．
しかし一部のデバイスでは，ジャンパや(ジャンパ無しの構成の場合には)デバ
イス付属の Windows 用プログラムを使ってこれを無効にすることができます．
これにより，PnP 設定の面倒な作業を回避できることもよくあります．このよ
うなバスリソースが予約されていることを，忘れずに BIOS に設定しましょう．
PnP を無効にしない方がよい理由は他にもいくつかあります:

<enum>
<!--
<item> If you have MS Windows on the same machine, then you may want
 to allow PnP to configure devices differently under Windows from what
 it does under Linux.
-->
<item> 同じマシンに MS Windows がある場合，PnP を使えるようにして 
Windows の設定を Linux とは異なる設定にしたいことがあるかもしれません．
<!--
<item> The range of selection for IRQ numbers (or port addresses) etc.
 may be quite limited unless you use PnP.
-->
<item> PnP を使わないと，IRQ 番号(やポートアドレス)等の選択範囲が大き
く制限されてしまうことがあります．
<!--
<item> You might have a Linux device driver that uses PnP methods to
 search for the device it controls.
-->
<item>制御するデバイスを探すために PnP の手法を用いる Linux のデバイス
ドライバもあります．
<!--
<item> If you need to change the configuration in the future, it may
 be easier to do this if it's PnP (no setting of jumpers or running a
 Dos/Windows program).
-->
<item> 将来的に機器構成を変えることが必要になった場合，
デバイスが PnP ならば変更が楽に行えるかもしれません(ジャンパを設定した
り，DOS/Windows 用のプログラムを実行する必要がありません)．
<!--
<item> You may have (or will have) other PnP devices that need
 configuring so that you'll need to provide for (or learn about) PnP
 anyway.
-->
<item>設定が必要な PnP デバイスがある(または将来手に入る)ので，いずれ
にせよ PnP を使えるようにしておく(あるいはその方法を知っておく)必要が
あるかもしれません．
</enum>
<!--
Once configured as non-PnP devices, they can't be configured by PnP
software or the BIOS (until you move jumpers and/or use the
Dos/Windows configuration software again).
-->
一度非 PnP デバイスとして設定すると，(改めてジャンパで設定を変更するか，
DOS/Windows の設定プログラムを実行しない限り)そのデバイスは PnP 設定
プログラムや BIOS では設定できなくなります．

<!--
<sect1> BIOS Configures PnP <label id="bios_conf">
-->
<sect1> BIOS での PnP 設定 <label id="bios_conf">
<!--
<sect2> Intro to Using the BIOS to Configure PnP
-->
<sect2> BIOS を使って PnP の設定を行うにあたって
<!--
<p> If you have a PnP BIOS, it can configure the hardware.  This means
that your BIOS reads the resource requirements of all devices and
configures them (allocates bus-resources to them).  It is a substitute
for a PnP OS except that the BIOS doesn't match up the drivers with
their devices nor tell the drivers how it has done the configuring.
It should normally use the configuration it has stored in its
non-volatile memory (ESCD).  If it finds a new device or if there's a
conflict, the BIOS should make the necessary changes to the
configuration and will not use exactly what was in the ESCD.
-->
<!--
fujiwara: 4 行目は v0.07 でエンバグした模様
-->
<p> PnP BIOS をお使いならば，この BIOS はハードウェアの設定を行うこと
ができます．つまり，BIOS が全てのデバイスが必要とするリソースを全て読
み込み，これを設定します(バスリソースをデバイスに割り当てます)．これは 
PnP OS の代用となりますが，BIOS はデバイスを設定しない点と，行った設定
をドライバに教えない点が異なります．通常は不揮発性メモリ(ESCD)内に保存
されている設定を使うべきです．新しいデバイスを検出した場合や，リソースが
衝突した場合は，BIOS は必要に応じて設定を変更すべきであり，ESCD 内の
設定をそのまま使ってはいけません．

<!--
Your BIOS must support such configuring but there have been cases
where it doesn't do it correctly or completely.  An advantage of using
the BIOS is that it's simple since in most cases there is nothing to
set up (except to tell the BIOS's CMOS menu it's not a PnP OS).  While
some device drivers may be able to automatically detect what the
BIOS has done, in some cases you'll need to determine it (not always
easy).  See <ref id="current_config" name="What Is My Current
Configuration?"> Another possible advantage is that the BIOS does its
work before Linux starts so that all the bus-resources are ready to be
used (and found) by the device drivers that start up later.
-->
お使いの BIOS はこのような設定をサポートしているはずですが，BIOS が正
しい設定をしないことや不完全な設定をすることがあります．BIOS を使うこと
の利点は単純なことです．というのも，ほとんどの場合設定することがないか
らです(BIOS の CMOS メニューで「PnP OS でない」と設定する点を除きます)．
デバイスドライバによっては BIOS が行った設定を自動的に検出できるものも
ありますが，場合によっては BIOS が行った設定をユーザが調べる必要があり
ます(必ずしも容易ではありません)．詳しくは <ref id="current_config"
name="現在の設定はどうなっているか?"> を参照してください．他に考えられ
る利点としては，BIOS は Linux が起動する前に動作するので，後から起動す
るデバイスドライバが全てのバスリソースが使える(そして検出できる)点が挙
げられます．

<!--
According to MS it's only optional (not required) that a PnP BIOS be
able to PnP-configure the devices (without help from MS Windows).  But
it seems that most of the ones made after 1996 ?? or so can do it.  We
should send them thank-you notes if they do it right.  They configure
both the PCI and ISA buses, but it has been claimed that some older
BIOSs can only do the PCI.  To try to find out more about your BIOS,
look on the Web.  Please don't ask me as I don't have data on this.
The details of the BIOS that you would like to know about may be hard
to find (or not available).  Some BIOSs may have minimal PnP
capabilities and try to turn over the difficult parts of the
configuration task to Window utilities.  If this happens you'll either
have to find another method (such as isapnptools) or try to set up the
ESCD database if the BIOS has one.  See the next section.
-->
MS によると，PnP BIOS がデバイスの PnP 設定を(MS Windows の補助無しに)
行える機能はオプション的なものに過ぎません(必須ではありません)．ですが，
1996 年(??)頃より後に作られた BIOS のほとんどはこれをこの機能を持って
います．これが正しく動作するならば，我々は彼らにお礼のメモを送らなけれ
ばなりません．このような BIOS は PCI バスも ISA バスも設定しますが，一
部の古い BIOS は PCI しか設定できないと言われています．お使いの BIOS 
についてもっと調べたければ WWW を見てください．筆者もこれに関するデー
タを持っているわけではないので，筆者に問い合わせるのはやめてください．
BIOS について読者の皆さんが知りたいと思っているような詳しい情報は入手
が困難(あるいは入手できない)かもしれません．一部の BIOS は最小限の PnP 
機能しか持っておらず，設定作業の難しい部分は Windows のユーティリティ
に任せようとします．これに当てはまった場合には，別の方法(isapnptools 
等)を見つける，あるいは BIOS に ESCD データベースがあればこれを使わな
ければならないでしょう．詳しくは次の章を参照してください．

<!--
<sect2> The BIOS's ESCD Database <label id="escd_">
-->
<sect2> BIOS の ESCD データベース <label id="escd_">
<!--
<p> The BIOS maintains a non-volatile database containing a
PnP-configuration that it will try to use.  It's called the ESCD
(Extended System Configuration Data).  Again, the provision of ESCD is
optional but most PnP-BIOSs have it.  The ESCD not only stores the
resource-configuration of PnP devices but also stores configuration
information of non-PnP devices (and marks them as such) so as to avoid
conflicts.  The ESCD data is usually saved on a chip and remains
intact when the power is off, but sometimes it's kept on a hard-drive??  
-->
<p> BIOS は PnP 設定情報を記録してある不揮発性のデータベース
を管理しています．これは ESCD(Extended System Configuration Data)と呼
ばれます．繰り返しになりますが，ESCD に関する規定はオプション的なもの
ですが，ほとんどの PnP BIOS にはこの機能があります．ESCD は PnP デバイ
スのリソース設定情報を格納するだけではなく，非 PnP デバイスの設定情報
も格納している(非 PnP デバイスであることも記録しています)ので，衝突を
回避することができます．ESCD データは普通チップに保存されるため電源を
落しても消えませんが，ハードディスクにデータを保持するタイプのものもあ
ります(??)．

<!--
The ESCD is intended to hold the last used configuration, but if you
use a program such as Linux's isapnp or pci utilities (which doesn't
update the ESCD) then the ESCD will not know about this and will not
save this configuration in the ESCD.  A good PnP OS might update the
ESCD so you can use it later on for a non-PnP OS (like standard
Linux).  MS Windows does this only in special cases.  See <ref
id="W9x_ESCD" name="Using Windows to set ESCD">.
-->
ESCD は前回使った設定を保持するためのものですが，Linux の isapnp や 
PCI Utilities のような(ESCD を更新しない)プログラムを使った場合には，
ESCD はこのようなプログラムを知らないため，この設定は ESCD 内に保存さ
れません．出来の良い PnP OS は ESCD を更新するので，後で(標準の Linux 
のような)非 PnP の OS で設定を使うことができます．
Windows は特殊な場合だけこれを行います．
<ref id="W9x_ESCD" name="Windows を用いた ESCD の設定">
を参照してください．

<!--
To use what's set in ESCD be sure you've set "Not a PnP OS" or the
like in the BIOS's CMOS.  Then each time the BIOS starts up (before
the Linux OS is loaded) it should configure things this way.  If the
BIOS detects a new PnP card which is not in the ESCD, then it must
allocate bus-resources to the card and update the ESCD.  It may even
have to change the bus-resources assigned to existing PnP cards and
modify the ESCD accordingly. 
-->
ESCD に設定されている情報を用いるには，必ず BIOS の CMOS で "Not a PnP OS"
あるいは同様の設定を行ってください．BIOS が起動する度に(Linux OS が
ロードされる前)，BIOS は ESCD を使って設定を行うはずです．BIOS が ESCD 
に記録されていない新しい PnP カードを検出すると，BIOS はそのカードに
バスリソースを割り当ててから ESCD を更新しなければなりません．既存の 
PnP カードに割り当てているバスリソースを変更し，それに伴って ESCD を
修正しなければならないこともあります．

<!--
If each device saved its last configuration in its hardware, hardware
configuring wouldn't be needed each time you start your PC.  But it
doesn't work this way.  So all the ESCD data needs to be kept correct
if you use the BIOS for PnP.  There are some BIOSs that don't have an
ESCD but do have some non-volatile memory to store info on which
bus-resources have been reserved for use by non-PnP cards.  Many BIOSs
have both.
-->
それぞれのデバイスが前回の設定をハードウェアに保存しているならば，PC 
を起動する度にハードウェアの設定を行う必要はありません．しかし実際の
動作はそうではありません．したがって，BIOSを PnP で使っている場合には
全ての ESCD データは常に正しい状態に保たなければなりません．ESCD を持っ
ていない BIOS もいくつかありますが，このような BIOS も不揮発メモリをい
くらか持っており，非 PnP カードが使うために予約しているバスリソースを
格納できます．BIOS の多くはこれをどちらも持っています．

<!--
<sect2> Using Windows to set the ESCD  <label id="W9x_ESCD">
-->
<sect2> Windows を用いた ESCD の設定 <label id="W9x_ESCD">
<!--
<p> If the BIOS doesn't set up the ESCD the way you want it (or the
way it should be) then it would be nice to have a Linux utility to
set the ESCD.  As of early 1999 there isn't any.  Thus one may resort to
attempting to use Windows (if you have it on the same PC) to do this.
-->
<p> BIOS が行うESCD の設定がユーザの希望通りでない(または，あるべき設
定が行われない)場合には，Linux 用のユーティリティを使って ESCD を設定
できれば良いのにと思うことでしょう．1999 初めの時点では，このようなツー
ルは全くありません．したがって，これを行う最後の手段として Windows を
使うことになるでしょう(同じ PC に Windows が入っている場合には)．

<!--
There are three ways to use Windows to try to set/modify the ESCD.  One
way is to use the ICU utility designed for DOS or Windows 3.x.  It
should also work OK for Windows 9x/2k ??  Another way is to set up
devices manually ("forced") under Windows 9x/2k so that Windows will
put this info into the ESCD when Windows is shut down normally.  The
third way is only for legacy devices that are not plug-and-play.  If
Windows knows about them and what bus-resources they use, then Windows
should put this info into the ESCD.
-->
Windows に ESCD を設定または修正させる方法は 3 つあります．最初の方法
は，DOS または Windows 3.x 用に作られた ICU ユーティリティを使う
ことです．これは Windows 9x/2k でも動くはずです(??)．二番目の方法は，
Windows 9x/2k 上で手動で(「強制的な」)設定を行い，Windows の正常終了時
にこの情報を ESCD に保存させる方法です．三番目の方法はプラグ&amp;プレイ
でないレガシーデバイスでしか使えません．Windows がこのようなデバイスの
存在と使用しているバスリソースを知っていれば，Windows はこの情報を 
ESCD に格納するはずです．

<!--
If PnP devices are configured automatically by Windows without the
user "forcing" it to change settings, then such settings probably will
not make it into the ESCD.  Of course Windows may well decide on its
own to configure the same as what is set in the ESCD so they could
wind up being the same by coincidence.
-->
Windows がデバイスの設定を自動的に行っており，ユーザが「強制的に」設定
を変えていなければ，このような設定はおそらく ESCD には反映されないでしょう．
もちろん，Windows は自分自身の設定を ESCD に保存されている設定に合わせ
ることがあるので，結果的にはたまたま一致することもあります．

<!--
Windows 9x are PnP operating systems and automatically PnP-configure
devices.  They maintain their own PnP-database deep down in the
Registry (stored in binary Windows files).  There is also a lot of
other configuration stuff in the Registry besides PnP-bus-resources.
There is both a current PnP resource configuration in memory and
another (perhaps about the same) stored on the hard disk.  To look at
(the one in memory?) this indirectly in Windows98 or to force changes
you use the Device Manager.
-->
Windows9x は PnP オペレーティングシステムであり，自動的にデバイスの 
PnP 設定を行います．Windows はレジストリ(これはバイナリである Windows 
ファイル群に格納されています)の奥底で PnP データベースを管理しています．
PnP バスリソースの他にもたくさんの設定情報がレジストリに入っています．
PnP バスリソースは，現在メモリに記憶されているものと(たぶんほとんど同じで
すが)ハードディスクに格納されているものとどちらもあります．Windows98 
で PnP バスリソース(メモリに保持している方?)を間接的に見たり，強制的な
変更を行うには，デバイスマネージャを使います．

<!--O
In Windows98 There are 2 ways to get to the Device Manager: 1. My
Computer -/-&gt; Control Panel -/-&gt; System Properties -/-&gt; Device Manager.
2. (right-click) My Computer -/-&gt; Properties -/-&gt; Device Manager.  Then
in Device Manager you select a device (sometimes a multi-step process
if there are a few devices of the same class).  Then click on
Properties and then on Resources.  To attempt to change the resource
configuration manually, uncheck "Use automatic settings" and then
click on  "Change Settings".  Now try to change the setting, but it
may not let you change it.  If it does let you, you have "forced" a
change.  A message should inform you that it's being forced.  If you
want to keep the existing setting shown by Windows but make it
"forced" then you will have to force a change to something else and
then force it back to its original setting.
-->
Windows98 でデバイスマネージャを呼び出す方法は 2 通りあります:
<itemize>
<item>(1) マイコンピュータ --&gt; コントロールパネル --&gt; システムのプロパティ --&gt; デバイスマネージャ
<item>(2) マイコンピュータ(右クリック) --&gt; プロパティ --&gt; デバイスマネージャ
</itemize>
それからデバイスマネージャ内でデバイスを選択します(同じクラスのデバイ
スが複数個ある場合には複数ステップの操作になることがあります)．次に
「プロパティ」，「リソース」を順にクリックします．リソース設定を手動
で変更するつもりならば，「自動設定を使用する」のチェックを外し，
それから「設定の変更」をクリックします．それから設定の変更を行いますが，
設定を変更できないこともあります．変更できれば，変更を「強制」できたこ
とになります．設定が強制されたことを示すメッセージが表示されるはずです．
Windows が示した既存の設定を使い続けたいのに「強制的に」変えてしまった
場合には，一旦何か他の設定にしておいてから元の設定に戻さなければなりま
せん．

<!--O
To see what has been "forced" under Windows98 look at the "forced
hardware" list: Start --> Programs --> Accessories --> System Tools
--> System Information --> Hardware Resources --> Forced Hardware.
When you "force" a change of bus-resources in Windows, it should put
your change into the ESCD (provided you exit Windows normally).
From the "System Information" window you may also inspect how IRQs and
IO ports have been allocated under Windows.
-->
Windows98 においてどんな設定が「強制」されているか調べるには次の操作を
行います: スタート --&gt; プログラム --&gt; アクセサリ --&gt;
システムツール --&gt; システム情報 --&gt; ハードウェアリソース --&gt;
強制設定されたハードウェア．
Windows でバスリソースを「強制的」に変えた場合には，その変更を
ESCD に保存しなければなりません(Windows を正常終了させればそうなります)．
「システム情報」ウィンドウを見ると，Windows 上で IRQ と I/O ポートがど
のように割り当てられているかを調べることができます．

<!--O
Even if Windows shows no conflict of bus-resources, there may be a
conflict under Linux.  That's because Windows may assign bus-resources
differently than the ESCD does.  In the the rare case where all
devices under Windows are either legacy devices or have been "forced",
then Windows and the ESCD configurations should be identical.
-->
Windows でバスリソースの衝突が起こらなくても，Linux で衝突が起こること
があります．その理由は，Windows は ESCD と異なる方法でバスリソースを割
り当てることがあるからです．滅多にないケースですが，Windows 上の全ての
デバイスがレガシーデバイスであるか，設定が「強制」されている場合には，
Windows と ESCD の設定は全く同じになるはずです．

<!--
<sect2> Adding a New Device (under Linux or Windows)
-->
<sect2> 新しいデバイスの追加 (Linux または Windows において)
<!--
<p> If you add a new PnP device and have the BIOS set to "not a PnP
OS", then the BIOS should automatically configure it and store the
configuration in ESCD.  If it's a non-PnP legacy device (or one made
that way by jumpers, etc.) then there are a few options to handle it.
-->
<p> 新しい PnP デバイスが追加され，かつ BIOS の設定が「PnP OS でない」
である場合，PnP BIOS は自動的にデバイスの設定を行って，その設定を ESCD 
に格納しなければなりません．非 PnP のレガシーデバイス(またはジャンパ等
で PnP を無効にしたデバイス)の場合には，これを処理するためのオプション
がいくつかあります．

<!--
You may be able to tell the BIOS directly (via the CMOS setup menus)
that certain bus-resources it uses (such as IRQs) are reserved and are not
to be allocated by PnP.  This does not put this info into the ESCD.
But there may be a BIOS menu selection as to whether or not to have
these CMOS choices override what may be in the ESCD in case of
conflict.  Another method is to run ICU under DOS/Windows.  Still
another is to install it manually under Windows 9x/2k and then make
sure its configuration is "forced" (see the previous section).  If
it's "forced" Windows should update the ESCD when you shut down the
PC.  
-->
特定のバスリソース(IRQ 等)が予約されていて，PnP で割り当ててはならないこと
を(CMOS 設定メニューを使って)直接 BIOS に指定することもできます．BIOS 
がこの情報を ESCD に記録することはありません．しかし，衝突が起きた場合
に，あらかじめ選択してあった CMOS の設定で ESCD の設定を上書きするかど
うかを BIOS のメニューで選択できるようになっているかもしれません．別の
方法としては，DOS または Windows で ICU を実行する方法があります．さら
に別の方法として，ICU を Windows9x/2k に手動でインストールして，
その設定を「強制」する(前節を参照)方法もあります．設定が「強制」される
と，Windows は PC がシャットダウンされる時に ESCD を更新するはずです．

<!--
<sect1> Isapnp (part of isapnptools) <label id="isapnp_">
-->
<sect1> isapnp (isapnptools の一部) <label id="isapnp_">
<!--
<p> Unfortunately, much of the documentation for isapnp is still
difficult to understand unless you know the basics of PnP.  This HOWTO
should help you understand it as well the FAQ that comes with it.
<tt/isapnp/ is only for PnP devices on the ISA bus (non-PCI).  Running
the Linux program "isapnp" at boot-time will configure such devices to
the resource values specified in /etc/isapnp.conf.  Its possible to
create this configuration file automatically but you then must edit it
manually to choose between various options.  With isapnp, a device
driver which is part of the kernel may run too early before isapnp has
set the address, etc. in the hardware.  This results in the device
driver not being able to find the device.  The driver tries the right
address but the address hasn't been set yet in the hardware.
-->
<p> 残念ながら，PnP の基礎を知らない人には， isapnp についてのたくさん
の文書の内容は分かりにくいでしょう．そこで本 HOWTO では，isapnp 付属の 
FAQ と同様に <tt/isapnp/ の理解を助けるための説明を行います．
<tt/isapnp/ が使えるのは ISA バス 上の PnP デバイスだけです(PCI バスで
は使えません)．Linux の起動時に "isapnp" プログラムを実行すると，
/etc/isapnp.conf ファイルで指定されたリソース値が PnP デバイスに設定され
ます．この設定ファイルは自動的に作ることができますが，各種オプションを
設定するには手で編集しなければなりません．isapnp を使う場合，カーネル
の一部であるデバイスドライバは isapnp がアドレス等をハードウェアに設定
するよりもずっと前に実行されます．結果として，デバイスドライバはデバイ
スを見つけることができません．ドライバが正しいアドレスにアクセスしよう
としても，そのアドレスがまだハードウェアに設定されていないからです．

<!--
If your Linux distribution automatically installed isapnptools, isapnp
may already be running at startup.  In this case, all you need to do
is to edit /etc/isapnp.conf per "<tt/man isapnp.conf/".  Note that
this is like manually configuring PnP since you make the decisions as
to how to configure as you edit the configuration file.  You can use

the program "pnpdump" to help create the configuration file.  It
almost creates a configuration file for you but you must skillfully
edit it a little before using it.  It contains some comments to help
you edit it.  If you use "isapnp" for configuring and have a PnP BIOS,
you should probably tell the BIOS (when you set it up) that you don't
have a PnP OS since you may want the BIOS to configure the PCI
devices.  While the BIOS may also configure the ISA devices, isapnp
will redo it.
-->
お使いのディストリビューションが isapnptools を自動的にインストールし
ている場合には，isapnp はシステム起動時に既に実行されているかもしれま
せん．この場合にすべきなのは，"<tt/man isapnp.conf/" の出力を見ながら
/etc/isapnp.conf を編集することだけです．ただし，この作業は手動で
PnP を設定することとあまり変わらない点に注意してください．というのも，
ユーザはどのような設定にするかを決めてから設定ファイルを編集しなければ
ならないからです．設定ファイルを編集するには，"pnpdump" プログラムが
便利です．このプログラムは設定ファイルをだいたい作ってくれますが，この
設定を使う前にはうまく編集してやらなければなりません．このファイルには
編集の参考になるコメントが含まれています．"isapnp" を設定に用い，かつ 
PnP BIOS がある場合には，BIOS には(設定時に)「PnP OS を持っていない」
と指定しなければなりません．なぜなら，この場合にも PCI デバイスの設定
を BIOS に行わせたいからです．BIOS が ISA デバイスの設定も行うかもしれ
ませんが，isapnp はそれを更に再設定します．

<!--O
The terminology used in the /etc/isapnp.conf file may seem odd at
first.  For example for an I0 address of 0x3e8 you might see "(IO 0
(BASE 0x3e8))" instead.  The "IO 0" means this is the first (0th) IO
address-range that this device uses.   Another way to express all this
would be: "IO[0] = 0x3e8" but isapnp doesn't do it this way.  "IO 1"
would mean that this is the second IO address range used by this
device, etc.  "INT 0" has a similar meaning but for IRQs (interrupts).
A single card may contain several physical devices but the above
explanation was for just one of these devices.
-->
最初のうちは /etc/isapnp.conf で使われている用語が変に思われるかもしれ
ません．例えば，I/O アドレス 0x3e8 を表すのに，"(IO 0 (BASE 0x3e8))" 
となっていたりします．"IO 0" というのは，これがデバイスが使う最初の
(0 番目の) I/O アドレス領域という意味です．これを表す別の方法として
は "IO[0] = 0x3e8" がありますが，isapnp はこの方法は使いません．
"IO 1" は，これがこのデバイスが使う 2 番目の I/O アドレス領域という意
味です．以下も同様です．"INT 0" も同様の意味ですが，IRQ(割り込み)に対
して用います．1 つのカードが複数の物理デバイスを持つことがありますが，
上記の説明はこれらのデバイスのうち 1 つにしか当てはまりません．

<!--
<sect1> PCI Utilities  <label id="pciutils_">
-->
<sect1> PCI Utilities  <label id="pciutils_">
<!--
<p> The new package PCI Utilities (= pciutils, incorrectly called
"pcitools"), should let you manually PnP-configure the PCI bus.
"lspci" lists bus-resources while "setpci" sets resource allocations
in the hardware devices.  It appears that setpci is mainly intended
for use in scipts and presently one needs to know the details of the
PCI configuation registers in order to use it.  That's a topic not
explained here nor in the manual page for setpci.
-->
<p> 新しいパッケージである PCI Utilities (=pciutils, 誤って "pcitools" 
と呼ばれることもあります)は PCI バスの PnP 設定を手動で行えるようにしま
す．"lspci" はバスリソースをリスト表示し，"setpci" はハードウェアデバイ
スのリソース割り当てを設定します．setpci は主にスクリプトで使われること
を想定しているようです．現時点でこれを利用するには PCI 設定レジスタを詳
細に理解している必要がありますがその点に関しては，このドキュメントや 
setpci のマニュアルでは詳しく説明されていません．

<!--
<sect1> Patch the Kernel to Make Linux PnP <label id="patch_kernel">
-->
<sect1> カーネルにパッチを当てて Linux を PnP 対応にする <label id="patch_kernel">
<!--O
<p> David Howells has created a patch to do this called "Linux Kernel
Configuration/Resource Manager" (sometimes called Hardware
Configuration Manager).  In late 1999 the patch was not available at
his website.  This may mean there is no patch available for recent
versions of the kernel.
-->
<p> David Howells さんは "Linux Kernel Configuration/Resource Manager" 
と呼ばれる，Linux カーネルを PnP 対応にするためのパッチを作成しました
("Hardware Configuration Manager" と呼ばれることもあります)．1999 年末
の時点では，このパッチを彼のページから入手することはできません．つまり，
最近のバージョンのカーネルに対して使えるパッチはないということです．

<!--O
For previous patches the resulting kernel was claimed to be stable
but bugs have been reported.  The patch included documentation such as
serial.txt to show how to deal with the serial port.  It provided
"files" in the /proc tree so that you can see what is going on and can
echo commands into one of these files for custom configuration.  One
problem is that most device drivers don't know about it so that you
still had to use the traditional configuration files, etc. for
configuration.  The webpage for it is <url
url="http://www.astarte.free-online.co.uk">
-->
前のパッチについては，パッチを当てて得られるカーネルは安定していると作
者が主張していましたが，バグがいくつか報告されています．このパッチには，
シリアルポートの扱い方を説明する
serial.txt 等の文書が付いています．このパッチを当てると /proc ディレク
トリに「ファイル」が作られます．これらのファイルで現在の状況が調べられ
ますし，これらのファイルにコマンドを送ることによって設定を変えることも
できます．ただし問題が 1 つあります．デバイスドライバの多くはこのパッ
チを想定していないので，設定を行うためには今まで通りの設定ファイル等を
使わなければならないことがあるのです．このパッチの WWW ページは
<url url="http://www.astarte.free-online.co.uk"> です．

<!--
<sect1> Windows Configures  <label id="windows_conf">
-->
<sect1> Windows による設定  <label id="windows_conf">
<!--
<p> If you have Windows9x (or 2k) on the same PC, then just start
Windows and let it configure PnP.  Then start Linux from Windows (or
DOS).  It has been reported that Windows erased the IRQs from PCI
devices registers.  Then Linux complained that it found a zero IRQ.
Thus you may not be able to use this method.
-->
<p> Windows9x (または Windows 2k)が Linux と同じ PC に入っていれば，単
に Windows を起動して PnP を設定してください．その後，Windows(または 
DOS)から Linux を起動します．Windows が PCI デバイスレジスタから IRQ 
を消してしまうことが報告されています．この場合には Linux は 0 である IRQ 
が検出されたとエラーを出します．したがって，この方法は使えないかもしれ
ません．

<!--
<sect1> Device Driver Configures <label id="dev_d_conf">
-->
<sect1> デバイスドライバによる設定 <label id="dev_d_conf">
<!--
<p> A few device drivers will use PnP methods to set the bus-resources in
the hardware but only for the device that they control.  Since the
driver has done the configuring, it obviously knows the configuration
and there is no need for you to tell it this info.
-->
<p> いくつかのドライバは，PnP の手法を使ってハードウェア内にバスリソースを
設定しますが，これはそのドライバが制御するデバイスに対してだけです．
ドライバが設定を終えて以降は，ドライバは明らかに設定を知っているので，
ユーザはこの情報をドライバに教える必要はありません．

<!--
The problem with this is twofold.  It's difficult to incorporate all
of this into the driver, and the driver may grab bus-resources that are
needed by other devices.  It does make it easy for the user but a PnP
Linux kernel might be better.  See <ref id="linux_needs_PnP"
name="Linux Needs to Cope Better with PnP">.
-->
この方法に伴う問題は設定の重複です．この情報の全てをドライバに組み込む
のは困難であり，ドライバは他のデバイスが必要としているバスリソースを押えて
しまうかもしれません．これによりユーザの設定は簡単になるでしょうが，
PnP 対応 Linux カーネルを使う方がもっと良いでしょう．詳しくは
<ref id="linux_needs_PnP" name="Linux で PnP をうまくやっていくことの必要性">
をご覧ください．

<!--
<sect1> PnP Software/Documents  <label id="sw_and_docs">
-->
<sect1> PnP に関連するソフトウェアと文書 <label id="sw_and_docs">
<p>
<itemize>
<!--
<item><url url="http://www.roestock.demon.co.uk/isapnptools/"
 name="Isapnptools homepage">
-->
<item><url url="http://www.roestock.demon.com.uk/isapnptools/"
 name="isapnptools のホームページ">
<!--
<item><url url="http://www.astarte.free-online.co.uk" name="Patch to
 make the Linux kernel PnP">
-->
<item><url url="http://www.astarte.free-online.co.uk"
name="Linux カーネルを PnP 対応にするパッチ">
<!--
<item> <url url="http://www.io.com/~cdb/mirrors/lpsg/pnp-linux.html"
name="PnP driver project">
-->
<item> <url url="http://www.io.com/~cdb/mirrors/lpsg/pnp-linux.html"
name="PnP ドライバプロジェクト">
<!--
<item <url url="http://www.microsoft.com/hwdev/respec/pnpspecs.htm"
 name="PnP Specs. from Microsoft">
-->
<item <url url="http://www.microsoft.com/hwdev/respec/pnpspecs.htm"
 name="Microsoft による PnP の仕様">
<!--
<item> Book: PCI System Architecture, 3rd ed. by Tom Shanley +,
 MindShare 1995.  Covers PnP-like features on the PCI bus.
-->
<item> 書籍: PCI System Architecture, 3rd ed., 著者 Tom Shanley 他,
 MindShare, 1995年．PCI バスが持っている PnP 的な機能の説明があります．
<!--
<item> <label id="pnp_book"> Book: Plug and Play System Architecture,
 by Tom Shanley, Mind Share 1995.  Details of PnP on the ISA bus.  Only
 a terse overview of PnP on the PCI bus.
-->
<item> <label id="pnp_book"> 書籍: Plug and Play System Architecture, 
 著者 Tom Shanley, MindShare, 1995年．ISA バスでの PnP についての詳し
 い解説があります．PCI バスでの PnP については概要しか書かれていません．
<!-- 
<item> Book: Programming Plug and Play, by James Kelsey, Sams 1995.
 Details of programming to communicate with a PnP BIOS.  Covers ISA,
 PCI, and PCMCIA buses.
-->
<item> 書籍: Programming Plug and Play, 
 著者 James Kelsey, 1995年．PnP BIOS での通信を行なうプログラミングにつ
 いての詳しい解説があります．ISA, PCI, PCMCIA バスをカバーしています。
</itemize>


<!--
<sect> Tell the Driver the Configuration <label id="tell_driver_config">
-->
<sect> ドライバに設定を教える <label id="tell_driver_config">
<!--
<sect1> Introduction
-->
<sect1> はじめに
<!--
<p> Just how this is done depends upon the driver.  Some drivers have
more than one way to find out how their physical device is configured.
At one extreme is the case where you must hard-code the bus-resources into
the kernel and recompile.  At the other extreme, the driver does
everything automatically and you have nothing to do.  It may even set
the bus-resources in the hardware using PnP methods.
-->
<p>これを行う方法は完全にドライバに依存します．ドライバによっては
物理デバイスがどのように設定されたのかを調べる方法を複数個持っています．
最も極端なケースでは，バスリソースをカーネルにハードコーディングして再コン
パイルを行わなければなりません．その対極のケースでは，設定は全て自動的
に行われ，ユーザは何もする必要がありません．ハードウェアへのバスリソース設
定でさえも PnP の仕組みを使って行われます．

<!--
In the middle are cases where you run a program to give the resource
info to the driver or put the info in a file.  In some cases the
driver may probe for the device at addresses where it suspects the
device resides.  It may then try to test various IRQs to see which one
works.   It may or may not automatically do this.  In other cases the
driver may use PnP methods to find the device and how the bus-resources
have been set, but will not actually set them.  It may also look in
some of the files in the /proc directory.
-->
この中間のケースは，リソース情報をドライバに与えたり，ファイルに設定し
たりする場合です．場合によっては，デバイスがありそうなアドレスに対して
ドライバが探査を行うこともあります．それから様々な IRQ を調べ，どの 
IRQ が使えるかを調べようとします．これは自動で行われる場合も行われない
場合もあります．この他に，ドライバが PnP の仕組みを使ってデバイスの存
在とバスリソースの設定を調べることがありますが，
実際の設定は行われません．この情報は /proc ディレクトリ内のいくつかの
ファイルにも現われます．

<!--
One may need to give the bus-resources as a parameter to the kernel to to
a loadable module.  See /usr/lib/modules_help/descr.gz for a list of
possible parameters.  The module to load is listed in /etc/modules
along with its parameters.  In some other case the bus-resources may be
given as parameters to the kernel.  These are put into the lilo.conf
file as append="...".   Then the lilo program must be run to save this
in the kernel boot code.
-->
バスリソースをカーネルやローダブルモジュールにパラメータとして与える必要が
あることもあります．指定可能なパラメータについては
/usr/lib/modules_help/descr.gz をご覧ください．ロードされるモジュール
は，/etc/modules にパラメータ付きで列挙されています．場合によっては，
バスリソースはパラメータとしてカーネルに与えられることがあります．パラメー
タは lilo.conf ファイルに append="..." という形で指定します．このファ
イルを編集した後には，設定をカーネルのブートコードに保存するために 
lilo を実行しなければなりません．

<!--
While there is great non-uniformity about how drivers find out about
bus-resources, the end goal is the same.  There are so many different
hardware devices and drivers for them that you may need to look at
documentation for your driver to find out how it finds out about
bus-resources and what you need to do to insure that it gets the info it
needs.  Some brief info on a few drivers is presented in the following
section.
-->
ドライバがバスリソースを見つけるための方法は全くバラバラですが，最終的
な目的は同じです．ハードウェアとそれに対応するドライバは非常にたくさん
あるので，ドライバがバスリソースを見つける方法とドライバが必要とする情報を
確実に入手するためになすべきことについては，ドライバ付属の文書を見る必
要があるでしょう．いくつかのドライバに関する簡単な情報を以下の節で説明
します．

<!--
<sect1> Serial Port Driver: setserial
-->
<sect1> シリアルポートドライバ: setserial
<!--
<p> For the standard serial port driver (not for multiport cards) you
use setserial to configure the driver.  It is often run from a
start-up file.  In newer versions there is a /etc/serial.conf file
that you "edit" by simply using the setserial command in the normal
way and what you set using <tt/setserial/ is saved in the
<tt>serial.conf</tt> configuration file.  The <tt>serial.conf</tt>
file should be consulted when the <tt/setserial/ command runs from a
start-up file.  Your distribution may or may not set this up for you.
-->
<p> 標準のシリアルポートドライバ(マルチポートカードを除く)に対しては，
setserial を使ってドライバの設定を行います．setserial は多くの場合，起
動ファイルから実行します．新しいバージョンの setserial は 
/etc/serial.conf ファイルを使います．このファイルは seetserial コマン
ドをただ普通に使うことによって「編集」され，<tt/setserial/ を使って設
定した内容が設定ファイル <tt/setserial/ に保存されます．
<tt>serial.conf</tt> ファイルは，<tt/setserial/ コマンドが起動ファイル
から実行された時に参照されるはずです．このような設定になっているかどう
かはディストリビューションによって違うかもしれません．

<!--
There are two different ways to use <tt/setserial/ depending on the options
you give it.  One way is used to manually tell the driver the
configuration.  The other way is to probe at a given address and
report if a serial port exists there.  It can also probe this address
and try to detect what IRQ is used for this port.  The driver runs
something like <tt/setserial/ at start-up but it doesn't probe for
IRQs, it just assigns the "standard" IRQ which may be wrong.  It does
probe for the existence of a port.  See Serial-HOWTO for more details.
-->
<tt/setserial/ コマンドは与えるオプションによって，異なる 2 通りの使い
方ができます．使い方の一つは手動でドライバに設定を教えることです．もう
一つの使い方は，指定されたアドレスを探査し，そこにシリアルポートがある
かどうかを報告することです．このアドレスを探査し，このポートに対してど
の IRQ が使われているかの検出を試みることもできます．ドライバは起動時
に <tt/setserial/ に似たものを実行しますが，IRQ の探査は行わず，誤って
いるかもしれない「標準」の IRQ を割り当てるだけです．ドライバはポート
が存在するかどうかの探査は行います．詳しくは Serial-HOWTO をご覧くださ
い(訳注: JF に日本語訳があります)．

<!--
<sect1> Sound Card Drivers
-->
<sect1> サウンドカードドライバ

<!--
<sect2> OSS-Lite
-->
<sect2> OSS-Lite
<!--
<p> You must give the IO, IRQ, and DMA as parameters to a module
or compile them into the kernel.  But some PCI cards will get
automatically detected (likely by using the lspci command or the like).
RedHat supplies a program "sndconfig" which detects ISA PnP cards and
automatically sets up the modules for loading with the detected
bus-resources.
-->
<p>I/O アドレス，IRQ, DMA チャネルをパラメータとしてモジュールに与える
か，カーネルに組み込まなければなりません．しかし，一部の PCI カードは
自動的に検出されます(多分，lspci コマンド等を使うことによって行われるでしょ
う)．RedHat には "sndconfig" というプログラムが用意されています．この
プログラムは ISA PnP カードを検出し，検出されたバスリソースを使ってモジュー
ルのロードの設定を行います．

<!--
<sect2> OSS (Open Sound System) and ALSA
-->
<sect2> OSS (Open Sound System) と ALSA
<!--
<p> These will detect the card by PnP methods and then select the
appropriate driver and load it.  It will also set the bus-resources on an
ISA-PnP card.  You may need to manually intervene to avoid conflicts.
For the ALSA driver, support for ISA-PnP is optional and you may use
isapnp tools if you want to.
-->
<p> これらは PnP の仕組みを使ってカードを検出し，適切なドライバの選択
とロードを行います．ISA PnP カードへのリソースの設定も行われます．バスリソー
スの衝突を避けるために手動で調整を行う必要があるかもしれません．ALSA 
ドライバの場合には，ISA PnP の機能は省くことが可能で，希望によっては 
isapnptools を使うこともできます．

<!--
<sect> What Is My Current Configuration? <label id="current_config">
-->
<sect> 現在の設定を知るには? <label id="current_config">
<!--
<p> Here "configuration" means the assignment of PnP bus-resources
(addresses, IRQs, and DMAs).  There are two parts to this question for
each device.  Each part should have the same answer.
-->
<p> ここでの「設定」とは PnP バスリソース(アドレス，IRQ, DMA)の割り当ての
ことです．「デバイスがどのような設定になっているか？」という問いは，デ
バイスとデバイスドライバの両方への問いです．それぞれは同じ答となるはず
です．
<enum>
<!--
<item> What is the configuration of the device driver software?
 I.e.: What does the driver think the hardware configuration is?
-->
<item> デバイスドライバのソフトウェアの設定はどうなっているか?
(つまり，ドライバはハードウェア設定がどうなっていると考えているのか?)
<!--
<item> What configuration (if any) is set in the device hardware?
-->
<item> デバイス自体にはどんな設定がされているのか?
</enum>

<!--
Of course the configuration of the device hardware and its driver
should be the same (and it normally is).  But if things are not
working right, there may be a difference.  This means the the driver
has incorrect information about the actual configuration of the
hardware.  This spells trouble.  If the software you use doesn't
adequately tell you what's wrong (or automatically configure it
correctly) then you need to investigate how your hardware devices and
their drivers are configured.  While Linux device drivers should "tell
all" in some cases it's not easy to determine what has been set in the
hardware.
-->
当然，デバイスハードウェアとそのドライバの設定は同じでなければなりませ
ん(そして普通は同じです)．正常に動作しない場合は，どこかに相違があるの
でしょう．つまり，実際のハードウェア設定についてドライバが持っている情
報が誤っているということです．これは問題を起こします．お使いのソフトウェ
アが間違っている点を適切に指摘してくれなければ(または正しい設定にして
くれなければ)，ハードウェアデバイスとそのドライバがどのように設定され
ているのかを調査する必要があります．Linux のデバイスドライバは「全部の
情報を表示する」場合もあるはずですが，ハードウェアの設定を調べるのは簡
単ではないかもしれません．

<!--
Another problem is that when you view configuration messages on the
screen, it's sometimes not clear whether the reported configuration is
that of the device driver, the device hardware, or both.  If the
device driver is assigned a configuration and then checks the hardware
out to see if it's configured the same, then the configuration
reported by the driver should be that of both the hardware and the
driver. 
-->
これとは別の問題もあります．つまり，画面に設定に関するメッセージが表示
された時，これがデバイスドライバの設定なのか，デバイスハードウェアの設
定なのか，あるいはその両方なのかがはっきりしないことがあるという問題で
す．デバイスドライバを設定した後，ハードウェアがこれと同じ設定になって
いるかどうかをデバイスドライバが確認しているならば，ドライバが報告する
設定はハードウェアとドライバ共通の設定になっているはずです．

<!--
But some drivers which don't do this may accept a configuration that
doesn't check out.  For example, "setserial" will accept a
configuration that doesn't check out (even if you've told it to probe
for bus-resources).  Thus "setserial" may only be telling you the
configuration of the driver and not the hardware.
-->
ですがこれを行わない一部のドライバは，自分自身で確認していない設定を
受け付けることがあります．例えば，"setserial" は確認していない設定も受
け付けます(たとえバスリソースを調べるように指示した場合であっても)．このよ
うに，"setserial" が表示するのはドライバの設定だけであり，ハードウェアの
設定は表示しません．

<!--O
<sect1> Boot-time Messages <label id="boot_time_msgs">
<p>Some info on configuration may be obtained by reading the messages
from the BIOS and Linux that appear on the screen when you first start
the computer.  These messages often flash by too fast to read but once
they stop type Shift-PageUp a few times to scroll back to them.  To
scroll forward thru them type Shift-PageDown.  Typing "dmesg" at any
time to the shell prompt will show only the Linux kernel messages and
miss some of the most important ones (including ones from the BIOS).
The messages from Linux may sometimes only show what the device driver
thinks the configuration is, perhaps as told it via an incorrect
configuration file.  
-->
<sect1> 起動時のメッセージ <label id="boot_time_msgs">
<p>
設定情報の一部は，コンピュータを起動した時の BIOS のメッセージと，
Linux の起動メッセージを読むと得られます．これらのメッセージは流れるの
が速すぎて読めないことが多いのですが，メッセージが止まった後に 
Shift-PageUp を何度か押せばメッセージをスクロールバックさせることがで
きます．先に進めるには Shift-PageDown を使います．シェルのコマンドとし
て "dmesg" と入力すると，Linux のカーネルメッセージだけならいつでも表
示できます．ただし，(BIOS のメッセージを含む)とても重要なメッセージに
は表示されないものもあります．Linux が出力したメッセージは，デバイスド
ライバが考えている設定しか示していないかもしれません．この設定はもしか
すると，誤りがある設定ファイルから読み込まれているかもしれません．

<!--O
The BIOS messages will show the actual hardware configuration at that
time, but a PnP OS, isapnp, or pci utilities, may change it later.
The BIOS messages are displayed first before the ones from Linux.  As
an alternative to eventually using Shift-PageUp to read them, try
freezing them by hitting the "Pause" key.  Press any key to resume.
But once the messages from Linux start to appear, it's too late to use
"Pause" since it will not freeze the messages from Linux.
-->
BIOS からのメッセージはその時点でのハードウェア設定を表示しますが，PnP
OS, isapnp, PCI Utilities などが後から設定を変えているかもしれません．
BIOS のメッセージは最初に，Linux のメッセージよりも前に表示されます．
後から Shift-PageUp を使ってメッセージを読む代わりの方法として，
"Pause" キーを押してメッセージ出力を止める方法を試してください．
何かキーを押せば再び動作を始めます．ただし，Linux からのメッセージが出
力され始めると，"Pause" キーはもう使えません．というのも，"Pause" キー
は Linux からのメッセージ出力を止めないからです．

<!--
<sect1> How Are My Device Drivers Configured?
-->
<sect1> デバイスドライバはどのように設定されているか?
<!--
<p> There may be a programs you can run from the command line (such as
"setserial" for serial ports) to determine this.   The /proc directory
tree is useful.  /proc/ioports shows the I/O addresses that the
drivers use (or try if it's wrong).  They might not be set this way in
hardware.
-->
<p> コマンドラインから実行でき(シリアルポート用の "setserial" のように)，
設定を表示するプログラムがあるかもしれません．/proc ディレクトリツリー
は便利です．/proc/ioports はドライバが使っている I/O アドレスを表示し
ます(あるいは，アドレスが誤っているかどうかをチェックします)．これを
使ってハードウェアの I/O アドレスを設定することはできません．

<!--
/proc/interrupts shows only interrupts currently in use.  Many
interrupts that have been allocated to drivers don't show at all since
they're not currently being used.  For example, even though your
floppy drive has a floppy disk in it and is ready to use, the
interrupt for it will not show unless its in use.  Again, just because
an interrupt shows up here doesn't mean that it exists in the
hardware.  A clue that it doesn't exist in hardware will be if it
shows that 0 interrupts have been issued by this interrupt.  Even if
it shows some interrupts have been issued there is no guarantee that
they came from the device shown.  It could be that some other device
which is not currently in use has issued them.  A device not in use (per
the kernel) may still issue some interrupts for various reasons.
-->
/proc/interrupts は現在使用中の割り込みだけを表示します．ドライバに割り
当てられている割り込みの多くは，使用中でないために全く表示されません．例
えばフロッピードライブにフロッピーディスクが入っていていつでも使える状態
になっていても，実際に使われていなければ割り込みは表示されません．繰り返
しますが，ここに表示されるのは，割り込みがハードウェア内に存在するという
ことではありません．ハードウェアに存在しないことを知るには，この割り込み
が発行した別の割り込みが 0 個であると示されているかどうかを調べます．た
だし割り込みがいくつか発行されたと示されていても，この割り込みがそのデバ
イス上で起きたという保証はありません．今現在使用中ではないデバイス上で起
きたのかもしれませんし，(カーネル経由で)使用されていないデバイスであって
も，何らかの理由で割込みを発行するかもしれません。

<!--
<sect1> How Are My Hardware Devices Configured?
-->
<sect1> ハードウェアデバイスはどのように設定されているか?
<!--
<p> It's easy to find out what bus-resources have been assigned to
devices on the PCI bus with the "lspci" command.  For for kernels &lt
2.2: see <tt>/proc/pci</tt> or <tt>/proc/bus/pci</tt>.  Note that IRQs
for <tt>/proc/pci</tt> are in hexadecimal.  Don't bother trying to
decipher <tt>/proc/bus/pci/devices</tt> since "lspci" will do that for
you.  

For the ISA bus you may try running <tt>pnpdump −−dumpregs</tt>
but it's not a sure thing.  The results may be seem cryptic but they
can be deciphered.  Don't confuse the read-port address which
<tt/pnpdump/ "tries" (and finds something there) with the I/O address
of the found device.  They are not the same.  To try to find missing
hardware on the ISA bus (both PnP and legacy) try the program
"scanport" but be warned that it might hang your PC.  It will not show
the IRQ nor will it positively identify the hardware.
-->
<p>"lspci" コマンドを使って，PCI バス上のデバイスに対するバスリソースの
割り当てを調べるのは簡単です．バージョン 2.2 より前のカーネルでは，
<tt>/proc/pci</tt> や <tt>/proc/bus/pci</tt> を参照しましょう．また 
<tt>/proc/pci</tt> の IRQ は 16進数表記で表示されることに注意してくださ
い．<tt>/proc/bus/pci/devices</tt> の解読について心配する必要はありません．
"lspci" が代わりに行なってくれます．

ISA バスの場合には <tt>pnpdump --dumpregs</tt> を使おうと思われるかもし
れませんが，これは確実な方法ではありませんし，結果は判読しにくいかもしれ
ません．また <tt/pnpdump/ が見つけた「読み出しポートアドレス」と「見つかっ
たデバイスの I/O アドレス」を混同しないでください．これらは同じものでは
ありません．ISA バス上(あるいは PnP の昔のもの)に見つからないハードウェ
アを検出するには，"scanport" プログラムを試してみてください．ただし PC 
がハングする危険性があることに注意しましょう．また，これは IRQ の表示は
行ないませんし，確実にハードウェアを認識するわけではありません．


<!--
Messages from the BIOS at boot-time tell you how the hardware
configuration was then.  If you rely on the BIOS for configuring, then
it should still be the same.  Messages from Linux may be from drivers
that have checked to see that the hardware is there (and possibly
checked the IRQ and DMA).  Of course, if the device works fine, then
it's likely configured the same as the driver.
-->
BIOS が起動時に出力するメッセージを見ると，ハードウェア設定がどうなっ
ているかがわかります．BIOS に設定を任せているなら，これは以前と同じままのは
ずです．Linux の起動時には，ドライバが，ハードウェアがあるかを確認(そ
して IRQ と DMA も設定されていればそれも確認)したメッセージを出力しま
す．もちろん，デバイスがきちんと動作していれば，デバイスとドライバの設
定は同じになります．

<!--
<sect> Appendix
-->
<sect> 付録
<!--
<sect1> Addresses <label id="addresses_">
-->
<sect1> アドレス <label id="addresses_">
<!--
<p> There are three types of addresses: main memory addresses, I/O
addresses and configuration addresses.  On the PCI bus, configuration
addresses constitute a separate address space just like I/O addresses
do.  Except for the complicated case of ISA configuration addresses,
whether or not an address on the bus is a memory address, I/O address,
or configuration address depends only on the voltage on other wires
(traces) of the bus.
-->
<p> アドレスには 3 つのタイプ，つまりメインメモリアドレス，I/O アドレ
ス，設定アドレスがあります．PCI バスでは，設定アドレスは I/O アドレス
とよく似た別のアドレス空間を構成します．分かりにくい ISA の設定アドレ
スの場合を除き，バス上のアドレスがメモリアドレス，I/O アドレス，設定ア
ドレスであるかどうかは，バスの他の線(トレース)の電圧によってのみ決まり
ます．

<!--
<sect2> ISA Bus Configuration Address (Read-Port etc.)
-->
<sect2> ISA バスの設定アドレス (読み出しポート等)
<!--
<p> For the ISA bus, there is technically no configuration address
space, but there is a special way for the CPU to access PnP
configuration registers on the PnP cards.  For this purpose 3 @ I/O
addresses are allocated.  This is not 3 addresses for each card but 3
addresses shared by all cards.
-->
<p> ISA バスの場合，技術的には設定アドレス空間は無いのですが，CPU が 
PnP カードの PnP 設定レジスタにアクセスするための特別な方法があります．
この目的のために，3 つの @ I/O アドレスが割り当てられています．ただし，
それぞれのカードに 3 つずつアドレスが割り当てられるのではなく，全ての
カードで 3 つのアドレスを共有します．

<!--
These 3 addresses are named read-port, write-port, and address-port.
Each port is just one byte in size.  Each PnP card has many
configuration registers so that just 3 addresses are not even
sufficient for these registers on a single card.  To communicate with
a certain card, a specially-assigned card number (handle) is sent to
all cards at the write-port address.  After that the only card still
listening is the card with this handle.  Then the address of the
configuration register (of that card) is sent to the address-port (of
all cards −−but only one is listening).  Next communication takes
place with one configuration register on that card by either doing a
read on the read-port or a write on the write-port.
-->
3 つのアドレスの名前は，それぞれ読み出しポート，書き込みポート，アドレ
スポートです．各ポートのサイズはちょうど 1 バイトです．PnP カードはそ
れぞれレジスタをたくさん持っていますから，たった 3 つのアドレスではカー
ド 1 枚分のレジスタに対してさえ充分ではありません．特定のカードと通信
するためには，特別に割り当てられたカードの番号(ハンドル)を書き込みポー
トアドレスを使って全てのカードに送ります．すると，このハンドルを持つ
カードだけが監視状態になります．次に(このカードの)設定レジスタのアドレ
スをアドレスポートに送ります(アドレスポートは全てのカードが共有してい
ますが，現在ポートの監視を行っているのは 1 つだけです)．次の通信はその
カードの設定レジスタの 1 つで起こります．これは読み出しポートからの読
み出しか，書き込みポートへの書き込みによって行われます．

<!--
The write-port is always at A79 and the address-port is always at 279
(hex).  But the read-port is not fixed but is set by the configuration
software at some address that will supposedly not conflict with any
other ISA card.  If there is a conflict, it will change the address.
All PnP cards get "programmed" with this address.  Thus if you use say
isapnp to set or check configuration data it must determine this
read-port address.
-->
書き込みポートのアドレスは必ず A79 で，アドレスポートのアドレスは必ず 
279 です(16 進値)．しかし，読み出しポートのアドレスは固定ではなく，他
の ISA カードと重ならないと思われるアドレスに設定プログラムが設定しま
す．アドレスが重なった場合は変更されます．読み出しポートのアドレスを使っ
て，全ての PnP カードを「プログラムする」ことができます．したがって，
isapnp 等を使ってデータの設定やチェックを行う場合には，この読み出しポート
アドレスを決めなければなりません．

<!--
<sect2> Address ranges
-->
<sect2> アドレスの範囲
<!--
<p> The term "address" is sometimes used in this document to mean a
contiguous range of addresses.  Since addresses are given in bytes, a
single address only contains one byte but I/O (and main memory)
addresses need more than this.  So a range of say 8 bytes is often
used for I/O address while the range for main memory addresses
allocated to a device is much larger.  For a serial port (an I/O
device) it's sufficient to give the starting I/O address of the device
(such as 3F8) since it's well known that the range of addresses for
serial port is only 8 bytes.  The starting address is known as the
"base address".
-->
<p> 本文書では「アドレス」という言葉でアドレスの隣接している範囲を指し
ていることがあります．アドレスはバイト単位で与えられるので，1 つのアド
レスは  1 バイトの容量しかありません．しかし，I/O(とメインメモリ)アド
レスにはこれより大きいサイズが必要です．従って，I/O アドレスには例えば 
8 バイトの範囲が使われることが多いですし，デバイスに割り当てられるメイ
ンメモリアドレスの範囲はこれよりもずっと広くなります．シリアルポート
(I/O デバイス)の場合には，デバイスの最初の I/O アドレス(3F8 等)を与え
れば充分です．なぜなら，このデバイスに対するアドレスの範囲は 8 バイト
しかないことは常識になっているからです．この範囲のうち最初のアドレスは
「ベースアドレス(base address)」と呼ばれます．

<!--
<sect2> Address space
-->
<sect2> アドレス空間
<!--
<p> For ISA, to access both I/O and (main) memory address "spaces"
the same address bus is used (the wires used for the address are
shared).  How does the device know whether or not an address which
appears on the address bus is a memory address or I/O address?  Well,
there are 4 dedicated wires on the bus that convey this information
and more.  If a certain one of these 4 wires is asserted, it says that
the CPU wants to read from an I/O address, and the main memory ignores
the address on the bus.  The other 3 wires serve similar purposes.  In
summary: Read and write wires exist for both main memory and I/O
addresses (4 wires in all).  
-->
<p> ISA バスの場合，I/O アドレスと(メイン)メモリアドレスの「空間」にア
クセスする際には，同じアドレスバスが使われます(アドレスに使われる配線
が共有されます)．それでは，デバイスはアドレスバスに現れるアドレスがメ
モリアドレスであるか I/O アドレスであるのかをどうやって知るのでしょう
か? 実はバス上には 4 つの専用の線があり，このような情報を伝えるのです．
4 つの線のうちの特定のものに信号が流れた場合，これは CPU が I/O アドレ
スからデータを読もうとしていることと，メインメモリはバス上のアドレスを
無視することを意味します．残りの 3 つの線も似たような目的で使われます．
簡単に説明すると，読み込みと書き込みの線がメインメモリと I/O アドレス
の両方のために存在します(線は全部で 4 つです)．

<!--
For the PCI bus it's the same basic idea also using 4 wires but it's
done a little differently.  Instead of only one or the four wires
being asserted, a binary number is put on the wires (16 different
possibilities).  Thus more info may be conveyed.   Four of these 16
numbers serve the I/O and memory spaces as in the above paragraph.  In
addition there is also configuration address space which uses up two
more numbers.  Ten extra numbers are left over for other purposes.
-->
PCI バスの場合も基本的な考え方は同じで 4 つの線を使いますが，その使い
方は少し違います．つまり，4 つのうちの 1 つに信号を流すのではなく，4 
つの線を全部使って 2 進数を流します(16 通りの組合せがあります)．こう
することにより，より多くの情報を送ることができます．16 個のうち 4 つは
前節で述べた I/O 空間とメモリ空間のために使います．設定アドレス空間が
さらに 2 個を使います．残りの 10 個は他の目的に使えるように残されてい
ます．

<!--
<sect2> Range Check (ISA Testing for IO Address Conflicts)
-->
<sect2> アドレス範囲のチェック (ISA における I/O アドレスの衝突の検査)
<!--
<p> On the ISA bus, there's a method built into each PnP card for
checking that there are no other cards that use the same address.  If
two or more cards use the same IO address, neither card is likely to
work right (if at all).  Good PnP software should assign bus-resources so
as to avoid this conflict, but even in this case a legacy card might
be lurking somewhere with the same address.
-->
<p> ISA バスの場合，同じアドレスを使うカードが他に無いことをチェックす
るための方法が各カードに組み込まれています．複数のカードが同じ I/O ア
ドレスを使っていると，どちらのカードも正しく動作しないでしょう．まとも
な PnP 設定プログラムはこのような衝突が起こらないようにバスリソースを割り
当てるはずですが，その場合でも隠れているレガシーカードが重なるアドレス
を持っているかもしれません．

<!--
The test works by a card putting a test number in its own IO
registers.  Then the PnP software reads it and verifies that it reads
the same test number.  If not, something is wrong (such as another
card with the same address.  It repeats the same test with another
test number.  Since it actually checks the range of IO addresses
assigned to the card, it's called a "range check".  It could be better
called an address-conflict test.  If there is an address conflict you
get an error message and need to resolve it yourself.
-->
このテストは，カードが自分の I/O レジスタにテスト番号を設定することに
よって行われます．次に PnP 設定プログラムはこれを読み出し，同じテスト
番号が読み出せることを検査します．これが異なる場合には何か問題がありま
す(例えば，別のカードが同じアドレスを使っている)．同様に別のテストが別
のテスト番号を使って繰り返されます．このテストは実際にはカードに割り当
てられた I/O アドレスの範囲でチェックを行うので「範囲チェック」と呼ば
れます．これはアドレス衝突テストと呼ぶ方が良いかもしれません．アドレス
の衝突があればユーザに対してエラーメッセージが出されるので，ユーザは自
分でこれを解決しなければなりません．

<!--
<sect2> Communicating Directly via Memory
-->
<sect2> メモリ経由の直接の通信
<!--
<p> Traditionally, most I/O devices used only I/O memory to
communicate with the CPU.  For example, the serial port does this.
The device driver, running on the CPU would read and write data
to/from the I/O address space and main memory.  A faster way would be
for the device itself to put the data directly into main memory.  One
way to do this is by using <ref id="dma_" name="DMA Channels"> or bus
mastering.  Another way is to allocate some space in main memory to
the device.  This way the device reads and writes directly to main
memory without having to bother with DMA or bus mastering.  Such
a device may also use IO addresses.
-->
<p> 伝統的には，ほとんどの I/O デバイスは CPU と通信する際に I/O メモ
リしか使いません．例えばシリアルポートがこれに該当します．CPU 上で動作
しているデバイスドライバは，I/O アドレス空間とメインメモリに対して読み
込みと書き込みを行います．より高速な方法として，デバイスが直接メインメ
モリにデータを書き込む方法があります．これを行う方法の 1 つが，<ref
id="dma_" name="DMA チャンネル">あるいはバスマスタリングの利用です．また，
メインメモリ空間の一部をデバイスに割り当てる方法もあります．このように
して，デバイスはわざわざ DMA やバスマスタリングを使わないでも直接メイ
ンメモリにデータの読み書きができます．このようなデバイスは通常，I/O ア
ドレスも使うかもしれません．

<!--
<sect1> Interrupts &#045;&#045;Details <label id="interrupt_detail">
-->
<sect1> 割り込み --詳細 <label id="interrupt_detail">
<!--
<p> Interrupts convey a lot of information but only indirectly.  The
interrupt signal (a voltage on a wire) just tells a chip called the
interrupt controller that a certain device needs attention.  The
interrupt controller then signals the CPU.  The CPU finds the driver
for this device and runs a part of it known as an "interrupt service
routine" (or "interrupt handler").  This "routine" tries to find out
what has happened and then deals with the problem such as transferring
bytes from (or to) the device.   This program (routine) can easily
find out what has happened since the device has registers at addresses
known to the the driver software (provided the IRQ number and the I/O
address of the device has been set correctly).  These registers
contain status information about the device .  The software reads the
contents of these registers and by inspecting the contents, finds out
what happened, and takes appropriate action..
-->
<p> 割り込みは多くの情報を伝えることができますが，間接的にしか伝えるこ
とができません．割り込みシグナル(配線上の電圧)は，あるデバイスが処理を
必要としていることを割り込みコントローラと呼ばれるチップに伝えます．す
ると割り込みコントローラは CPU に信号を送ります．
CPU はこのデバイスのドライバを見つけ，「割り込みサービスルーチン」(ま
たは「割り込みハンドラ」)と呼ばれるドライバの一部分を実行します．この
「ルーチン」は何が起きたのかを調べ，デバイスとのデータ転送等の問題を処
理しようとします．このプログラム(ルーチン)で，何が起きたのかについ
て簡単に調べることができます．なぜなら，ドライバは自分が知っているアド
レス内に，調べるためのレジスタを持っているからです(デバイスの IRQ 番号
とI/O アドレスが正しく設定されている場合には)．これらのレジスタにはデバ
イスに関するステータス情報が格納されています．ドライバはこのレジスタの
内容を読み込み，これを調べることによって，何が起きたかを調べて正しい動
作を行うことができます．

<!--
Thus each device driver needs to know what interrupt number (IRQ) to
listen to.  On the PCI bus (and for the serial ports on the ISA bus
starting with Kernel 2.2) it's possible for two (or more) devices to
share the same IRQ number.  When such an interrupt is issued, the CPU
runs all interrupt service routines for all devices using that
interrupt.  The first thing the first service routine does is to check
to see if an interrupt actually happened for its device.  If there was
no interrupt (false alarm) it likely will exit and the next service
routine starts, etc.
-->
したがって，各デバイスドライバは監視する割り込み番号(IRQ)を知っている
必要があります．PCI バス(またカーネル 2.2 以降では ISA バス上のシリア
ルポート)の場合には，複数のデバイスが同じ IRQ 番号を共有することが可能
です．このような割り込みが発行されると，CPU はその割り込みを使っている
全てのデバイスの割り込みサービスルーチンを全部実行します．最初のサービ
スルーチンがまず行うことは，割り込みが本当にそのデバイスに対して行われ
たのかどうかを確認することです．割り込みが無ければ(alarm は偽となりま
す)このルーチンは終了し，次のサービスルーチンが開始します．以降も同様
です．

<!--
<sect1> PCI Interrupts
-->
<sect1> PCI の割り込み
<!--
<p> PCI interrupts are different but since they are normally mapped to
IRQ's they behave in about the same way.  A major difference is that
PCI interrupts may be shared.  For example IRQ5 may be shared between
two PCI devices.  This sharing ability is automatic: you don't need
special hardware or software.  There have been some reports of
situations where such sharing didn't work, but it's likely due to a
defect in the device driver software.  All device drivers for PCI
devices are supposed to provide for interrupt sharing.  Note that
you can't share the same interrupt between the PCI and ISA bus.
However, illegal sharing will work provided the devices which are in
conflict are not in use at the same time.  "In use" here means that a
program is running which "opened" the device in its C programming
code.  
-->
<p> PCI の割り込みは ISA の割り込みとは異なるものですが，通常は IRQ に
マッピングされるため，動作はだいたい同じです．主な違いは PCI では割り
込みを共有できる点です．この共有は自動的に行われます．したがって，
特別なハードウェアやソフトウェアは必要ありません．以前は割り込みの共有
がうまく動作しないという報告もありましたが，これはだいたいデバイスドラ
イバのソフトウェアの問題のようです．PCI 用のデバイスドライバは全て割り
込み共有の機能を持っていることになっています．ただし，同じ割り込みを 
PCI バスと ISA バスで共有することはできない点に注意してください．しか
し，割り込みが重なっているデバイスが同時に使われることがなければ，不正
に割り込みを共有していてもたまたま動作することがあります．ここで「使う」
というのは，動作しているプログラムが(C 言語のプログラムの意味で)デバイ
スをオープンすることです．

<!--
You may need to know some of the details of the PCI interrupt system
in order to set up the BIOS's CMOS or to set jumpers on old PCI cards.
Each PCI card has 4 possible interrupts: INTA#, INTB#, INTC#, INTD#.
Thus for a 7-slot system there could be 7 x 4 = 28  different
interrupt lines.  But the specs permit a fewer number of interrupt
lines.  This is not too restrictive since interrupts may be shared.
Many PCI buses seem to be made with only 4 interrupt lines.  Call
these lines (wires or traces) W, X, Y, Z.  Suppose we designate the B
interrupt from slot 3 as interrupt 3B.  Then wire W could be used to
share interrupts 1A, 2B, 3C, 4D, 5A, 6B, 7C.  This is done by
physically connecting wire W to wires 1A, 2B, etc.  Likewise wire X
could be connected to wires 1B, 2C, 3D, 4A, 5B, 6C, 7D.  Then on
startup, the BIOS maps the X, W, Y, Z to IRQ's.  After that it writes
the IRQ that each device is mapped to into a hardware register in each
device.  Then and anything interrogating the device can find out what
IRQ it uses.
-->
BIOS の CMOS を設定するためや，古い PCI カードのジャンパ設定を行うため
には，おそらく PCI の割り込みシステムについての詳しい知識が必要でしょ
う．各 PCI カードは INTA# から INTD# (A, B, C, D)までの 4 つ の割り込
みを使うことができます．したがって，スロットが 7 つあるシステムでは
7 x 4 = 28 個の割り込み線を別個に持つことになります．ですが，仕様では
割り込み線の数はこれより少なくてもよいことになっています．もっとも，割
り込みは共有できるので，これはたいした制限ではありません．ここで，これ
らの線(配線やトレース)を W, X, Y, Z と呼ぶことにします．また，スロット
3 からの割り込み B を割り込み 3B とします．すると，線 W を使って割り込
み 1A, 2B, 3C, 4D, 5A, 6B, 7C を共有することができます．共有は，線 W 
を物理的に 1A, 2B 等に接続することで実現します．同様に，線 X を使って
割り込み 1B, 2C, 3D, 4A, 5B, 6C, 7D を共有することができます．そして，
起動時に BIOS が W, X, Y, Z を IRQ にマップします．その後 BIOS は，そ
れぞれのデバイスがマップされた IRQ をそれぞれのデバイスのハードウェア
レジスタに書き込みます．こうして，デバイスの問い合わせを行うもの全ては
デバイスが使う IRQ を知ることができます．

<!--
The above mentioned wires X, W, Y, Z  are labeled per PCI specs as
INTA#, INTB#, INTC# and INTD#.  This official PCI notation is
confusing since now INTA# has 2 possible meanings depending on whether
we are talking about a slot or the PCI bus.  For example, if 3C is
mapped to X then we say that INTC# of slot 3 is cabled to INTA# (X) of
the PCI bus.  Confusing notation.
-->
PCI の仕様では，先に述べた配線 W, X, Y, Z に INTA#, INTB#, INTC#,
INTD# というラベルがついています．ですが，この正式な記法は紛らわしいも
のです．なぜなら，スロットと PCI バスのどちらに注目しているかによって 
INTA# の意味が2通りに変わるからです．例えば 3C が X にマップされている
場合，スロット3の INTC# が PCI バスの INTA# (X) に配線されているという
ことになります．紛らわしい記法ですよね．

<!--
There's another requirement also.  A PCI slot must use the lower
interrupt letters first.  Thus if a slot only uses one interrupt, it
must be INTA#.  If it uses 2 interrupts they must be INTA# and INTB#,
etc.  A card in a slot may have up to 8 devices on it but there are
only 4 PCI interrupts for it.  This is OK since interrupts may be
shared so that each of the 8 devices (if they exist) can have an
interrupt.  The PCI interrupt letter of a device is often fixed and
hardwired into the device.
-->
必要事項は他にもあります．PCI スロットでは，若い文字の割り込みから使わ
なければなりません．したがって，スロットが 1 つしか割り込みを使わない
ならば，割り込みは INTA# でなければなりません．割り込みを 2 つ使うなら
ば，INTA# と INTB# でなければなりません．以降も同様です．スロット内の
カードはデバイスを 8 つまで持つことができますが，PCI 割り込みの割り当
ては 4 つしかありません．割り込みは共有できるのでこれで問題なく，8 つ
のデバイスはそれぞれ割り込みを持つことができます．デバイスの PCI 割り
込み文字は，固定値としてデバイスにハードウェア的に結線されていることも
よくあります．

<!--
The BIOS assigns IRQs (interrupts) so as to avoid conflicts with the
IRQs it knows about on the ISA bus.  Sometimes in the CMOS BIOS menu
one may assign IRQs to PCI cards (but it's not simple as explained
above).  There's a situation where Windows zeroed out all the IRQ
numbers in the PCI cards after the IRQ mappings had been set.  Then
someone running Windows booted Linux from Windows with the result that
Linux only found only incorrect IRQs of zero.
-->
BIOS は ISA バスに設定してある IRQ(割り込み)と衝突しないように，PCI の
IRQ を割り当てます．CMOS の BIOS メニューでユーザが IRQ を PCI バスに
割り当てることも時々あります(しかし，これが簡単でないのはこれは既に述
べた通りです)．IRQ のマッピングを設定した後では，Windows が PCI カード
の IRQ を全て 0 にしてしまうという場合もあります．したがって，Windows 
を使っている人が Windows から Linux を起動した場合，Linux では IRQ が 
0 という間違った結果しか得られないということがあります．

<!--
You might reason that since the PCI is using IRQ's (ISA bus) it might
be slow, etc.  Not really.  The ISA Interrupt Controller Chip(s) has a
direct interrupt wire going to the CPU so it can get immediate
attention.  While signals on the ISA address and data buses need to go
thru the PCI bus to get to the CPU, the IRQ interrupt signals go there
almost directly.
-->
読者の皆さんは PCI が IRQ(ISA バス)を使っているために遅い等の理由を考
えるかもしれません．ですが，それは正しくありません．ISA の割り込み
コントローラチップは CPU に直結している配線を持っているので，すぐに 
CPU に信号を送ることができます．ISA アドレスとデータバス上の信号は PCI 
バス経由で CPU に届くのですが，IRQ の割り込み信号はほとんど直接 CPU ま
で届きます．

<!--
<sect1> Isolation <label id="isolation_">
-->
<sect1> アイソレーション <label id="isolation_">
<!--
<p> This is only for the ISA bus.  Isolation is a complex method of
assigning a temporary handle (id number or Card Select Number = CSN)
to each PnP device on the ISA bus.  Since there are more efficient
(but more complex) ways to do this, some might claim that it's a
simple method.  Only one write address is used for PnP writes to all
PnP devices so that writing to this address goes to all PnP device
that are listening.  This write address is used to send (assign) a
unique handle to each PnP device.  To assign this handle requires that
only one device be listening when the handle is sent (written) to this
common address.  All PnP devices have a unique serial number which
they use for the process of isolation.  Doing isolation is something
like a game.  It's done using the equivalent of just one common bus
wire connecting all PnP devices and the isolation program.
-->
<p> アイソレーションは ISA バスでしか使えません．これは ISA バス上の各
PnP デバイスに一時的なハンドル(ID 番号またはカード選択番号(Card Select
Number, CSN))を割り当てるための複雑な方法です．これよりも効率的な方法
(ただし，さらに複雑です)があるので，これは単純な方法だと言われることも
あります．アイソレーションでは，監視を行っている全ての PnP デバイスへ
の PnP 書き込みに対して，書き込みアドレス 1 つだけが使われます．この書
き込みアドレスは，それぞれの PnP デバイスに固有のハンドルを送る(割り当
てる)ために使われます．このハンドルの割り当てには，ハンドルが共通のア
ドレスに送られた(書き込まれた)際にデバイス 1 つだけが待機していること
が必要です．全ての PnP デバイスはアイソレーションの処理で使う固有のシ
リアル番号を持っています．アイソレーションの動作はゲームに似ています．
これは，全ての PnP デバイスが繋がっている 1 つだけの共通のバスの配線と
アイソレーションプログラムの持つ値を同じにすることで行います．

<!--
For the first round of the "game" all PnP devices listen on this wire
and send out simultaneously a sequence of bits to the wire.  The
allowed bits are either a 1 (positive voltage) or an "open 0" of no
voltage (open circuit or tri-state).  Each PnP device just starts to
sequentially send out its serial number, bit-by-bit, starting with the
high-order bit, on this wire.  If any device sends a 1, a 1 will be
heard on the wire by all other devices.  If all devices send an "open
0" nothing will be heard on the wire.  The object is to eliminate (by
the end of this first round) all but highest serial number device. 
"Eliminate" means to cease to listen anymore to the write address that
all devices still in the game are still listening to.  This is also
called "dropping out".  (Note that all serial numbers are of the same
length.) 
-->
「ゲーム」の最初のラウンドでは，全ての PnP デバイスはこの線を監視し，
ここへビット列を同時に送ります．許されるビット値は 1 (正の電圧)または
電圧無しの「開放の 0」(開いた回路か 3 相)のどちらかです．続いて，それ
ぞれの PnP デバイスはこの線でシリアル番号をビット毎に高次ビットから送
り始めます．どれかのデバイスが1を送ると，接続されている他のデバイスは
全て 1 を受け取ります．全てのデバイスが「開放の 0」を送ると，接続され
ているデバイスはなにも受け取りません．この目的は，(最初のラウンドが終
わるまでに)最も大きいシリアル番号を持つもの以外を取り除くことです．
「取り除く」とは，このデバイスは書き込みアドレスの監視をやめるけれど，
ゲームに勝ち残っている全てのデバイスはこのアドレスの監視を続けるという
ことです．これは「ドロップアウトする」とも言います．(シリアル番号の長
さは全て同じである点に注意してください．)

<!--
First consider only the high order bit of the serial number which is
put on the wire first by all devices which have no handle yet.  If any
PnP device sends out a 0 (open 0) but hears a 1, this means that some
other PnP device has a higher serial number, so it temporarily drops
out of this round and doesn't listen anymore until the round is
finished (when a handle is assigned to the winner: the highest serial
number).  Now the devices still in the game all have the same leading
digit (a 1) so we may strip off this digit and consider only the
resulting "stripped serial number" for future participation in this
round.  Then go to the start of this paragraph and repeat until the
entire serial number has been examined for each device (see below for
the all-0 case). 
-->
まずは，まだハンドルをもらっていないデバイス全てが最初に配線に流したシ
リアル番号の最も高次のビットについてだけ考えてみましょう．ある PnP デ
バイスが 0 (開放の 0)を送ったけれど 1 を受け取った場合，これは他の PnP
デバイスがより大きいシリアル番号を持っているということです．つまり，こ
のデバイスはこのラウンドから一時的に脱落し，このラウンドが終わるまでは
ビット列を読み込まなくなります．(ラウンドが終わった時点で勝者，つまり
最も大きいシリアル番号を持っているデバイスにハンドルが割り当てられます．)
この時，ゲームに残っているデバイスは全て同じ先頭ビット(1)を持っていま
す．そこで，このラウンドの続きではこの桁を取り除いて求めた「切り詰めた
シリアル番号」だけを考えれば良いことになります．その後はこの段落の先頭
に戻り，シリアル番号全体を調べるまで繰り返しを行います(全てが 0 の場合
については以下を参照してください)．

<!--
Thus it's clear that the highest serial number will not be eliminated
from the game.  But what happens if the leading digits (of the
possibly stripped serial numbers) are all 0?  In this case an "open 0"
is sent on the line and all participants stay in the game.  If they
all have a leading 0 then this is a tie and the 0's are stripped off
just like the 1's were in the above paragraph.  The game then
continues as the next digit (of the serial number) is sent out.
-->
最も大きいシリアル番号がゲームから取り除かれないことは明らかです．しか
し，(切り詰めたものも含めて)シリアル番号の先頭の桁が全て 0 だった場合
はどうなるのでしょうか? この場合には「開放の 0」が配線に送られ，全ての
デバイスはゲームに参加したままとなります．全てのデバイスの先頭の桁が 0
ならば引き分けになり，前の段落で1を取り除いたのと同じように0を取り除き
ます．それからゲームは継続し，(シリアル番号の)次の桁が送られます．

<!--
At the end of the round (after the low-order bit of the serial number
has been sent out by whatever participants remain) only one PnP device
with the highest serial number remains.  It then gets assigned a
handle and drops out of the game permanently.  Then all the dropouts
from the last round (that don't have a handle yet) reenter the game
and a new round begins with one less participant.  Eventually, all PnP
devices are assigned handles.  It's easy to prove that this algorithm
works.
-->
ラウンドの終わり(参加デバイスが残っているうちはシリアル番号の低位ビッ
トを送り続けた後)には，最も大きいシリアル番号を持つ PnP デバイスが1つ
だけ残ります．このデバイスにはハンドルが割り当てられ，それ以降はゲーム
に参加できなくなります．そして，前のラウンド途中で脱落した(まだハンド
ルを割り当てられていない)全てのデバイスはゲームに再び参加し，1 つ少な
いデバイスの参加で新しいラウンドを始めます．このようにして全ての PnP 
デバイスにハンドルを割り当てます．このアルゴリズムが正しく動作すること
は簡単に証明できます．

<!--
Once all handles are assigned, they are used to address each PnP
device and send it a configuration as well as to read configuration
info from the PnP device.  Note that these handles are only used for
PnP configuration and are not used for normal communication with the
PnP device.  When the computer starts up, all of the handles are lost
so that a PnP BIOS usually does the isolation process again each time
you start your PC.
-->
一度割り当てられたハンドルは各 PnP デバイスを指すために使われ，PnP と
のデバイス設定情報のやりとりに使われます．このハンドルは PnP の設定の
ためだけに使うものであり，PnP デバイスとの通常の通信には使われない点に
注意してください．コンピュータの起動時にはハンドルは全て無くなるので，
PC を起動する度に PnP BIOS はアイソレーション処理を行います．

<!--
END OF Plug-and-Play-HOWTO
-->
以上
</article>
