Next Previous Contents

## 1. Introduction

## 1.1 1. Copyright, Trademarks, Disclaimer, & Credits

### Copyright

Copyright (c) 1998-2007 by David S. Lawyer mailto:dave@lafn.org

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

1. If it's not a translation: Email a copy of your derivative work (in a format LDP accepts) to the author(s) and maintainer (could be the same person). If you don't get a response then email the LDP (Linux Documentation Project): submit@en.tldp.org.
2. 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.
3. Give due credit to previous authors and major contributors.

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

### Disclaimer

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.

### Trademarks.

Any brand names (starts with a capital letter such as MS Windows) should be assumed to be a trademark). Such trademarks belong to their respective owners.

### Credits

- March 2000: Daniel Scott proofread this and found many typos, etc.
- June 2000: Pete Barrett gave a workaround to prevent Windows from zeroing PCI IRQs.
- August 2004: Ross Boylan found typos, etc. and pointed out lack of clarity in telling the BIOS if it's a PnP OS

## 1.2 Future Plans; You Can Help

Please let me know of any errors in facts, opinions, logic, spelling, grammar, clarity, links, etc. But first, if the date is over a several months old, check to see that you have the latest version. Please send me any info that you think belongs in this document.

I haven't studied the code used by various Linux drivers and the kernel to implement Plug-and-Play. But I have sampled a little of it (especially some of the comments). Thus this HOWTO is still incomplete. It needs to explain more about "hot swapping", "hot-plug" and about the new PnP software for kernel 2.6. The history of Linux PnP is not well covered. Also, it doesn't cover firewire. It likely has some inaccuracies (let me know where I'm wrong). In this HOWTO I've sometimes used ?? to indicate that I don't really know the answer.

## 1.3 New Versions of this HOWTO

New versions of the Plug-and-Play-HOWTO should appear every year or so and will be available to browse and/or download at LDP mirror sites. For a list of mirror sites see: http://tldp.org/mirrors.html. Various formats are available. If you only want to quickly check the date of the latest version look at: http://tldp.org/HOWTO/Plug-and-Play-HOWTO.html. The version you are now reading is: v1.15, August 2007 .

## 1.4 New in Recent Versions

For a full revision history going back to the first version see the source file (in linuxdoc format) at http://cvsview.tldp.org/index.cgi/LDP/howto/linuxdoc/Plug-and-Play-HOWTO.sgml

- v1.15 Aug. 2007 Revised interrupt sections. Removed 2 redundant and confusing paragraphs containing a mystery function "h()"
- v1.14 Feb. 2006: Revised "How Linux Does PnP"; LPC was intended to be config. by the BIOS. Balancing IRQs. Linux can find drivers for detected devices.
- v1.13 July 2005: IRQ conflicts. Better clarity in resource descriptions. /proc/bus. PCI configuration space accessed via IO address space. More hardware detection tools. "Can't allocate region" error message.
- v1.12 March 2005: /dev/eth0 doesn't exist anymore. Info in /sys and /proc changed for kernel 2.6. PCI Config. address space is "geographic". scanpci may find a device that lspci can't. Kernel may assign addresses at boot-time.

## 1.5 General Introduction. Do you need this HOWTO?

Plug-and-play (PnP) is a system which automatically detects devices such as disks, sound cards, ethernet cards, modems, etc. It finds all devices on the PCI bus and all devices that support PnP on the old ISA bus. Before PnP, many devices were automatically searched for by non-PnP methods, but were sometimes not found. PnP provides a way to find all devices that support PnP. It also does some low-level configuring of them. Non-PnP devices (or PnP devices which have not been correctly PnP-configured), can often be detected by non-PnP methods. The PCI bus is inherently PnP while the old ISA bus originally wasn't PnP but had PnP support added to it later. So sometimes PnP is used to only mean PnP for the old ISA bus. For example, when you see a boot-time message from "isapnp" and it reads: "Plug & Play device" it only means an ISA Plug & Play device. In this HOWTO, PnP means PnP for both the ISA and the PCI bus.

As time goes by the Linux kernel is became better at supporting PnP. In the late 20th century, one could say that Linux was not really a PnP OS. But the claim is made that with version 2.6 of the kernel, Linux is now fully PnP (provided the kernel is built with appropriate PnP support). While the PnP system is not centralized like it is in MS Windows (with its registry) the decentralized Linux PnP seems to work OK.

Linux does keep track of resource assignments requested by device drivers and refuses any request if it thinks it would cause a conflict. The kernel also provides programs that device drivers can call on to do their own plug-and-play. The kernel also reads all configuration registers of all PnP devices and maintains tables of them that device drivers can consult. This table helps drivers find their hardware. Kernel 2.6 provides better support for "hot plug".

The BIOS hardware of your PC likely does some plug-and-play work too. Thus if everything works OK PnP-wise, you can use your computer without needing to know anything about plug-and-play. But if some devices which are supported by Linux don't work (because they're not discovered or configured correctly by PnP) then you may need to read some of this HOWTO. You'll learn not only about PnP but also learn something about how communication takes place inside the computer. If you have a modern computer with a PCI bus but no ISA bus, you may skip over or skim the parts about the ISA bus.

If you're having problems with a device, watch the messages displayed at boot-time (go back thru them using Shift-PageUp). If this doesn't also display early messages from the BIOS use the "Pause" key. See Pause

Check to see that you have the right driver for a device, and that the driver is being found and used. If the driver is a module, type "lsmod" (as the root user) to see it it's loaded (in use). If it's not a module then it should be built into the kernel.

This HOWTO doesn't cover the problem of finding and installing device drivers. Perhaps it should. One problem is that a certain brand of a card (or other physical device) may not say what kind of chips are used in it. The driver name is often the same as the chip name and not the brand name. One way to start to check on a driver is to see if it is discussed in the kernel documentation, in another HOWTO, or on the Internet. Warning: Such documentation may be out of date.

The PCI bus computers (no ISA bus) have significantly reduced the number of things that can go wrong. For the ISA bus and the lack of kernel support for ISA Pnp (before kernel 2.4), there was much more that could go wrong. Remember that sometimes problems which seem to be PnP related are actually due to defective hardware or to hardware that doesn't fully conform to PnP specs.

Next Previous Contents