Plug-and-Play-by-Garron-Combs-2002

Download Report

Transcript Plug-and-Play-by-Garron-Combs-2002

Plug and Play or Plug and Pray
CS 350: Computer Organization
Spring 2002
Section 2
Garron D. Combs
A Dream World: Perfect Plugand-Play
Plug-and-Play can be generically defined as the ability of a
computer system to automatically configure new hardware
devices. Thus, in a perfect world where Plug-and-Play
works exactly as all the claims of manufacturers say, ‘you
plug it in, it runs, you’re done”. A dream system where no
DIP switches, jumpers, memory allocation, IRQ channel
declarations or anything else needs to be acknowledged by
the user, other then that he/she placed the hardware device
is in there. They need to know nothing about any of the
‘magic’ that happens to make it work. Yet, Plug-and-Play
seems to fail at consistently meeting all of these claims.
Technical Definition of Plug and
Play
Plug-and-Play is a hardware and software standard
for automatically informing software (device
drivers) where it can find various pieces of
hardware (devices) such as modems, network
cards, video cards, etc. What this means is that
Plug-and-Play's task is to pair up the physical
devices with the software (device drivers) that
operates them and form channels of
communication from each physical device to its
driver.
Then how do we identify a
device as being Plug-and-Play?
Looking at this definition of Plug-and-Play basic rules of a playand-play device can be established:
• 1. The device is completely configurable by software. (No
mechanical switches or jumpers are allowed.)
• 2. The device can uniquely identify itself to any inquiring
software (drivers).
• 3. The device is capable of reporting to the system about the
resources it requires to operate.[1]
[1] If the world was perfect and plug-and-play worked to it’s greatest abilities,
then the device would also identify the preferred resources it wished to be
allocated, as well as alternative sets of resources.
Hardware and Device Drivers
• In the early days of computer systems all devices had their own plug-in
cards (printed circuit boards). Today, in addition to plug-in cards, many
devices are small chips mounted on the motherboard, as well as this
cards plugged into the motherboard may hold more then one device.
• To control a device, the CPU (under control of the device driver) sends
commands (as well as data) to and reads from the various devices.
• The device driver must know the address range for the device which it
controls.
• Knowing the address of this device is analogous to establishing a
communication channel; though the physical "channel" is really the data
bus inside the PC.
• Along with this channel of communication from devices to their drivers
there’s a reverse part of the channel allowing devices to send requests
for help to their device driver. (reference Slide 7)
Allocation of Memory for new
Devices (opening communication)
•
•
•
•
PCs have three basic types of address spaces in relation to device
installation: I/O, main memory, and configuration.
The way that a PC determines which space belongs to which
address is by the voltage on dedicated wires of the PC's bus.
Originally devices were located in I/O addresses, but now they can
use address space in main memory.
In allocating I/O address to devices there are two steps to remember:
1.
2.
Set the I/O address on the card (the hardware device setting the address
it will use in a register)
The hardware device lets it’s device driver know this I/O address
Interrupt Request
(communication goes both ways)
•
•
•
•
•
•
The device driver knows the address of the hardware device, so it can
send information and data to the device, but the Interrupt Number is what
allows the device to send information to the device driver.
The system places a voltage on a dedicated interrupt wire, located inside
the bus. This voltage signal is called an Interrupt ReQuest (IRQ).
For each wire there is a unique IRQ number, that defines the wire it
sends its request through. The device and driver both know this number.
For a device to request for its controller it must put its proper signal on
the right wire and the driver listens for the interrupt on that wire.
An Interrupt ReQuest is a devices way of calling out to the processor,
and saying “I need help, show me some attention”. These requests are
fed to the processor using a special piece of hardware called an interrupt
controller, and then read by the device’s driver.
Plug-and-Play devices set this IRQ number for the user, instead of
he/she having to set it manually (setting a DIP switch).
DMA Channels
•
•
DMA stands for direct memory access; a technique that’s used for
transferring data from main memory to a device without passing it
through the CPU. This is where a device is permitted to take over the
main computer bus from the CPU and transfers bytes directly to main
memory.
Without DMA channels the system would require that such a process
took two steps:
1.
2.
•
Reading from I/O memory space for the device and putting these
bytes into the CPU
Writing these bytes from the CPU to main memory
DMA channels allows these steps to be combined into one single step:
1. The process of sending the bytes directly from the device to memory
along these channels.
The device needs to have such capabilities built directly into its hardware,
so not all devices can do DMA.
DMA Channels cont…
• When a device on an ISA bus wants to do DMA it issues a DMA
request (DRQ) using dedicated DMA request wires very similar to an
interrupt request.
• DMA requests are numbered, much like interrupts, so as to identify
which device is making the request.
• This number is represents the DMA channel.
• The return signal from a DMA request, known as a DMA
Acknowledgement Signal, must operate on this same channel to be
acknowledged by the device that originally sent the DMA request.
Plug-and-Play’s Allocation of
these Resources
• A large load of the work involved in making
Plug-and-Play function is performed by the
system BIOS during the booting. At the
appropriate step during the boot process, the
BIOS will follow a procedure to determine
and configure both Plug-and-Play devices
as well as the non-Plug-and-Play device it
finds in your system.
Steps in BIOS during Boot in
managing a PCI based Plug-andPlay System
1. Create a resource table of the available IRQs, DMA channels and
I/O addresses; those not already reserved for system devices.
2. Locate and identify all Plug-and-Play devices on the PCI and ISA
buses.
3. Load the last known system configuration from the ESCD
4. Compare the current configuration to the last known
configuration.*
(If they are unchanged, the system will continue with the boot; the rest
of the boot-up continues from here.
*ESCD – Extended System Configuration Data - a format for storing
information about Plug-and-Play devices in the BIOS.
Steps in BIOS during Boot in
managing a PCI based Plug-andPlay System cont…
5.
If the configuration is unique from the previous record, the
system begins reconfiguration. (Starting with the resource table
by eliminating any resources being used by non-PnP devices.)
6.
Check the BIOS settings to see if any new system resources
have been reserved for use by non-Plug-and-Play devices and
eliminate any of these from the resource table.
7.
Assign resources to Plug-and-Play cards from the remaining
resources in the table, and inform the devices of their new
assignments.
8. Update the ESCD by saving the new system configuration.
(From here the rest of boot-up will continue.)
What’s necessary in your system
today for Plug-and-Play
•
The hardware of modern PCI-based systems are designed with Plugand-Play in mind.
– Windows and IBM committed to a joint effort with Windows 95.
– Where older PCs with ISA-only or VL-bus system buses generally do not
support Plug-and-Play.
•
The device must be Plug-and-Play aware so they can identify
themselves when requested, and be able to accept resource
assignments from the system.
• Routines built into the BIOS perform the actual work for Plug-andPlay and communicate this information to the operating system.
Older PCs have an outdated BIOS, but usually support Plug-and-Play
in hardware and can be made fully Plug-and-Play compatible with a
BIOS upgrade.
• The operating system must work with the BIOS and set up all device
drivers, that are necessary for the device to be used by applications.
Why the title Plug and Pray?
• What happens when you use Plug-and-Play devices is you’re
turning over control of your system’s configuration to the computer.
• The system can take care of the simple situations, but can only do
what it’s programmed to do and may not be able to handle more
complicated ones, when it has to move multiple components around
to make the room and allocate the proper location to new devices.
• Instances may occur where the BIOS and operating system lock on
putting a device at a location where you don’t want it or it conflicts
with current devices in the system. Plug-and-Play may attempt to
assign system resources (IRQs, Addresses, DMAs, or etc.) that are
already taken to incoming devices because of failure to properly
reorder and arrange multiple devices that are already in a system.
• With two components that must be compatible with and share the
same capabilities with one another, the odds of getting the two
devices to function properly begins to decrease
Future of Plug and Play
• As machines improve and Plug-and-Play approaches the peak of
it’s learning curve with its users (like all new technology), then
Plug-and-Play configuration of resources will improve, as well
as users’ ability to work with the configuration it gives them.
• Manufacturers of devices are going to be the ones that find a
way for their components to correspond with the Plug-and-Play
performance of the majority of systems.
• To solve the problems found in Plug-and-Play there must be a
stronger and stricter set of universal protocols on system
devices. If you keep all manufacturers to having to meet more
specific protocols in their devices, then Plug-and-Play can be
structured around these well-defined protocols and all
components can interact more smoothly with each other.
Conclusion
In some instances Plug-and-Play can do amazing
things without the user needing to alter many of
the settings in his or her computer. For novice
computer users and individuals with a poor
knowledge in computer structure, this may be a
lifesaver; but for others it takes out the muchdesired feeling of control and organization in
personally installing new components to their
computer system. Yet, at other times it’s claim to
be such a miracle is more like a migraine.