White Papers Bus Master and Multitasking Applications History In 1981 IBM introduced its first PC using an Intel 8088 microprocessor which had an average speed of just 500 thousand instructions per second (500 KIPs). Two years later, the first hard disk appeared in the market with only 5 million bytes (MB) of capacity. Today, a PC with an Intel Pentium processor having the speed of 50 million instructions per second (50 MIPs) can easily have a hard disk with 500 MB of capacity. In other words, both the PC processor speed and disk storage capacity were improved by 100 times. The speed of sustained data transfer from a disk drive to a PC, though an I/O adapter, has only gone up from 500 thousand bytes per second (500 KB/sec) in 1983 to just about 5 million bytes per second today (5 MB/sec), only ten times the improvement. The ten-fold difference in the speed improvement of a PC processor and that of an I/O adapter is commonly known as the "I/O Gap." As a result, the PC processor today must spend its time waiting for the I/O adapter to deliver data for processing. An IDE (Integrated Device Electronics) adapter works the same way as the original hard disk adapter that came with the 1983 IBM PC/XT computer. The integration of the original adapter to a single chip coined the phrase IDE. In 1983 the IBM PC/XT data transfer hardware was too slow to transfer disk drive data. IBM then programmed the computer processor to move disk data in order to keep up the data transfer of a disk drive. This is Programmed I/O (PIO). PIO is a single tasking design. IDE is cheap, but it does have serious performance problems. Enhanced IDE (EIDE) was created in 1991 to accelerate the IDE data transfer speed, but this new standard didn't address the single-tasking issue. SCSI (Small Computer System Interface) adapters have higher performance standards that match up fast disk drives with even faster processors. The SCSI adapter moves data using Bus Master Direct Memory Access (DMA). This frees up the processor from the single tasking model of PIO, and as such, allows several disk drives to be accessed concurrently so the data transfer throughput can be doubled or tripled. 1.PIO and Bus Master There is a significant difference between PIO and Bus Master data transfer. IDE adapters today use PIO data transfer. Using an IDE (PIO) adapter, the processor is responsible for data transfer. While the data transfer is taking place no other function can be performed. The data transfer speed is only 4-5 MB/sec for a hard disk and only 200-800 KB/sec for a CD-ROM. For the CPU to be freed up to work on multimedia applications, the Enhanced IDE I/O adapter must have bus mastering capabilities (DMA). Bus master transfer allows an I/O adapter to become the system bus master which can initiate data transfer while the PC processor is working on other tasks such as graphic image data processing. Even with bus master capability, EIDE still has the major disadvantage of being single tasking. EIDE is fine for operating systems such as DOS/Windows because they are single tasking, sending only one I/O request at a time. This environment is just fine for the single tasking EIDE adapter. However, the multitasking operating systems such as OS/2, NT, Windows 95, or NetWare will substantially increase the speed of a system and necessitate the installation of a multithreaded adapter (SCSI). The best way to read large amounts of multimedia data is to start several peripheral devices at the same time. The only effective way to do that in multitasking OSs is through a bus master SCSI. IDE/ISA* |1|8 |8 |1|8 |8 | Total access time = 34 milliseconds Enhanced IDE* |1|8 |2 |1|8 |2 | Total access time = 22 milliseconds Multitasking SCSI+ |1|8 |2 | First Drive |1|8 |1| Second Drive Total access time = 12 milliseconds * The numbers are milliseconds for an I/O request starting a request, 1 millisecond disk drive access time, 8 milliseconds data transfer time, 2 milliseconds + The second drive data transfer is held up because the SCSI bus is busy with the first drive. The second drive saves data in a buffer and sends it later at the maximum bus speed, 10 MB/sec. Many argue that a single tasking I/O adapter is just fine for DOS and Windows applications because the operating system itself is single tasking. This is true for now. However, letting a 200 MIP processor wait for I/O completion is a tremendous waste. Microsoft, IBM and Novell understand the waste. That is why they have developed Windows 95, NT, OS/2 and UnixWare. Others argue that no one needs multitasking on a PC. What they don't realize is that in Windows 3.1 the FASTDISK module can issue several disk requests to an adapter at the same time. A SCSI-2 disk can accept several dozen requests at the same time so the requests can be sorted to minimize the disk arm movement. Using FASTDISK and a SCSI-2 disk drive, the disk drive performance can be improved by 15-30%, an advantage that can not be realized by single tasking adapters. Therefore, even for Windows/DOS, there are ways to take advantage of a multitasking I/O adapter. Finally, if one spreads a ten megabyte image file over several disk drives, the file loading time can be reduced from a few seconds to a fraction of a second. Ganging several disk drives into a single virtual disk is also know as RAID-0 configuration. Reading from several disk drives concurrently requires a multitasking adapter. While it is true that it will take some time for multitasking operating systems and applications to become popular, it is inevitable that multitasking is the future. One should not hesitate to buy a multitasking operating system or adapter when everything else, especially the price, is equal. As the technology moves forward, it is inevitable that a multitasking SCSI adapter will soon be as cheap as a single tasking adapter. A recent proposal adds multitasking solution to EIDE attachment. The proposed solution is to have two IDE channels supporting two concurrent tasks and four devices. This is not exactly the same as seven concurrent tasks on a single SCSI adapter. Some SCSI adapters will accept up to 250 concurrent requests stored locally inside their chips or adapters. 2.An I/O Adapter with a RISC Processor Most SCSI adapters today have a RISC processor and IDE adapters do not. The RISC processor eliminates the need for a processor to perform bus handshakes which enable the concurrent operations allowed on the SCSI bus. Some low-cost SCSI adapters without a RISC processor support bus master data transfer and do not have a multitasking function. In order to support multitasking without the involvement of a host processor, an IDE adapter will need a RISC processor. One well known time consuming event in multitasking operating systems is called "Context Switching." When the operating system is busy with one task (in one context) and it must drop the task to help an adapter perform bus handshakes (switch to another context). The operating system needs to save the first task context and load another context in order to help the adapter. Most operating system designers understand that context switching takes an awful long time, often in many thousands of instructions and many milliseconds, and because of that try to minimize the overhead of the switching whenever possible. Now let's see how context switching affects the system performance. |1| |8 | |2*|2 | | | |2*|1| |8 | | |2*|2 | Total access time = 17 milliseconds * context switch time It simply makes no sense to spend thousands of instructions to switch the context and to perform handshakes for an adapter, when having a RISC on a multitasking adapter can eliminate the bottleneck. 3.Conclusion An IDE adapter is the original hard disk adapter of 1983 integrated into a single IC that requires programmed I/O for data transfer. Its data transfer speed is limited to only one to two MB/sec. EIDE adapter improves the data transfer speed up to 12-15 MB/sec in order to accommodate the latest hard disk drives that are capable of sustained data transfer of five to six MB/sec. (Some disk drives are advertised to have up to eight MB/sec burst data rate which should not be confused with the sustained data rate.) However, both IDE and EIDE need bus master, multitasking, and a RISC processor in order to achieve the optimum I/O adapter performance. SCSI adapters have bus master, multitasking, and RISC processor and are a more costly alternative to IDE adapters today. As all major computer manufacturers move forward to multitasking operating systems, it would be necessary to have I/O adapters like bus master SCSI that can match the processor and I/O device performance. Today a Bus Master SCSI is considered a more costly solution to IDE. Tomorrow it will become the lynch pin to connect the higher performing peripherals to your multitasking operating systems. "It is only a matter of time for a low-end product to be replaced by a high-end product at the same price."