Dec 242017
Optimize HD Interleave Factor; Better than INTLEAVE.ARC now on Board.
File HDINTLV.ZIP from The Programmer’s Corner in
Category HD Utilities
Optimize HD Interleave Factor; Better than INTLEAVE.ARC now on Board.
File Name File Size Zip Size Zip Type
HDINTRLV.DOC 24064 9180 deflated
HDINTRLV.WS 24064 10059 deflated
SPINTEST.BAS 2363 1224 deflated
SPINTEST.COM 305 291 deflated
SPINTIME.BAS 1629 946 deflated
SPINTIME.COM 162 158 deflated
TPCREAD.ME 199 165 deflated

Download File HDINTLV.ZIP Here

Contents of the HDINTRLV.DOC file


by Steve Gibson*

*President, Gibson Research Corp., Box 6024, Irvine, CA 92716

(C) Copyright 1987

The strong response received in response to Steve's Info World
TechTalk columns on the operation and importance of proper hard
disk sector interleaving prompted the publication of this guide.

As you will see below, many controller manufacturers set their
interleaving defaults too tightly for many computers. Such
"spacemanship" directly hurts the innocent computer user by
dramatically limiting his hard disk's data transfer rate. This
guide carefully explains the situation and shows how to use the
two included easily entered BASICA programs to determine whether
your own IBM PC or compatible's hard disk drives have their
sector interleave set correctly.


It's a rare person who would not wish for addditional performance
from his personal computer's hard disk drive. While much
attention is given to the drive's Average Seek Time, which is a
measure of the time required to move the read/write head from one
track to another, there is another vital detail which determines
overall hard disk performance and which is subject to the user's

We will see that the too often neglected SECTOR INTERLEAVING
factor of a hard disk has a dramatic impact on data transfer

As almost everyone knows, the information stored on a floppy or
hard disk is arranged in a series of concentric circular paths
called tracks. The disk drive's read/write head is specifically
positioned over any desired track with an operation called a
SEEK. Thus, an obvious limit on the speed with which a drive can
find or place information would be the so called track-to-track
and average seek times.

A single track of a standard IBM compatible PC contains about
nine thousand bytes of data. But since we usually deal with data
in much smaller chunks, each track is divided into smaller
sections called sectors. Think of a spinning pizza which has
been cut into seventeeen identical, and numbered, slices.
(Drives with RLL encoding pack 50% more data onto every track
resulting in more than thirteen thousand bytes per track divided
into 25 or 26 sectors.)

Now suppose that we need to read the information contained in
sector 1 of our current track. We patiently wait for sector 1 to
rotate under our read/write head, reading its data at that time.
After absorbing this freshly read information, we realize that we
also need to read the next sector, number 2. However, by the
time sector 1 has been moved into our computer and we've decided
to read sector 2, sector 2 has already started passing under the
read/write head. We have no choice but to wait for the disk to
spin all the way around once more to deliver sector 2. if we
wished to read a nine thousand byte file composed of all
seventeen disk sectors on this track, seventeen complete
rotations of the disk, one for each sector, would be required!

It wasn't long before a bright engineer realized that the entire
problem could be resolved easily by spacing the sequentially
numbered sectors out around the disk. Rather than placing sector
2 immediately after sector 1, it could be placed a few sectors
later. In this way, after reading sector 1, sector 2 would be
just about ready for reading by the time we were ready for it.
Such an elegant solution!

If, for example, sequentially (logically) numbered sectors were
staggered every three physical sectors, then each rotation of the
disk could read every third sector. Therefore only three
revolutions of the disk would be required to read an entire
track. Quite an improvement over seventeen revolutions! This
sector staggering is known as SECTOR INTERLEAVING or SECTOR
MAPPING. The physical spacing between logically consecutive
sectors is known as the INTERLEAVE FACTOR. This example used an
interleave factor of three, shown as "3:1" and pronounced "3 to

The new high-density RLL controllers need to be correctly
interleaved too. With 26 sectors per track, a non-interleaved or
mis-interleaved disk would require 26 revolutions for an entire
track transfer!

Now here's the rub: In the current environment of mix and match
highly modular personal computing, responsibility for determining
and setting your hard disk drive's optimal sector interleave
factor has "fallen through the cracks." You've never worried
about it have you? If you're inclined to believe that someone
else (like your local dealer perhaps) has, you might be a bit
surprised. Experiments with a variety of computers, drives,
controllers, clock speeds, and interleave factors have shown that

So many computers are so badly interleaved that it's quite likely
that you could increase your own hard disk's performance by
FOUR TO SEVEN TIMES just by optimally setting your disk's
interleave factor! The interleave factor can be either too
"loose" or too "tight". The result of operating with an
interleave factor which is too loose is lower performance than a

particular drive-controller-computer combination could achieve
with tighter interleaving. For example, the original IBM PC/XT
is interleaved at 6:1 but can achieve 5:1 in a standard 4.77 Mhz
machine and 4:1 in an 8 Mhz PC. This means that accelerated PC's
could be transferring at 150% of their current rate!

The consequence of operating with an interleave factor which is
too tight is more disastrous, since missing that next sector
induces the significant delay of another entire disk revolution.

You might be saying to yourself: "So what's an extra disk
revolution between friends?" However, consider this: If your
disk is properly interleaved, say with a factor of 3, the entire
nine thousand byte track will be read in just 3 disk revolutions.
However, if your particular controller in your particular
computer cannot achieve that interleave of 3, then 17 or 18
entire revolutions will be required to read the same track. This
is a difference of 600%! Since many files and most programs are
well over nine thousand bytes long, these 17-revolution track
reads add up quickly. You would certainly feel the difference
between waiting 3 seconds for a program to start up, versus 18

The AT&T 6300, for example, requires 20 revolutions for a full
track transfer when reading a disk which is interleaved at 3:1!
Even it's faster brother, the 6300 Plus, requires 14 revs! The
AT&T's transfer rate can be made four times faster with proper

Western Digital's RLL hard disk controller formats its dirves at
a default interleave of 3.. Believe it or not this interleave is
too tight for a standard 4.77 Mhz XT! Consequently 28 entire
disk revolutions are required to read a SINGLE track! If the
interleave is set to 4, then only 4 revolutions are required to
read the same data, 700% throughput boost!

So what's going on with sector interleaving out there in the real
world? What interleave factors are being used, are they correct,
and what can you do about it if not? To help you to determine
your own answers to those questions we wrote a set of short hard
disk diagnostic programs. The main program, SPINTEST, determines
exactly how many disk revolutions an IBM compatible personal
computer requires to read an entire 17 sector track from its hard
disk. SPINTEST is also fully compatible with the 25 or 26 sector
tracks used with the high-density RLL controllers.

Running SPINTEST on the many computers at Gibson Research, and in
many local computer dealerships, we discovered something quite
surprising: Most computers being sold today are horribly
interleaved. We turned up many machines which required more than
17 entire revolutions to process one full track! These same
machines flew along at 4:1 but not at 3:1.

Gibson Research has a vintage Leading Edge Model-D with a
standard Western Digital hard disk controller. This machine

always seemed to run more quickly than a newer generic PC clone
equipped with a different Western Digital controller. Both hard
disks received their original low-level (interleaving) format at
the Western Digital default interleave of 3. After all, those
dealers must have thought, Western Digital knows what's best.

Since the controller AND computer together determine the optimal
interleave, it is IMPOSSIBLE for any controller manufacturer to
set a single optimal interleave for everyone. In fact, even the
controller's revision level can be a determiner! One of our two
WD controllers ALWAYS MISSES sectors when the disk is interleaved
at 3, while the other controller makes 3:1 the same

To test this, one of our hard disks was given a low-level format
at an interleave factor of four. Afterward the SPINTEST timing
diagnostic program and a stopwatch confirmed our suspicions: An
MS-DOS file copy operation on the hard disk which had required
139 seconds when the disk was interleaved at 3:1 now took only 39
seconds at an interleave of 4:1!

Interestingly, that "slower" controller which can't make the
interleave of 3 on a standard 4.77 Mhz XT does just fine on a
faster 8 Mhz clone computer. So as you can see, the COMPUTER
makes a difference too! Any way you look at it, the issue of
sector interleaving involves the complex interaction of disk
drive, controller make and model (even the revision level),
processor, and system clock rate.


The issues of hard disk sector interleaving have gone unnoticed
for so long because there has never been a clear way to see
what's really going on deep inside a hard disk. After witnessing
the degree of interest in this topic, we decided to change this.
The two programs SPINTEST and SPINTIME determine, for any
standard MFM or RLL controller, exactly how many revolutions the
disk requires to transfer one entire track of data. The programs
were hand written in 100% machine language (as is everything
published by Gibson Research) to give them the required speed
(for measurement resolution) while keeping them small enough for
easy keyboard entry.


SPINTEST determines exactly how many revolutions your hard disk
currently requires for full track transfers. DOS transfers a
full track whenever programs or files larger than 9K are read or
written...which is most of the time. SPINTEST does NOT directly
read your drive's interleave, but its interleaving performance
can be easily inferred from SPINTEST's full track transfer
revolution count.

SPINTEST averages the time required for each of over two hundred
full track reads in order to accurately determine the revolution
count per read, then the number of revolutions required to read
just one traack and the controller's full-track data transfer
rate are computed. SPINTEST only reads data from your drive so
data is never altered.

Over two hundred track reads were used as a result of the
inconsistent disk transfer behavior of AT&T's 6300 machines.
These exhibit a maddening inconsistency in their ability to
transfer disk data. Sometimes they get the next sector, and
often not. This means that a much looser than normal interleave
generates the best overall throughput for AT&Ts. For this
reason, and to guarantee correct results on any machines which
might behave similarly, SPINTEST performs many track reads and
averages the results.


Since SPINTEST measures track read time, it must assume a given
ratio between elapsed time and disk rotation rate. Some weirdo
clone computers have a clock which runs faster than normal when
in "turbo" (8 Mhz) mode, and some lap computers have tiny hard
disks spinning at strange speeds. If these do not sound like
your situation, SPINTEST will deliver correct readings and you'll
not need SPINTIME's confirming measurements.

But if EITHER of these cases might be you (if you have a weirdo
clone computer or hard disk sporting laptop) SPINTIME will tell
you for sure. SPINTEST is only usable when SPINTIME gives
standard readings. The single (not surprising) exception to this
is for the AT&T 6300 and 6300 Plus machines. Due to the overall
problems they experience with disk transfers, SPINTIME may show a
lower-than-3600 RPM reading. For these machines this is acceptable.

SPINTIME is interesting since it determines EXACTLY how fast your
hard disk is really spinning!


The two BASIC programs: SPINTEST.BAS and SPINTIME.BAS create two
machine language programs: SPINTEST.COM and SPINTIME.COM. This
approach allows short machine language programs to be "printed"
and distributed.

The two BASIC programs differ only in their DATA statements so
you only need to enter the common upper portion once. After
entering the common part (lines 10 thru 120), give the two
commands: SAVE "SPINTEST" and SAVE "SPINTIME" (you must type the
quote marks). This saves the top portion of each. Then enter
the DATA lines for SPINTEST and give the command SAVE "SPINTEST"

again when finished. If you also wish to create SPINTIME, recall
the upper portion of SPINTIME by then typing LOAD "SPINTIME",
enter SPINTIME's DATA statements, then give the command: SAVE

When the BASIC programs have been created simply RUN each one.
The DATA statements contain a byte of "checksum" so you'll be
protected from creating a program which might "hang" your system.
If any typos are detected, you'll be notified, then returned to
BASICA to correct the typos. Only when the program's DATA is all
correct will the .COM file be created.


Okay. So now you have two new DOS commands in your directory:
SPINTEST.COM and SPINTIME.COM. To run SPINTEST, simply type its
name at the DOS prompt. The time required to run this test will
vary bwtween approximately 14 seconds for a fast 2:1 interleave
to 98 seconds for an incorrectly interleaved 26-sector RLL
encoded hard disk. So simply type: SPINTEST at the DOS prompt
and wait a minute or two.


SPINTIME has two purposes: To determine the speed of your
system's clock (if you suspect that it might be a weirdo), and to
verify that your system's hard disk is spinning at close to the
3600 RPM standard. Your system's clock is checked by timing
SPINTIME's exact exectuion time. It should require EXACTLY 60
SECONDS to run, no matter what. During that time it is busy
watching your hard disk spin, counting every revolution. After
EXACTLY 60 seconds, it displays your drive's exact RPM (within
its measuring resolution.) If SPINTIME's total execution is NOT
EXACTLY 60 seconds, OR the displayed RPM is not close to 3600,
SPINTEST's reported revolution count won't mean anything either.

SPINTIME's real value is to assure you that SPINTEST is
delivering worthwhile answers.


Both programs assume and require DOS 2.0 or higher. They operate
on your system's FIRST hard disk only (Drive C). The hard disk
must be bootable, have its controller plugged into a slot, and
must not require special CONFIG.SYS device drivers for operation.

SPINTEST and SPINTIME will never disturb your hard disk data, but
if your disk is some kind of odd-ball, they may not function

The tests will also be more accurate if your normal collection of

memory resident programs (if any) are not in memory at the time.
Many resident programs "steal" so much time from the computer
that a delicate timing analysis could be upset. It would be wise
to boot your machine from a plain DOS disketter when running
these tests for maximum reliability.

Also, turn off (or better yet remove) any disk caching software
you might be using. Disk caching intercepts the disk reading
performed by the programs and renders their measurements invalid
(and rather humorous). By the way, disk caching program
performance is significantly improved through proper disk


So now you're wondering: What do the numbers mean? How do they
compare? Should I be dancing on roof tops or wringing my
dealer's neck?

A hard disk spins at 3600 revolutions per minute, or 60
revolutions per second. A track has 17 sectors of 512 bytes per
sector. This means that data passes under your drive's head at a
rate of 522,240 bytes per second. (This number is 768,000 for
RLL controllers with 25-sector tracks.) Your system will achieve
some fraction of this maximum possible rate as determined by the
number of rotations required to read or write each track.
522,240 (or 768,000) is divided by the number of revs per track
(as SPINTEST does) to calculate your drive's data transfer rate.

Since your system's performance is meaningful only when compared
to other properly and improperly interleaved systems, the
following table will give you a feeling for where the industry

1:1 - There is a controller which achieves 1:1, unfortunately
it lacks Error Correcting Code (ECC) which is critical
for reliable operation.

2:1 - Compaq machines achieve 2:1. Adaptec's 2070A RLL
controller can do 2:1 with an 8 Mhz machine even though
their low-level formatter stubbornly refuses to allow a
setting of less than 3 !

3:1 - Newer WD controllers and many other controllers will
handle 3:1. The Adaptec 2070A RLL controller will do
3:1 in a 4.77 Mhz machine.

4:1 - Older WD controllers need 4:1; original IBM XT
controllers can do 4:1 in an 8 Mhz machine. The AT&T
6300 Plus works best at 4:1 and WD's RLL controller can

only do 4:1.

5:1 - IBM's original XT controller can do 5:1 in a 4.77 Mhz XT
but comes interleaved at 6:1. The AT&T 6300 is best at
5:1 which increases overall throughput 400% over its

6:1 - Only the original IBM PC/XT seems to have been way out
here. These machines can be tightened up, and if it has
an inexpensive accelerator, it can probably run at 4:1
for 150% disk boost.

We have seen that WD controllers which miss at 3:1 will do
beautifully at 4:1. Several InfoWorld readers have independently
confirmed that AT&T machines (with WD controllers) perform best
at the very loose interleave of 6:1. Even the old true blue IBM
controller which rns at 6:1 can always do 5:1, and even 4:1 in a
faster than 4.77 Mhz machine.


What system factors influence and determine the optimal
interleave setting for any given set of equipment? After a
sector of data has been read, it must be moved from the
controller's on-board buffer into the computer. This is done
with a process known as DMA (Direct Memory Access). The time

required to transfer the sector determines how soon the
controller will be ready to read the next sector. For this
reason add-in Accelerator "Turbo" Cards do not generally change a
machine's optimum interleave since the main system clock speed,
which continues to control DMA memory accesses, is not changed.
The less expensive "Speed Booster" products which alter the basic
system clock timing DO have a tremendous impact on optimal
interleave by running the DMA faster and thus moving the data in
and out faster.


When we began these experiments we had no idea that so many IBM
and compatible personal computers were so poorly interleaved.
Changing a hard disk's sector interleave "manually" requires
first backing-up all hard disk data onto some secure medium.
Then a low-level re-formatting is performed. This unfortunately
messy process requires the use of the DOS DEBUG command to poke
hexadecimal values into the 8088's machine registers and start
the low-level format. After this, the DOS FDISK and FORMAT
commands must be run to prepare the disk to receive the backed up
data--which must then be copied back to the drive.

Then, if the experimentally chosen interleave was not correct,
most of the process would have to be repeated with a different
trial interleave factor.

Gibson Research Corp., responding to the clear need for a better
solution to the task of hard disk sector interleaving
optimization has completely automated and streamlined this "re-
interleaving" process with a product which was designed
specifically to meet this need.

This software product quickly determines the optimal setting for
any disk of any size in any system with any clock rate. Once
determined, the existing interleave of the disk can be RESET
while leaving all data intact and in place! The product also
performs several other useful hard disk utility functions which
have never before been available. Check the information enclosed
with this guide for current product availablity and ordering
details. [See NOTE below.]




June 7, 1987

The printed listing for the SPINTEST and SPINTIME programs are
not reproduced here because both the .BAS and .COM versions are
available as accompaniments to this text file contained in ARC

Copies of the software (Hard Disk Re-Interleaving), noted in the
final paragraph of the above text, may be obtained directly by
advance payment of $29 per copy plus $1.50, per order, for
shipping and handling, from:

Box 6024
Irvine, CA 92716

(Steve Gibson writes a regular column, "Tech Talk", for
InfoWorld, The PC News Weekly. The columns on the interleave
factor were published in issues Vol. 8, No. 50, December 15, 1986
and Vol. 8, No. 52, December 29, l986.)


 December 24, 2017  Add comments

Leave a Reply