scotsmist
SUPPORT

Technical The BIOS and CMOS Plug And Play Explained

Plug And Play

One of the most frustrating experiences a personal computer engineer or owner faces is installing an upgrade or new device to a system. Many users have a real fear of anything electrical and opening up a PC can be a very nerving experience and to most users the inside of a PC is very foreign. The exposed cables, circuit boards, jumpers and switches are looked at as complex and dangerous. However with the power turned off a PC is generally safe.

Due to the historic nature of the personal computer, the design is very user unfriendly, particularly when installing new devices or upgrades. Installing requires configuring the new device and sometimes reconfiguring one or more existing devices. As well as installing the hardware, software is usually installed. Most users attempts at an upgrade are usually unsuccessful and attempts to reverse an unsuccessful installation often results in the system no longer operating properly. Since most first time buyers expect personal computers to be easy to use, installation issues and problems are a major concern.

A Windows Thing

Microsoft and Intel along with others, addressed the upgrade concerns and proposed a comprehensive set of new standards called the Plug And Play Standards or PnP. New devices and upgrades should simply be plugged in and operate properly without the need to adjust or reconfigure the jumpers, switches or cables and all the hassle. The system may still need reconfigured though would be transparent and hidden.

The original Apple II computer expansion slot design had the basic architecture features necessary to support Plug and Play, but early products rarely used it fully. The Amiga computer made by Commodore did support Plug and Play compatibility back in 1985 and totally eliminated jumpers and switches and was perhaps the first system to have the hardware architecture and operating system to support true Plug and Play. Intel promoted several bus architectures including extending the ISA (PC AT) bus to support 32 bits. The two that surpassed them all were VESA Local Bus System and PCI Bus System, which define slot specific addressing and reserve configuration space for each slot device. This capability enables Plug and Play but does not implement a full system Plug and Play ability. The PC system still has to deal with the ISA slots.

Complicating Things

On a personal computer each adapter, application software and device driver require a certain set of resources to operate, including I/O port, IRQ, DMA channel and access to specific blocks of memory address space. There are three basic problems that make Plug and Play difficult on a PC.

  1. There are a fixed number of key system resources that must be shared out
  2. There is no easy or standardised way to determine which resources are in use or which are available
  3. There is no easy or standardised way to determine an adapter or devices actual configuration, or to reconfigure an adapters use of resources to eliminate conflicts.

A further complication is the fact that some adapters and software, even if reconfigurable, may not work properly. For example, certain applications that use sound cards, require specific interrupt level priorities and DMA channel priorities to ensure proper operation. Sound cards are very sensitive to the interrupt and DMA channels. The lower the DMA channel or IRQ number, the higher its priority. Higher priority numbers are serviced first, before lower priority levels. Therefore assigning an unused interrupt level or DMA channel may not ensure proper operation.

Having a limited (finite) number of resources is common to all computer systems. Even with unlimited resources, only part of the allocation problem would be solved. There would still be problems when adapters and applications unknowingly select the same specific resource. The PCs problem is not really a lack of resources, but that of allocating resources so that conflicts are not encountered during use. This problem exist both on the expansion bus slots and other ports.

To gain the full benefits of Plug and Play all levels of a system must co-operate. Buses and ports must be designed to enable extraction of device identification codes and configuration information, also adapters and devices must be designed to provide the information. Devices and adapters must be reconfigurable under software control so as to enable resolving conflicts. The personal computers System BIOS must support Plug and Play services, the operating system must support resource allocation, provide application notification of selected resources and report problems or conflicts that are not resolved. Applications and device drivers must access configuration information and dynamically adjust to the environment.

Before any level of Plug and Play support is provided the systems hardware and software must support positive identification of device types in each slot and have access to configuration information of each device. In general most expansion slots do not require any hardware changes to support access to configuration information and support for software reconfiguration.

ISA Bus Contention

The major problem with Plug and Play support is with the ISA bus, which is usually present in even the latest systems, to support upgrades such as FAX/Modems, sound cards, SCSI adapters and LAN boards. These adapters must contend for a specific set of resources in a non conflicting co-operative way. Without the system knowing which adapters are installed and what the resource requirements are, it is not possible to automatically detect or resolve problems.
Examination of the ISA bus I/O port addressing architecture shows the basic problem that the Plug and Play standard has to deal with. In the original personal computer designs only the lower order 10 bits of the I/O address field were used to select port addresses. Of the 1024 1K addresses on the motherboard or expansion slots, half were originally reserved.
Some de-facto standards have developed over time so certain adapters have accepted address locations. For example the SoundBlaster soundcard and particularly motherboard devices installed on the ISA bus such as serial port adapters, parallel port adapters and some disk controllers.

Unlike the I/O port addresses, where the number is not an issue, the interrupt requests are often insufficient. The ISA bus can not dynamically reassign interrupt requests due to the use of edge sensitive mode on interrupt request inputs. In an edge sensitive mode an interrupt is only recognised when it changes state from off to on, unlike new buses that support the level sensitive mode that permits multiple devices to simultaneously attach to and use the same interrupt request input. In a level sensitive mode, an interrupt is considered active all the time, even after it changes to an active state.

DMA channels are another shared resource on the ISA bus. DMA channels perform high speed data transfers between devices and system memory, without interrupting the processor. DMA channels are prioritised.

Some devices contain BIOS code in ROM, for example LAN adapters and presents an identical problem to that of the I/O addressing. These devices must be allocated memory address space on the ISA bus. Most adapters of this kind support enabling and disabling of onboard ROM or RAM as well as programmable relocation. Installable system ROM BIOS extensions are already defined in headers in each device and the Plug and Play standards extends this header further.

ISA Bus Plug and Play

Microsoft devised an algorithm that when combined with new circuitry on Plug and Play compliant adapters enables access to configuration data on plug and play boards installed in ISA bus slots. The scheme does not allow identification of which boards are in what slots, but does enable all installed boards to report their presence and configuration information in a co-operative way.

After a personal computer is powered on, all Plug and Play adapters initially set in an active mode and do not respond to any ISA bus commands. Plug and Play adapters are set into configuration mode by systems software issuing an initiation key sequence, that consists of a series of writes to specific registers. All adapters check the key sequence and if received properly, set themselves to configuration mode, each board is isolated and uniquely identified in non-volatile memory. Once installed, onboard configuration data can be read and a handle assigned to the Plug and Play board. Finally the system software reconfigures the Plug and Play board to remove all conflict in resource allocation and the priority level needs of each boards DMA and interrupt performance are met.
For a more detailed explanation of the Plug and Play ISA specification refer to Microsoft and Intel.

PCI Bus Plug and Play

The PCI Local Bus has become the standard expansion bus slot for upgrades in high performance personal computer systems. The PCI Local Bus Specification defines 64 bytes of configuration registers which must be supported by every PCI device. These registers are intended to be used by the host system Plug and Play configuration mechanism to locate the resources used by the device into the system space. There are four different register types within the 64 bytes that are important to the Plug and Play. The registers are Manufacturer ID, Device ID, Base Address Register (BAR) and the Interrupt Line Register.

The Manufacturer ID and Device ID are used together to identify a PCI device and manufacturer. The values are assigned by the PCI SIG organisation so that each manufacturer has a unique identification number.
The BAR has two purposes. Before POST, the BAR identifies the system resources required by the device. After completing the Plug and Play configuration the system writes the assigned base address value for the device into the BAR. The Interrupt Line Register is used to identify the system hardware interrupt line to be used by the device.

Full Plug and Play System

The following is a summary of the Plug and Play event sequence in a full Plug and Play system.

Power On  
|
V
 

Plug and Play logical devices required for boot come up active using power up defaults.

Plug and Play devices not required for boot come up inactive.

Plug and Play Devices
|
V
 

Before POST (Power On Self Test) the BIOS will

  1. Isolate a Plug and Play card
  2. Assign a handle
  3. Read resource data
  4. Repeat above until no cards respond
  5. Each logical device required for boot is checked for conflict free resource assignments before activating the logical device.

POST

BOOT

System BIOS
|
V
 

Operating System will

  1. Get Plug and Play information from the system BIOS
  2. Read resource data from all cards
  3. Arbitrate system resources for Plug and Play cards
  4. Assign a conflict free resource for all inactive logical devices
  5. Activate all logical devices just configured
  6. Load device drivers
Operating System

Levels Of Support

To be fully Plug and Play compliant the personal computer must support the many levels that exists. At the highest level, the application must be Plug and Play aware and must be capable of automatically requesting system resources from the operating system and dynamically adjusts needs as required. The operating system must be fully capable of managing the available resources, eliminate conflicts, meet application needs requiring resources and support automatic installation and reconfiguration of device drivers. The system BIOS must be able to isolate and interrogate Plug and Play devices and report or attempt to resolve conflicts by reconfiguration and support reconfiguration requests from the operating system. Also, the devices and adapters must be fully Plug and Play.

When the system is not fully Plug and Play compliant or one of the Plug and Play levels is missing the success rate of trouble free installation or upgrade may be reduced.

To be sure of the best setting for a motherboard option, suitable benchmarking software should be used and only one field should have a option changed to properly determine what difference if any the field makes to the system performance.
< ACPI Explained  

If you have a question that is not answered on any of our pages why not post it on our community forum

[Welcome] [About Us] [25 Pounds] [Search] [Downloads] [Email] [Site Map] [Forum]

Copyright © 1994-2002 scotsmist.co.uk