Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Plug and Play can help us to discover a hardware component in a system without a need of a physical configuration or user intervention in resolving resource conflicts.

But I wonder: are there special requirements for hardware and/or software in order to permit Plug and Play to work? Take an example of USB; are there any requirements for USB memory sticks or USB disks in order to use the standard Microsoft drivers?

share|improve this question
up vote 1 down vote accepted

"Plug and Play" is a Windows-specific term that originally meant the method later ISA and then PCI devices allowed the operating system to choose the resources they consumed. The BIOS could do this as well for DOS, or step aside and let Windows completely do it.

Resources are A) memory addresses, B) I/O addresses, C) IRQs, and/or D) DMA channels. Each, several, or all of these can be used by a device to communicate with the CPU.

So originally a "Plug and Play" driver was a driver that could understand how to initialize the device, i.e. configuring it to take resources that no other device was using.

One other important part of Plug and Play is a standard method for a device to identify itself, PCI (and possibly ISAPNP) makes provisions for each device to have a unique vendor and device ID. This carried over to USB. So the host OS can find out "what" the device is and load the proper driver.

Now, when we get into devices that are designed to be "hot-pluggable", that is slightly different, but evidently the term "Plug and Play" is still used to describe it. Most hot-pluggable devices are "hosted" by a non-hotpluggable device. USB devices are "hosted" by a USB controller, which is itself a PCI device consuming one or more resources usually assigned via Plug and Play. Talking to devices over the USB bus involves going "through" the USB controller. A similar situation exists for SCSI, IDE, and SATA devices.

So for hot-pluggability to work, the driver for the "host" controller needs a mechanism to tell drivers representing devices "above" it what is going on, i.e. a USB controller driver needs a way to tell a USB mass storage driver that the device has been disconnected. The "upper" driver needs to have code that can terminate cleanly when it is asked to be removed, instead of expecting to stay resident until rebooted.

Most bus types such as USB, SCSI, SATA are governed by standards which the drivers must recognize and implement.

On the hardware level, most hot-pluggable devices are designed where part of the connector discharges static electricity, and that the pins that carry power connect a fraction of a second before pins that carry data. Look closely at USB and SATA connector pins; this is why some are longer than the other. IDE connectors do NOT do this and are NOT safe for hotplugging.

share|improve this answer
It sounds interesting. Can you tell me from which source you get these information? – chipbk10 Jan 28 '13 at 0:17

The whole plug & play "magic" has - from my knowledge - only two essential core parts:

  • The software has to be able to identify some new hardware has been connected (part of the USB standard for example).
  • The hardware can be identified. Using a special request (without using vendor specific drivers) an unique ID can be retrieved (usually consisting of a vendor ID and a device/hardware ID). The operating system can use these to identify the specific piece of hardware and install the correct drivers without asking the user first.
  • (Optional:) The hardware and software (drivers) should ideally work without requiring a reboot.

To work with the provided standard drivers, hardware has to implement the correct reactions to commands being sent (i.e. the hardware has to speak the correct "language"). Depending on the kind of hardware this usually has been standardized (e.g. USB mass storage devices).

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .