In the Forums...
Posted: October 24, 2000
Written by: Tuan "Solace" Nguyen
Before we begin, if you have questions on how something in or around your computer works, feel free to jump to our Articles section. There youíll find a handful of How It Works articles explaining some of the most asked about hardware devices.
This time around instead of addressing questions about how a piece of hardware physically works, weíre going to address something a little more digital.
Have you ever wondered how information from one device travels to another device in your system? Have you ever purchased a hard drive and wondered what PIO mode or DMA mode is? Well Tweak3D is where youíre going to find answers. Letís take a look at how PIO and DMA work.
PIO Mode Transfer
The data transfer method requiring the least amount of hardware is called Programmed input/output or PIO. PIO was used by the WD1003, the hard disk controller used by the first PC/AT. PIO employs the CPU to move data between the peripheral controller card and the computer's memory. The 80286, 80386 and 80486 microprocessors used in PCs are well suited to this task since they can move blocks of data with a single String Move instruction. This fast data move instruction allows PIO transfers to reach speeds of about 2.5 Mbytes/sec.
While not in use anymore, PIO mode transfers were used in older hard drives back a few years ago when DMA and UltraDMA mode transfers didnít exist. This is true for CD-ROM drives too. Letís take a look at how PIO mode would work if you were copying information from your CDís to your hard drive.
First the data is read from your CD and sent down the IDE bus into the controller. From there the data is retrieved by the CPU and stored into its registers. Registers are allocation units inside a processor that stores data to be executed and processed. From there, instructions stored in software (either in BIOS or Operating System) dictate which way and how that data is to be used and is then directed into system memory to be used by other devices.
This is called Programmed I/O because programmable software instructions can command data from a peripheral device into the appropriate data path. At first this seems like a swell idea because of the control but because the CPU is the middleman in the dataflow, it slows down traffic. Of course, if you have a burly CPU, you donít really notice any slowdown but thatís because you havenít experienced DMA.
A typical path for letís say, CD data to get from your reader to your hard drive is:
Reader > IDE Controller > CPU > System RAM > CPU > IDE Controller > hard drive.
Thatís a lot of steps! This is very inefficient and there is a better way of transferring data to and from devices. The same condition would hold true for information that is already stored in system memory and needs to be directed to some device.