---
title: "Plug and play device configuration"
subject: "Computer Organization and Architecture"
chapter: 7
key: "semester_5/computer_organization_and_architecture:pnp-configure"
source: https://www.bctengineer.com/q/semester_5/computer_organization_and_architecture/pnp-configure
site: BCT Engineering
---

# Plug and play device configuration

Computer Organization and Architecture · Chapter 7: Input-Output Organization

- Asked in: 2068 Baisakh (old course), 6 marks; 2067 Asar (old course), 8 marks (asked 2 times)
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/computer_organization_and_architecture/pnp-configure
- Whole chapter: https://www.bctengineer.com/md/semester_5/computer_organization_and_architecture/chapter-7

## Question

Explain the plug and play (PnP) device configuration, with the steps to configure a PnP device, with example.

## Short answer

PnP BIOS isolates cards, reads resource needs (IRQ, DMA, I/O ports), resolves conflicts, and allocates non‑conflicting resources before booting the OS. Example: a sound card needing IRQ 5 or 7 and I/O 220h or 240h gets IRQ 7 and I/O 240h when a modem already uses IRQ 5 and I/O 220h.

## Answer

Plug and Play (PnP) is a standard in which the hardware, BIOS and operating system together detect an add-on device and automatically assign the resources it needs (IRQ, DMA channel, I/O port addresses, memory range), so that the user does not set jumpers or switches by hand and no two devices conflict.

#### Steps to configure a PnP device
1. **Power-on and POST:** at power-on the PnP BIOS runs the power-on self-test and first activates only the boot devices (display, keyboard, boot disk) with default resources.
2. **Isolate the cards:** the BIOS uses the PnP isolation protocol on the ISA bus. Each card has a unique serial identifier (vendor ID plus serial number). Cards are isolated one at a time and each is given a **card select number (CSN)**.
3. **Read resource data:** the BIOS reads each card's resource data (device ID and the resources it needs: IRQ lines, DMA channels, I/O port ranges, memory ranges, with alternatives).
4. **Detect legacy devices:** the BIOS reads the saved configuration (ESCD) of fixed, non-PnP devices so that their resources are not reused.
5. **Resolve conflicts and allocate:** the BIOS (or the operating system) builds a conflict-free map of IRQ, DMA, I/O and memory resources for all devices, using the alternatives that each card offers.
6. **Configure and activate:** the chosen values are written into the configuration registers of each card, the cards are activated and the configuration is stored in the ESCD in non-volatile memory.
7. **Boot the OS:** the operating system loads and finds the device drivers. It can reconfigure resources when a device is added or removed.

```text
 Power on -> POST -> isolate cards (CSN) -> read resource data
        -> allocate IRQ/DMA/I/O/memory -> write to cards -> boot OS
```

#### Example
A PnP sound card is inserted. Its resource data says it needs one IRQ (5 or 7), one DMA channel (1 or 3) and an I/O range at 220h or 240h. A modem already uses IRQ 5 and I/O 220h. The BIOS reads these requests, avoids the conflict by giving the sound card IRQ 7, DMA 1 and I/O 240h, writes them to the card and activates it. The driver then uses these values without any user action.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What does Plug and Play achieve?
   A. Users set jumpers for each card
   B. Hardware, BIOS and OS automatically assign IRQ, DMA, I/O and memory resources without conflicts
   C. Only the display gets resources
   D. The OS disables all legacy devices
   Answer: B. PnP removes manual jumper setting and avoids resource conflicts by automatic assignment. (Key point: Purpose of PnP)

2. How does the BIOS identify each PnP card on the ISA bus?
   A. By giving all cards the same number
   B. By reading the OS driver list
   C. By asking the user for a name
   D. By isolating cards one at a time using their unique serial identifier and giving each a CSN
   Answer: D. The isolation protocol uses each card's vendor ID plus serial number and assigns a card select number. (Key point: Card isolation)

3. Why does the BIOS read the ESCD for legacy devices?
   A. So the resources of fixed non-PnP devices are not reused for PnP cards
   B. To erase the old configuration
   C. To install drivers
   D. To increase the CPU speed
   Answer: A. The ESCD stores configuration of legacy devices so the conflict-free map avoids their resources. (Key point: Role of ESCD)

4. In the example, the modem uses IRQ 5 and I/O 220h. What does the BIOS give the sound card (IRQ 5 or 7, I/O 220h or 240h)?
   A. IRQ 7 and I/O 240h
   B. IRQ 5 and I/O 240h
   C. IRQ 5 and I/O 220h
   D. IRQ 7 and I/O 220h
   Answer: A. The card offers alternatives, so the BIOS picks IRQ 7 and I/O 240h, avoiding the modem's resources. (Key point: Resolving conflicts)

## Related in Computer Organization and Architecture

- [Goals of plug and play BIOS](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_organization_and_architecture%3Apnp-bios-goals) — Computer Organization and Architecture, chapter 7
