Plug and Play Technology - JMU



Plug and Play Technology

CS-350: Computer Organization and Architecture

Section 1

Kyle Cook

Andrew Drayer

Adam Imbert

Plug and Play Technology

Introduction to Plug and Play……………………………………………………………..3

Plug and Play and BIOS………………………………………………………………......4

Plug and Play and Operating Systems…………………………………………………….6

Memory Allocation………………………………………………………………………..7

Common Problems Associated with Plug and Play……………………………………….7

Conclusion……………………………………………………………………...…………8

Bibliography……………………………………………………………………...……….9

Introduction to Plug and Play

In mid 1993, a consortium of several companies, including Intel and Microsoft, completely redefine the PC industry. The result of the coalition was a cutting edge process called Plug and Play, or PnP for short. The idea behind this process is exactly what its name suggests; the user will simply need to plug in a peripheral and it will work. For this to take place, Microsoft and the other companies involved found it necessary to develop a computer in which hardware and software would work together to automatically configure devices and assign resources to these devices. The advantage of this kind of technology is that the common user of a Personal Computer (PC) can be exactly that, common. Plug and Play was meant to end manual device configuration and driver conflicts by providing non-technical computer users with the ability to easily upgrade their computer systems. The goal was to make adding components to a computer, such as a printer or scanner, no more difficult than turning on a television. No longer would an owner of a computer have to be well informed about the intricate details of the computer system. What Intel and Microsoft soon found out was that although perfect in theory, Plug and Play was far from flawless in reality.

Although the term Plug and Play is almost exclusively associated with Microsoft, which used it in association with the Windows 95 operating system, other companies had experimented with this type of system. The Mac II, which came out in 1987, included an ease of use and installation which was made possible by their new system bus, NuBus. NuBus included an identification scheme that allowed for cards to identify themselves to the host computer during startup. This meant that the Mac II could take a card that was plugged in, install the correct driver, and the device would work. The downside of the Nubus was that while its flexibility made it much simpler for the user, it made things more difficult for the designers of the cards. Where the simpler system buses of the 1980’s needed a handful of input/output (I/O) chips that were designed to be used with that CPU, the NuBus needed to convert everything to a platform-agnostic or a "NuBus world". This meant that there needed to be a NuBus controller chip between the bus and any I/O chips on the card, which increased costs. While this can be seen on all modern buses, NuBus was considered complex and expensive when it was released in the 1980’s.

Other forms of Plug and Play were introduced on the EISA and MCA buses. For several reasons, however, neither of these buses became the industry standard and were phased out within a few years. It was not until the release of Microsoft’s Windows 95 operating system that Plug and Play finally began to attract attention.

There are four areas that must be considered in order for Plug and Play to work. These areas include the system hardware, the peripheral hardware, the system BIOS, and the operating system. These are the four components that work together in order to achieve the operation of Plug and Play.

The hardware on the computer system must be capable of handling Plug and Play devices. This would include the system chipset and the system bus controllers. For modern systems, which are based on the PCI bus, this is not a problem since the PCI was designed with Plug and Play in mind. Most PCI-based systems also support Plug and Play on their ISA bus, however, older PCs with ISA-only system buses generally do not support this process.

Devices that are added into the system must also be Plug and Play compatible. Plug and Play is now supported for a wide variety of devices, from modems to printers. These devices must be Plug and Play compatible so that they are able to identify themselves when the system calls on them. They must also be able to accept resource assignments from the system when they are made. However, the use of some non-Plug and Play cards, such as legacy cards, may still work with the system although they are not compatible. The use of too many legacy cards though, can be problematic for the system which will be discussed further on.

The computer system’s basic input output system (BIOS) plays a key role in the functionality of Plug and Play. The many routines built into the BIOS, such as collecting information about the different devices and determining what resources they should use, perform most of the Plug and Play work. The BIOS also communicates the information it collects to the operating system, which in turn will use it to configure its drivers and other software in order to make the devices work correctly.

Finally, the operating system must be designed to work with the BIOS, and thus with the hardware as well. The operating system sets up the low-level software, such as device drivers. The device drivers are need in order for the device to be used by applications. The operating system also communicates with the user, notifying them of changes to the configuration of the computer, which can also allow for the user to change the settings of resources if necessary. The very first operating system with full Plug and Play support was Windows 95.

Plug and Play and BIOS

The way in which plug and play works is that it is designed to match up physical devices with the software device drivers that operate them. This is to establish channels of communication between each physical device and its corresponding driver. The Plug and Play BIOS helps ensure that system resource conflicts, during the system’s boot up, are resolved so that the operating system can launch successfully. The system resources include interrupt requests (IRQs), direct memory access (DMA), input/output devices (I/O), and memory addresses. Of these system resources, IRQs are of highest demand because only 16 of them exist. A non-Plug and Play system that does not have a uniform interface for storing and retrieving resource information can experience frequent conflicts because the resources have been over-allocated by many different devices.

Besides resolving conflicts with system board-level devices, the Plug and Play BIOS may also resolve conflicts with Plug and Play cards during the boot process when the computer is first powered on. Once the system has completed the boot process, configuration and control of the Plug and Play devices is transferred from the BIOS to the operating system.

The task of the IRQ is to notify the central processing unit (CPU) through a peripheral card plugged into an ISA slot to tell the CPU that the peripheral has something to “say”. Examples of common peripherals include modems, network interface cards, sound cards, hard-drive controllers, and printer ports. Since the IRQ is a hardware interrupt, there is a physical line that runs to each of the ISA slots on the motherboard.

Not all hardware handles interrupts in the same manner. ISA and PCI handle interrupts in two different ways. Manual configuration is necessary for ISA cards; they represent the era of pre-Plug and Play devices. These types of devices are “edge-sensitive” and prevent two ISA devices from sharing the same IRQ. PCI devices use what is called “level-sensitive interrupts” (Thompson & Thompson, 2002). This is a Plug and Play method that dynamically assigns interrupts through either BIOS or Windows.

Direct Memory Access (DMA) is the method that allows channels to be opened by the peripheral to read or write directly to memory without going through the CPU. This reduces the load of work done by the processor by allowing it to do other tasks. Similar to IRQs, only one DMA channel is assigned to an active device at one time. If more than one device is present, a conflict will appear and the device will not work properly.

Memory addresses, or otherwise known as memory mapping, is when the computer assigns numbers or addresses to physical memory locations on boot up to keep track of the information that the CPU has access to. Many devices are assigned address space in main memory. It's sometimes called "shared memory" or "memory-mapped I/O" or "I/O memory". This memory is physically located in the device. In addition to using such "memory", such a device might also use conventional I/O address space. When a card is inserted that uses main memory, the user is also inserting a memory module for main memory. A high address is selected for it by Plug and Play so that it does not conflict with main memory chips. This memory can either be ROM (Read Only Memory) or shared memory. Shared memory is memory that is shared between the device and the CPU (running the device driver) just as I/O address space is shared between the device and the CPU. This shared memory serves as a means of data "transfer" between the device and main memory. It's I/O but it's not done in I/O space. Both the card and the device driver need to know where it is.

An I/O device is an input/output device that communicates with the computer through many different forms. An I/O device is usually a piece of hardware that can be used both for providing data to a computer and for receiving data from it, depending on the current situation. A disk drive is an example of an input/output device. Some devices, such as a keyboard or a mouse, can be used only for input, and are also called input devices. Other devices, such as printers, can be used only for output.

The Plug and Play BIOS also provides configuration services even after the POST process has been completed –– also known as run-time configuration or services.

Run-time services are a new Plug and Play component that has been incorporated into the system's BIOS. This now allows for resources to be allocated dynamically even after the operating system has been loaded. The operating system can change the resource allocation and configure the devices to prevent conflicts and provide run-time configuration. Plug and Play BIOS, through run-time services, can also provide dynamic event management or the configuration of devices dynamically as they are installed –– such as the insertion of a laptop into its docking station –– which can reconfigure the system automatically.

Required functions of a Plug and Play BIOS depend on system characteristics, such as whether the platform is mobile or not, whether it is a desktop system, whether it has an ISA bus, and so forth. To enable the interaction of a Plug and Play BIOS with the Windows operating system, the Plug and Play installation check structure must be supported and must return FUNCTION_NOT_SUPPORTED for any function defined in the Plug and Play BIOS specifications which are not supported.

Plug and Play and Operating Systems

One of the crucial components of an operational plug and play system is a full-functioning Plug and Play operating system. Microsoft took the first significant step in a Plug and Play operating system with their release of Windows 95. This section will discuss how an operating system such as Windows 95 operates with the Plug and Play BIOS chip and Plug and Play compatible hardware in order to theoretically simplify the process of installing and maintaining hardware on a machine.

After the Plug and Play BIOS chip has completed its phase of the boot process, the operating system is then loaded into memory from the hard drive. In a Linux machine the Plug and Play BIOS will continue the remainder of the hardware configuration. In a Microsoft system, the machine turns the rest of the boot configuration entirely over to the operating system. The config.sys and autoexec.bat files are processed in the normal MS-DOS manner and the Plug and Play process begins. As a Linux system does not handle Plug and Play in the same manner, it will be addressed separately from a Microsoft system. The Microsoft operating systems that will be discussed refer to Windows 9x or later.

A Microsoft Plug and Play operating system is equipped with several components which operate from the boot process to normal runtime operation. One such component is the configuration manager; an element that is instrumental to the MS-DOS boot process. Following the configuration of the Plug and Play BIOS chip during the boot process, the configuration manager examines the current state of the hardware and creates a configuration or enumeration of that state. The configuration manager implements three key elements in the process of creating the hardware enumeration; enumerators, resource arbitrators, and device drivers. These said elements will be discussed later in this section. The hardware configuration derived by the configuration manager is formed into a hardware tree which is a hierarchal map of the configuration. This tree includes all information about the resources used by the devices. The configuration manager continues running to maintain the configuration and monitors for changes which would constitute the need of reconfiguration.

The job of the enumerator is to detect and assign identifiers to the devices present on the machine. The devices are recognized only if they are Plug and Play compatible, and are present on the bus. Those devices are located by way of the device drivers which are responsible for holding all resource information. The resource information includes IRQ numbers and I/O port addresses. Part of this process must ensure that no hardware element is sharing a resource that is conflicting with another device. A resource arbitrator accomplishes this by examining range lists of memory to allocate free resources. The operator stores all of the device information including the drivers and the configuration in the registry in a series of keys and value.

An important aspect of Microsoft Windows operating systems is that they support dynamic device loading. During runtime, the configuration manager will call back the enumerator which then takes the necessary actions to recognize the device against the device drivers. The new device is than added to the registry where it becomes functional. For example, while operating Windows 9x or later, one could unplug a standard mouse and replace it with a USB mouse. The computer would recognize that the previous mouse has been unplugged and that another has been plugged in.

Linux is arguably not a true Plug and Play operating system and therefore must handle a Plug and Play system in an entirely different manner. Linux does not support Plug and Play configuration via the operating system and must therefore rely on the device drivers, kernel, and Plug and Play BIOS to control all configuration. During the boot process, the device configuration remains in the BIOS and Kernel control. The development of Kernel 2.2 provides functions for which the drivers of the machine are able to determine if the device is present on the system. This version of Kernel works solely in conjunction with the PCI bus and not the ISA bus. A later version, Kernel 2.4 functions on both an ISA and a PCI bus.

The original ISA bus design comes from IBM. However this bus was not built in anticipation of Plug and Play and therefore leaves virtually no resources for I/O addressing. In a PCI bus, more IRQ addresses are supplied, and the bus also supports the sharing of an IRQ. Although this depletes efficiency, it solves the lack of resources error commonly caused with an ISA bus under Plug and Play architecture.

Memory Allocation

After a device is located in the machine, it must be configured. In order to properly configure a device, it must be addressed using the appropriate resources. Of the three address spaces: I/O, main memory, and configuration – devices will use two. On an ISA bus machine, devices would originally be addressed in the I/O address space. However, it is commonplace to have a machine use main memory for addressing. The necessary instructions and functions for addressing a device are found in the device driver. The address of the device is first set in a register, and then recognized by the device driver. The memory used in this process is often referred to as shared memory or I/O memory. It is important the physical device is set the respective address for both the machine and the device to recognize its existence. This process was configured manually but is now automated by Plug and Play.

Common Problems Associated with Plug and Play

A commonly heard reference to Plug and Play in its earlier days, and still used to this date, is the phrase “plug and pray”. This term refers to the large number of problems associated with the process. The most common problem with Plug and Play is its inflexibility when allocating system resources. This source of this problem can be found embedded in the actual architecture of the computer. The architecture of the PC provides a limited number of IRQs, DMA channels, I/O addresses, and memory regions, which would provide for a simple and straight forward computer if there were only a few devices. However, since modern computers contain many more devices than they do resources, devices are unable to have fixed resources that would solely be for them. If done correctly, the allocation of bus-resources establishes a channel of communication between the hardware and its corresponding device driver. That is to say that, if a certain I/O address is allocated to both a device driver and a piece of hardware, then they have established a one-way communication channel between them. With the communication line open, the driver may send commands and other information to the device, but since this is only a one-way communication, the device is unable to initiate any messages. In order to initiate communication, the device must first acquire an IRQ so it can send an interrupt to its corresponding driver. This creates a two-way communication channel where both the driver and the physical device can initiate communication.

The problem that is commonly seen with Plug and Play is that when the system encounters a conflict of resources, it can address the simple situations, but can become confused by more complicated ones. The computer system is able to switch and relocate resources for devices when a conflicting assignment occurs, but only to a certain degree. If a complex situation were to occur, the device configuration may mismatch IRQs, which leaves that device blind to its appropriate drive, and thus blind to the system. Generally, the more complex a computer system is, the more likely it will need to manually tweak the configuration of the conflicting devices.

A common cause of complexity in device configuration is the use of multiple "legacy" ISA devices. A legacy device is a device which does not support the Plug and Play standard, but may still be used in the Plug and Play environment. However, these devices pose a unique problem. Legacy devices make resource assignment much more difficult because they cannot be automatically configured by the BIOS. Generally, the BIOS will address these non-Plug and Play devices by ignoring them. The computer will simply consider them as being there and will avoid using any of the resources they have assigned to them. In most circumstances, using a few legacy devices with a Plug and Play system, but using too many non-Plug and Play devices can make it extremely complicated for the BIOS to configure the rest of devices. The use of many legacy devices will decrease the amount of system resources the computer has accessible due to the large amount of resources that are being reserved for the legacy devices.

There are other problems associated with Plug and Play. These problems occur with conflicting hardware devices on a computer. With the growing need for a computer to have more than one of the same type of device installed, devices need to become more flexible so that they can be set to whichever address or IRQ that is necessary in order to avoid conflicts. An example of this is a computer with multiple hard drives or one with two network cards. This situation can cause problems because both devices will try and compete for the same resources.

Conclusion

The addition of Plug and Play to the PC architecture has forever changed the computer industry. Through the use of the BIOS and operating system, the computer is able to automatically configure system devices, which vastly simplifies device management. Before the release of Plug and Play in 1995 for the Windows 95 operating system, managing devices had to be done through the motherboard. This type of configuration required the user to have a high level of knowledge in how a computer works. By simplifying the process of adding and configuring devices, PCs were now open to a wider range of consumers. These new consumers were not computer professionals, but the casual, home user.

B I B L I O G R A P H Y

Kozierok, Charles M. (April 17, 2001) “The PC Guide” URL:



Lawyer, David S. (August, 2003) “Plug and Play HOWTO” URL:



Muellers, Scott(2004). Upgrading & Repairing PCS. Indianapolis, Indiana: QUE.

No Author Listed. (March 25, 2005) “Plug and Play Environment” URL:

us/w98ddk/hh/w98ddk/pnp_0ek6.asp

Pittsley, Steven. (August 23, 2001) “Plug and play in Windows 2000” URL:



Thompson, Robert Bruce, Barbara Thompson (2002). PC Hardware In a Nutshell. Cambridge, Mass: O’Reilly.

.White, Ron(1998). How Computers Work. Indianapolis, Indiana: QUE.

Wikipedia. (March 2004) “NuBus”. URL:

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download