Overview
The hard disk can have a huge impact on the performance of your PC: The fact is that the rotating magnetic media of the hard disk is one of the severest performance bottlenecks, causing second long delays while fat programs spin off the disk and into RAM. Whereas disk access times are measured in miliseconds, system RAM performance is counted in nanoseconds. Understanding hard disk operation and optimizing can eliminate teeth-grinding delays.
How does a HDD work?
The factors that affect the speed of a harddisk:
- Rotation speed
- Number of sectors per track
- Seek time / head switch time / cylinder switch time
- Rotational latency
- Data access time
- Cache on the HD
- How data is organized on the disks
- Transfer rates
- Interface (EIDE / SCSI)
What are sectors, tracks, heads and cylinders?
On a harddisk, data is stored in the magnetic coating of the disk. The so called head, held by an actor arm, is used to write and read data. This disk rotates with a constant turn time, measured in revolutions per minute (rpm). Data is organized on a disk in cylinders, tracks and sectors. Cylinders are concentric tracks on the surface of the disk. A track is divided into sectors. A harddisk has a head on each side of a disk. Nowadays, the actuator arm is moved by a servo-motor (not a step-motor which needs more time while swinging in after moving over the desired track). All harddisks have reserved sectors, which are used automatically by the drive logic if there is a defect in the media.
Rotation Speed
Typical harddisks have a rotation speed from 4,500 to 7,200 rpm, a 10,000 rpm drive just hit the market. The faster the rotation, the higher the transfer rate, but also the louder and hotter the HD. You may need to cool a 7200 rpm disk with an extra fan, or its life would be much shorter. Modern HD’s read all sectors of a track in one turn (Interleave 1:1). The rotation speed is constant.
Number of sectors per track
Modern harddisks use different track sizes. The outer parts of a disk have more space for sectors than the inner parts. Usually, HD’s begin to write from the outside to the inside of a disk. Hence, data written or read at the beginning of a HD is accessed and transferred faster rate.
Seek time / head switch time / cylinder switch time
The fastest seek time occurs when moving from one track directly to the next. The slowest seek time is the so called full-stroke between the outer and inner tracks. Some harddisks (especially SCSI drives) don’t execute the seek command correctly. These drives position the head somewhere close to the desired track or leave the head where it was. The seek time everyone is interested in is the average seek time, defined as the time it takes to position the drive’s heads for a randomly located request. Yes, you are correct: seek time should be smaller if the disk is smaller (5 1/4″, 3 1/2″ etc.).
All heads of a harddisk are carried on one actuator arm, so all heads are on the same cylinder. Head switch time measures the average time the drive takes to switch between two of the heads when reading or writing data.
Cylinder switch time is the average time it takes to move the heads to the next track when reading or writing data.
All these times are measured in milliseconds (ms).
Rotational latency
After the head is positioned over the desired track, it has to wait for the right sector. This time is called rotational latency and is measured in ms. The faster the drives spins, the shorter the rotational latency time. The average time is the time the disk needs to turn half way around, usually about 4ms (7200rpm) to 6ms (5400rpm).
Data access time
Data access time is the combination of seek time, head switch time and rotational latency and is measured in ms.
As you now know, the seek time only tells you about how fast the head is positioned over a wanted cylinder. Until data is read or written you will have to add the head switch time for finding the track and also the rotational latency time for finding the wanted sector.
Cache
I guess you already know about cache. All modern HD’s have their own cache varying in size and organization. The cache is normally used for writing and reading. On SCSI HD’s you may have to enable write caching, because often it is disabled by default. This varies from drive to drive. You will have to check the cache status with a program like
You may be surprized that it is not the cache size that is important, but the organization of the cache itself (write / read cache or look ahead cache).
With most EIDE drives, the cache memory of the harddisk is also used for storing the HD’s firmware (e.g. software or “BIOS”). When the drive powers up, it reads the firmware from special sectors. By doing this, manufacturers save money by eliminating the need for ROM chips, but also give you the ability to easily update your drives “BIOS” if it is necessary (Like for the WD drives which had problems with some motherboard BIOS’ resulting in head crashes!).
Organization of the data on the disks
You now know, a harddisk has cylinders, heads and sectors. If you look in your BIOS you will find these 3 values listed for each harddisk in your computer. You learned that a harddisk don’t have a fixed sector size as they had in earlier days.
Today, these values are only used for compatibility with DOS, as they have nothing to do with the physical geometry of the drive. The harddisk calculates these values into a logical block address (LBA) and then this LBA value is converted into the real cylinder, head and sector values. Modern BIOS’ are able to use LBA, so limitations like the 504 MB barrier are now gone.
Cylinder, heads and sectors are still used in DOS environments. SCSI drives have always used LBA to access data on the harddisk. Modern operating systems access data via LBA directly without using the BIOS.
Transfer rates / Mappings
In the pictures you can see the several ways how data can be stored physically on the harddisk. With a benchmark program that calculates the transfer rate or seek time of the whole harddisk you can see if your drive is using a ‘vertical’ or a ‘horizontal’ mapping. Depending on what kind of read/write heads and servo-motors (for positioning the actuator arm) are used it is faster to switch heads or to change tracks.
Vertical Mapping
Traditional harddisks orders their capacity in ‘vertical’ mapping. The data is read/written from one cylinder first, starting at the top track down to the bottom, before the heads are moved to the next cylinder.
Horizontal Mapping
The ‘horizontal’ mapping. The data is read/written starting from the outer cylinder to the inner cylinder, before switching the heads to the next track.
Vertical and Horizontal Mapping Combined
Some harddisks use a combination of ‘vertical’ and ‘horizontal’ mapping.
As you can see in the above pictures, transfer rate is higher when data is read or written to the outer parts of a disk. The reason is that there is more space for sectors. The number of sectors varies in steps. Usually on a disk there are 10 to 20 zones (called ‘notches’) with a constant sector number. That’ the reason why you see the steps in the transfer rates.
Some harddisk use the combination of ‘vertical’ and ‘horizontal’ mapping. The ‘horizontal’ mapping is used in the zones, the ‘vertical’ mapping between the zones. However, transfer rate and seek time look the same to ‘vertical’ mapping.
If you are going to buy a HD you have may need to know what kind of mapping the drive does. If you need constant transfer rates (for video, audio) you should get a drive which doesn’t do the horizontal mapping. However, drives with horizontal mapping are not very common.
The Interface (EIDE / SCSI)
Currently there are 2 different common interfaces: EIDE and SCSI. You will find an EIDE controllers integrated with the motherboard and that EIDE harddisks are much cheaper than SCSI drives. For SCSI you need an extra controller, because there aren’t a lot of motherboards with integrated SCSI controllers. Together with the higher price of a SCSI disk a SCSI system is more expensive than EIDE.
The EIDE interface has a primary and a secondary channel that will connect to two devices each, for a total of four. That could be a harddisk, CD-ROM or disk changers. Lately there have been tape backups with EIDE connectors, but you need special backup software.
Scanners for example aren’t available with EIDE interface, only with SCSI. You can connect up to 7 devices to a SCSI bus or 15 devices to a Wide SCSI. In a standard environment, the performance of single harddisk won’t improve much from the SCSI interface. Rather, the power of SCSI is that several devices can use the bus at the same time, not using the bus while they don’t need it. So, we see the best benefit from SCSI when several devices are all used on the same bus.
On one EIDE channel, the 2 devices have to take turns controlling the bus. If there is a harddisk and a CD-ROM on the same channel, the harddisk has to wait until a request to the CD-ROM has finished. Because CD-ROM’s are relatively slow, there is a degradation of performance. That’s why everbody tells you to connect the CD-ROM to the secondary channel and your harddisk to the primary. The primary and secondary channels work more or less independently of one another (it’s a matter of the EIDE controller chip).
The SCSI interface comes in several types. 8-bit (50 wire data cabel) or 16-bit (68 wire data cable, Wide SCSI). The clock can be 5 MHz (SCSI 1), 10 MHz (Fast SCSI), 20 MHz (Fast-20 or Ultra SCSI) or 40 MHz (Ultra-2 SCSI).
Possible theoretcial transfer rates of the SCSI bus | ||
SCSI bus clock | 8-bit | 16-bit |
5 MHz (SCSI 1) | 5 MBytes/s | NA |
10 MHz (Fast SCSI, SCSI II) | 10 MByte/s | 20 MByte/s |
20 MHz (Fast-20, Ultra SCSI) | 20 MByte/s | 40 MByte/s |
40 MHz (Fast-40, Ultra-2 SCSI) | 40 MByte/s | 80 MByte/s |
The theoretical transfer rate of EIDE is up to 16.6 MByte/s in PIO mode 4 or multi DMA mode 2 (soon
Possible theoretcial transferrates of the IDE bus (ATA) | |
single word DMA 0 | 2.1 MByte/s |
PIO mode 0 | 3.3 Mbyte/s |
single word DMA 1, multi word DMA 0 | 4.2 MByte/s |
PIO mode 1 | 5.2 MByte/s |
PIO mode 2, single word DMA 2 | 8.3 MByte/s |
Possible theoretcial transferrates of the EIDE bus (ATA-2) | |
PIO mode 3 | 11.1 MByte/s |
multi word DMA 1 | 13.3 MByte/s |
PIO mode 4, multi word DMA 2 | 16.6 MByte/s |
Possible transferrates of Ultra-ATA (Ultra DMA/33) | |
multi word DMA 3 | 33.3 MByte/s |
It is not only the interface transfer rate that determines how fast a harddisk is. How fast the data can be written or read from the media, e.g. data density and rotation speed is more important. The fastest interface can’t do anything faster than the ‘inner values’ of a harddisk are capable of. Today, most harddisks are still under 10 MByte/s transfer rate physically. A faster interface is advantageous on when data is read from or written to the cache in a multitasking environment with several devices accessed simultaneously.
Multitasking environments especially benefit from SCSI, since simultanoues access occurs frequently. If you have a server or are working with large files like audio, video or disk-intense applications, you will benefit more from SCSI than EIDE. There are three reasons for this:
- All modern operating systems now supports SCSI very well. Windows 3.x didn’t!
- Busmastering really works better with a SCSI busmastering controller.
- The fastest harddisks with the best performance are SCSI.
If you need large capacities and the highest transfer rates available on the market you need SCSI. This is not because EIDE is incapable of this, it’s because of the market. High-end disks with high capacities and high performance are intended to be used in servers and aren’t build with EIDE interface. At the moment, EIDE disks are only built with up to a 5 Gigabyte capacity (there is a problem with a 4 GB barrier with some BIOS’s again and for drives bigger than 8 GB you need a new BIOS that supports the INT 13 functions AH=41h bis 49h) and transfer rates of about 9 MBytes/s. If you need more, you’ll have to use SCSI. Also, SCSI harddisks have larger cache RAM than EIDE harddisks.
Performance, some thoughts
You need to know how a slow or fast harddisk affects your overall system performance in a standard enviroment. If your operating system isn’t constantly swapping (e.g. you have enough memory) the speed of a harddisk is only a small part of a well balanced system. Let’s say you have a harddisk that has 30% better performance than another older one; the benefit for standard applications would be from 2% up to 18%. Sometimes, you want or need the fastest components available. Other times, more capacity and reliability is needed.
There are several programs available that test the performance of a harddisk. Some are crap, others are good. In any case, if you have one, you get numbers that tell you something. But do you have a point of comparison? Different benchmarks mean different numbers. Different environments mean different numbers. Modern benchmarks are independent from existing data on the harddisk (only read performance testing can be done). But a benchmark could be affected by several things:
- To which channel is the harddisk connected
- Is the harddisk alone or together with other devices connected to the controller
- Under which operating system is the harddisk tested and used
- Which drivers are loaded or not loaded.
- Testing at Monday or Friday etc.
The File System
If you purchase a new harddisk it is physically pre-formatted . This means that the cylinder, track and sector information is already written onto the disk. You now have to partition the disk to prepare it for the logical formatting and writing the partition information and boot sector to the disk. You don’t have to use (or you aren’t able!) the whole harddisk with one partition. You can divide it in several partitions. Depending on the operating system there are several file systems option. Famous file systems are FAT (DOS, Windows), NTFS (Windows NT) and HPFS (OS/2).
FAT12/16
DOS, including DOS 7.0 of Windows95 uses the FAT (File Allocation Table) filesystem to store data to floppies- and harddisks. The FAT organizes several sectors into clusters and uses 12- or 16-Bit-cluster address numbers. The 16-Bit FAT is able to address up to 65526 clusters (some are used for special purposes). A cluster can be as big as 32 KBytes, which translates into a maximum partition size of 2 GBytes. The side effect is that every file takes up at least 32 KBytes, even if it is only one kByte in size. That is the reason why power users like us divide a harddisk into slightly less then 512 Mbytes per partition–then ‘only’ 8 KBytes per cluster are used and you don’t waste to much of your limited space on the harddisk. You can check your cluster size with chkdsk.exe at the DOS-prompt. Partition magic is a utility that lets you change partition size without loosing the data on your harddisk.
Overview of partition size and correspondending cluster size | |
Partition size | Cluster size |
2 GByte | 32 KByte |
<1 GByte | 16 KByte |
<512 MByte | 8 KByte |
<256 MByte | 4 KByte |
<128 MByte | 2 KByte |
Some more info about FAT32 can be found at
The Windows95 OEM service Realease 2 (Version 4.00.1111, DOS 7.1, shows as version 950b) now ships with a FAT size of 32 Bits. 4 Bits are reserved, hence 228 clusters can be addressed. This allows for partitons of up to 8 Gbytes with clusters of only 4 Kbytes in size. The maximum size of a partition is 2 TByte (2048 GByte). Compared to FAT16, FAT32 doesn’t have a fixed size for the root entries, so you can now store as many directories and files you want in the root of your drive. Without changes, DOS applications can only access files which aren’t bigger than 2 GBytes, and Win32 applications can work with files up to 4 GBytes. Wow! you think, that’s great. Yes, I got really excited about these features, but don’t stop reading here!
FAT32 partitions are only accessible from this new Windows95 and the included DOS 7.1. No other operating system can access any data, including the really new Windows NT 4.0. All disk utilities that aren’t written for FAT32 wont work correctly with the new file system. If you are lucky, your disk utilities just wont work. If you aren’t lucky, they will destroy your data.
The ever changing LINUX now supports FAT32 partitions and there is a utility called
Just today the release version of
Eventually third party vendors offer FAT32 drivers for Windows NT 4.0 and Windows 2000 will have native FAT32 support.
Windows95 OSR 2 ships with new versions of FDisk, Format, Scandisk and Defrag that can work with FAT32 partitions. However, the included DriveSpace3 doesn’t! You can’t use DriveSpace3 with FAT32 partitions! But that’s not all: There are existing API’s that don’t work with FAT32 partitions, so some of your programs might not work as well. MS-DOS block device drivers like the often needed ASPIDISK.SYS for SCSI drives have to be revised to work with FAT32 drives! You now know how excited I was after I discovered that I can’t access my SCSI harddisk in DOS 7.1 anymore, because I use it without BIOS support, only via a device driver.
But that’s not all! There is a noticeable decrease in performance with FAT32 drives compared to FAT16 drives! I first noticed this when I defraged my harddisk – the operation took much longer than usual. I wanted to be sure, so I tested the harddisk with Winbench. The DiskWinmark96 for an EIDE harddisk decreased by about 3% with Windows95 build 1111 FAT32 vs. FAT16. Under Windows95 build 1111 with FAT32 compared to Windows95 build 950a with a FAT16-drive of same size, the DiskWinmark96 decreased about 6%. The accessing of many small files was recognizably slower. Not only FAT32 is slower (which is due to the larger amount of clusters), the new build of Windows95 is slower with harddisk access in general! This doesn’t mean that FAT32 is necessarily slower, this means that Microsoft did something with harddisk access in their new Windows95 OSR 2 that decreases harddisk performance in some way. It is not the EIDE driver; I also measured and saw performance decrease with other EIDE-drivers.
The application benchmark Winstone96 wasn’t affected very much by this behavior. I always measured lower values with the newer build and also with FAT32, but that could have been from measuring errors. The difference was too small to say it is affected. Unfortunately, the BAPCo doesn’t run on the new build of Windows95, but I guess it also won’t show much difference in performance. That is due to the very small impact of the harddisk on these benchmarks. It would play a greater role if you only had 8 MB RAM.
Conclusion:
If you can, use build 950 (version 950a) of Windows95 and use partitions close to 512 MBytes with 8 KByte clusters. If you have build 1111 (version 950b) of Windows95 you can also use FAT32 drives with 4 KByte clusters to save space, especially with bigger partitions. Or to get rid of all these problems use another operating system which uses a different file system 😉
The OSR2 DOS command ‘FORMAT’ has an undocumented switch ‘/Z:n’ where n * 512 bytes = cluster size, so you can set your own cluster size! The default cluster size is 4096 bytes = 4 kbyte. But be careful, smaller cluster size means millions of clusters, hence the management of them consumes more time.
Of course, there is a performance hit (look above!), which is measurable with benchmarks, but hardly recognizable by human. But it’s getting really worse if you SCANDISK or DEFRAG (DISKDOCTOR or SPEEDDISK with Norton Utilities) your disk.
I formatted a 2.5G EIDE disk with clusters of 1024 bytes size. (512 bytes is not possible). Yes, I dare nothing! 😉 Now the 2.5G HDD has 2,480,338 (yes, nearly two and a half million) clusters of 1024 bytes. Even the FORMAT command warned me that this cluster size is very small and may result in a performance impact! Nice, but who trusts programs?
I put back about 1.2 Gbyte of data and programs and was first impressed about the larger amount of free space. Then I run SPEEDDISK … it is ridiculous! I am not a programmer and have no insight of how disk utilities works, but it seems that they hold the whole FAT and some more stuff in memory. The size of SPEEDDISK in memory swallowed up to 50 Mbytes while optimizing the disk! Currently my poor PC only have 32 MB of RAM. So Windows started to swap around.
Similar problems with SCANDISK and DISKDOCTOR: They work for ages messing around with the millions of clusters. You better run these programs alone with nothing else loaded and don’t disturb them in any way!
The DOS version of SCANDISK and DISKDOCTOR are running endless while checking the allocation table. DISKDOCTOR for DOS eventually ended up with a low memory error. Hmm, I wonder why the heck it wants to store everything in memory? Now I turned off the automatically check of the harddisks at bootup after a Windows95 crash. As stated before, the Windows version of these programs are slower now, but that’s nothing compared to the DOS versions!
So what? All I want to say is: Use the /Z switch of the FORMAT command with care and use partitions! Microsoft better had build NTFS into Windows95. I’ve never seen such problems with NTFS. (I guess all Linux freaks are laughing now! 😉
The Bus Master DMA Feature of the Triton
Everybody knows this already – the Intel PCIsets 430 FX, HX VX and TX include the PIIX (PCI ISA IDE XCELERATOR), which is capable of transfering data between an EIDE device and the memory via DMA (Direct Memory Access) by using Bus Mastering. This means that data is transferred (more or less) directly from the HDD to main memory without using very many CPU resources. Also the new Multi Word DMA Modes introduced by the EIDE/Fast ATA specifications are able to transfer data just as fast as the new PIO (Programmed Input/Output) Modes. The advantage of using the Bus Master DMA is that it uses less CPU resources than PIO and therefore it’s of particular benefit in multitasking environments, where the CPU can work on a different program while data is transferred to or from the HDD.
However, the way of the data from the harddisk into the memory is devided into two parts: From the drive to the chipset’s EIDE interface and from the EIDE interface into the memory. The BIOS of the PC sets the EIDE interface of the chipset to use busmaster transfer between the drive and the interface. The busmaster driver is needed, to initiate the DMA transfers between the interface and the memory. The busmaster driver can switch on the DMA transfer between the drive and the interface, but if this isn’t properly supported by the BIOS it will use PIO mode instead. However, the transfer from the EIDE interface into the memory can still use DMA.
If you want to use this feature, you’ll need a driver for your specific OS. There is no option in any BIOS so far to enable or disable it, so don’t bother about your BIOS, you’ll just need the right driver. Since Windows 95 seems to be the most popular OS so far, here the…
Windows 95 IDE Bus Master DMA Drivers
You can find any busmaster driver available at
In the new so called Windows95 service release 2 (which is only sold as an OEM-product to PC manufacturers) you now have a DMA capable driver included (name is still ESDI_506.pdr). DMA mode can be switched on or off in the drive proberty screen in system manager.
Windows98 supports Busmastering for most Chipsets
Problems with the Bus Master DMA Drivers under Windows 95
The most common problem with these drivers I came across so far are with an ATAPI CD-Rom drive or a NON EIDE HDD, which also is connected to the EIDE interface and isn’t recognized by the driver. In other words: You install the driver and your CD-Rom and older harddrive have disappeared.
We also have all come across the delayed Windows 95 boot up problem, which seems to annoy a lot of impatient people. If you have a look into the System Manager you’ll find a not working second IDE port in case you haven’t connected anything to it. The solution to this problem is the same.
One very good answer to this problem is to get the DMA driver working on one EIDE port and the default PIO driver on the other (to connect the CD-Rom or old hard drives or to get rid of this non functioning second IDE port).
After installing the Bus Master Driver you simply have to change the registry (always back up registry before changing it !!!!!):
- find HKEY_LOCAL_MACHINE/System/CurrentControlSet
/control/Services/Class/hdc - there should be four subdirectories 0000–0003
- find the one where DriverDesc is something like “Primary Bus Master IDE controller” or “Secondary Bus Master IDE controller“, according to the port you want to change (should be 0002 or 0003).
- in this subdirectory you change PortDriver from “ideatapi.mpd” to “ESDI_506.pdr”
- if you want to, you can change DriverDesc to something like “Standard IDE/ESDI controller“, to make it look more correctly in your Systems Manager
- reboot
Now this EIDE port is using the default PIO driver and you easily can use CD-Roms or non EIDE hard drives on this port.
A different solution to this problem seems to be keeping the data wires to the HDDs/CD-Roms as short as possible, which does the trick Mount the drives properly, they should be grounded !
Another trick that may shorten the startup time, is to start Windows95 in safe mode and delete all drives in System-Manager. Don’t worry, with the next start up of Windows95 they will be recognized again.
Here a new suggestion from Gerwin de Wit. He has two HDDs, both of which are connected to his primary IDE port and an ATAPI CDRom on the second port configured as SLAVE – so there’s only a slave drive running at his second IDE port! This obviously works just fine with the Bus Master IDE Driver – when the CD-ROM was configured as a Master, it would not work. His CDRom is a Teac CD-56E. I just wonder what happens if you add a new 3rd HDD and configure it as 2nd Master…
- Cheers Gerwin !
Who ever has got problems with his PIIX3, coming with the Intel chipsets 430HX, 430VX and 440FX, should have a look at