Build HD
Volume Number: 3
Issue Number: 2
Column Tag: The Electrical Mac
Build Your Own SCSI 40MB Hard Disk 
By Tim Standing, University of California at San Francisco
Tim Standing is a biochemist at the University of California, San Francisco,
studying the three dimensional structure of proteins using x-ray diffraction. At work
he uses Fortran and VAX assembly language on a Floating Point Systems 264 computer.
For the Mac, he uses MPW assembly and Microsoft Fortran, which he reports is much
faster than the VAX but very buggy.
At the beginning of the summer, I decided to build my own Small Computer
System Interface (SCSI) hard disk. I spent a month learning all I could about what
made a hard disk fast and reliable. Then I ordered the parts and assembled it. It took
me an additional three months of writing and debugging the software to make it work. I
am writing this article so that you can learn from my experience and build your own
hard disk. In the following pages, you'll find all the information that you will need to
buy the parts and assemble a SCSI hard disk. My article in next months issue of
MacTutor™ will describe a program for formatting your hard disk.
Since I knew next to nothing about electronics, the idea of building my own hard
disk seemed foolhardy at first. However, I did know quite a bit about programming and
thought that I could write the necessary software. I had installed a couple of hard disks
in IBM PC's and knew that there was nothing to it but correctly connecting up the
cables. I figured that assembling a hard disk for my Mac was probably just as easy and
that I could put one together without understanding how any of those funny looking
chips worked. I was right, I still don't know how any of them work. If you've made a
few cables before, you too should be able to make yourself a hard disk. You should
expect to spend about the same amount of time as I did assembling all the parts (about
6 hours).
This article is divided into two parts. First, I tell you what you need to know
about controller boards and disk drives. Then, I give step-by-step instructions on
assembly including a list of parts and suppliers.
Understanding Hard Disks
The SCSI interface is a standard way of communicating between microcomputers
and peripherals (such as hard disks). The communication between the microcomputer
and the peripheral is made using a parallel interface. A parallel interface sends each
data byte (eight bits) down eight wires simultaneously, one for each bit. This is much
faster than the other type of communication, serial, where all eight bits are sent down
the same wire one after another. In addition, SCSI communication uses a bus. This
means that all the devices are connected one together in a line, with the Mac at one end.
When the Mac wants to talk to a hard disk on the bus, it first sends the hard disk's
number (called an address) down the bus to see if the hard disk is there. Each device
on the bus must therefore have a unique address so that two devices won't respond to
the same command.
Your SCSI hard disk will be made of three parts: a disk drive, a controller board
and a box with a power supply. The function of the box and power supply is to protect
the electronics and to provide the necessary power. The disk drive itself stores the
information that you write to it. So what does the controller board do? The controller
board acts as an interpreter. It can determine which of the commands that come down
the SCSI bus are addressed to it and can understand what the Mac wants it to do. It then
translates these commands into something that the disk drive can understand. It tells
the disk drive where to read and write from. It also checks the data for errors. If it
finds one, it asks the disk drive to repeat the operation. Error-checking and
correction is goes on independently without the Mac knowing it.
Choice of Disk Drive
I recommend a ST225 (20 Megabyte) disk drive from Seagate or one of the
ST4000 series (also from Seagate). I've seen the ST225 advertised from a mail order
house for as little as $329 (California Digital, 17700 Figueroa St., Carson, CA
90248; (213) 217-0500). The ST4000 series comes in several sizes ranging from
20 megabytes ($500) up to 90 megabytes ($1100) and is available from Mini Micro
Supplies (see parts list for address and phone number).
I recommend that you buy a disk drive from Seagate because they have a good
track record. Although they don't have the lowest prices, they do make good disk drives
and stand behind them. If you have problems with your disk drive (like it makes a
whining noise when you start it up or doesn't start at all), double-check everything to
make sure that it's hooked up correctly. If it still doesn't work, call the technical
support folks at the place you purchased it and explain the problem. Even the best disk
drive manufactures have a 1 - 2 % failure rate mostly because the disk drives get
dropped during shipping. [Note: This rate varies depending on who you talk to. Usually,
once you get a good drive, it will remain a good drive. This applies to commercially
assembled drives as well. -Ed]
All disk drives are not created equal. There are five things you should know about
the disk drive you are thinking of buying. The first and most important is its
formatted size. Disk drives range in formatted size from twenty megabytes up to
several hundred megabytes. The size you choose depends on your needs and how much
you want to spend.
The second thing you need to know about a disk drive is whether or not it is
certified for Run Length Limited (RLL) encoding. By reading and writing at a higher
density, RLL encoding allows you to get 50% more data on a given disk drive. Not all
disk drives can operate at this higher density without making errors. RLL encoding
also requires a special controller board. If you try to use an RLL controller board with
a disk drive that is not certified for use with RLL, it may not work. I tried hooking up
an RLL controller board to a Seagate ST 4051 disk drive (non-RLL certified) with no
luck.
You should also know whether your disk drive automatically “parks its heads”
when the power is turned off. “Parking the heads” means that the heads get locked in a
special position when the disk drive is not being used so that they don't bounce around
scratching the surface of the disk. This is e specially important if you plan to carry
your hard disk around a lot. Many disk drives require a specific command to park the
heads. If the disk drive you use requires a specific command make sure the software
you use includes it.
The fourth thing that you should find out is how the disk drive moves the heads
across the disk. There are two ways of doing it. One is to use a stepper motor, like that
found in the floppy disk drives on your Mac. Like the floppy drives, these are slow.
The speed of a disk drive is measured by its average access time which is the time
needed for the head to move 1/3 of the way across the disk. All disk drives which use
stepper motors have average access times of between 65 and 90 milliseconds.
The other method of moving the heads across the disk is to use a voice coil. This
is similar to the voice coil on a stereo speaker. These are much faster and also more
expensive. The average access time for this type of disk drive ranges from 25 - 35
milliseconds. Usually these drives automatically park the heads when you turn off the
power.
The average access time will not affect how fast it takes you to read a file or start
a program when the hard disk is new, but it will after you've been using it for a while.
This is because a relatively empty hard disk stores files in sectors (512 bytes each)
that are next to each other. Reading a file on a hard disk like this does not require the
head to move much. After the hard disk fills up, files end up with each sector located
on a different part of the disk. Now the head must move a lot to read the file. Any
operation that requires you to read a small file won't be affected by average access time
(e.g. starting an application or reading a MacWrite document). However, operations
that read many files or read large files are heavily influenced by the average access
time of the disk drive. These types of operations include compiling, using a database,
returning to the Finder, or opening a folder.
Finally, you need to find out how fast your disk drive will accept step pulses. A
single step pulse tells the head to move one track over. The faster you can issue a step
pulse, the faster the head will find the track that it is looking for. The interval
between step pulses is called the step pulse timing. The step pulse timing has more of
an affect for disk drives that use voice coils than for those that use stepper motors.
When you purchase your disk drive, make sure that you find out what rate it will
accept step pulses. The choices that you have using the controller card that I
recommend are 3 milliseconds, 28 microseconds or 12 microseconds.
Older disk drives need 3 milliseconds between each step pulse. This is because
they cannot count step pulses while the head is moving and have to wait for the head to
reach the new track before they can accept the next pulse. A few years ago, disk drives
became available that accept step pulses at 35 microsecond intervals. Step pulses
issued at this speed require the disk drive to continue accepting and remembering step
pulses while the head is still moving. Each step pulse is stored in a buffer; this is
called buffered seeking. IBM adopted a step pulse timing of 35 microseconds for its PC
AT computers. This is considered slow by current standards. Most disk drives that you
can buy today will accept step pulses at 12 microsecond intervals This is true of all
the new Seagate disk drives.
Choice of Controller Board
There are at least three controller boards on the market that will work on a SCSI
bus. The one that I chose is made by Adaptec (model number ACB-4000A). It can
control one or two disk drives and has many features that make it reliable and easy to
use. Adaptec also makes a RLL version of this board called the ACB-4070. I know that
the formatting program that I have written works with the ACB-4000A controller
board, but I don't know if it will work with controller boards from other
manufacturers.
The Adaptec controller board allows you to use any interleave from 1 to 16 (if
you don't know what interleave is, you should skip ahead and read the section entitled
“What is Interleave”). The driver that I have written performs best with an
interleave of 3.
Choice of Box and Power Supply
Most of the boxes which you've seen advertised in the back pages of IBM PC
magazines will work for this project. You need to decide whether you want room for
one or two disk drives. I bought a box for just one disk drive. It is an ugly grey color
and even looks sort of like an IBM PC. I wrote “IBM sucks” across the front of the box
just so my Mac wouldn't think that it was about to be replaced.
When you buy a box, get one with a power supply. Make sure that you get a
switching power supply as these are less prone to interference from your refrigerator
or your landlord's vacuum cleaner. A switching power supply uses a sophisticated high
frequency circuit rather than large capacitors to regulate output voltage. As a result,
they are smaller, lighter, and create less heat.
What is Interleave
The interleave factor describes how many sectors on a track are skipped before
reading the next one. This number is tuned to the speed of your software. If your
software can't keep up with the disk drive operating with a given interleave, reading
and writing will actually go slower. The smaller the number the faster you can read
and write information. An interleave of 1 means that you read each sector in the order
that it occurs on the track. An interleave of 2 means that you read one sector, skip one
sector. An interleave of 3 means that you read one, skip 2, read one, skip 2, etc. By
skipping two sectors, you give the Mac time to catch up with the incoming data.
In order to use a smaller interleave number you must have faster software. The
driver that I have written works best using an interleave of 3. This limitation comes
from the way that the SCSI manager was written by Apple. If I have the time this
winter, I'ld like to rewrite the SCSI manager to make transfers faster. Taking
advantage of this will require reformatting your disk with a smaller interleave
number.
Read Precompensation and Write Current Reduction
As the head moves towards the center of the disk, data are written closer together.
The exact method of reading and writing has to be altered slightly to compensate for
this higher density. The Read Precompensation number and the Write Current
Reduction number determines the first cylinder which requires these different read
and write signals. You will need these two numbers in order to correctly low level
format your hard disk.
When you buy your disk drive, make sure that you find out what values to use for
Read Precompensation and the Write Current Reduction. For a Seagate ST225, the
Read Precompensation is 300. The Write Current Reduction is calculated by the disk
drive itself, so you should use a value of 0. For the Seagate ST4000 series of disk
drives, both of these numbers are calculated by the disk drive, so you should set both
of them to 0. If you buy a Seagate disk drive and don't know what values to use, you can
call Seagate Technical Support at (408) 438-5333.
Static Electricity
The chips used on the disk drive and controller board are very sensitive to static
electricity. These chips contain very small transistors that can easily be burned out
by small sparks. Therefore, both your controller board and disk drive will arrive in
static shielding bags with huge warning labels all over them. If you are like me, you'll
be totally intimidated by these labels and afraid to open the bags and take things out.
Here's what you have to be careful with to avoid frying any of these chips.
Leave everything in its bag until you are ready to use it. This will protect the
parts from all sources of static electricity. When you're ready, spread out some
aluminum foil and place the parts on the foil. Touch only the sides of the controller
board and the metal frame of the disk drive when handling them. Avoid touching the
components or any metal on the controller board or the disk drive board (this includes
the connectors). If you must touch the components or connectors to plug in a cable,
you should first touch both hands to the foil and then to the metal frame of the disk
drive. By doing this immediately before you touch any static sensitive parts, you will
discharge all the static electricity that has built up on your hands. If you have to
service your hard disk after you've put it all together, you should observe the same
precautions. If you follow these simple rules, you shouldn't have any problems.
Termination
What is termination and what do you need to know about it? Termination is a
method of reducing noise caused by signals bouncing off the ends of the wires. This
type of noise is a problem on any high frequency data bus like a SCSI bus. It is called
termination simply because it is something that is done to both ends of the bus.
Termination is accomplished by taking resistors and placing them on all of the data
wires. Two resistors are used for each of the eight data lines. One of these resistors
goes between the data wire and ground, and the other goes between the data wire and +
5 volts.
Although Apple should include termination inside the Mac Plus, they don't. They
tell you that only the device closest to the Mac and the device furthest away from the
Mac should be terminated. If you only have one device (excluding the Mac), then you
only need one terminator. If you have two or more devices you will need two
terminators. Terminators can be bought from your local Apple dealer (Apple part
number M2559).
Assembly Instructions
As I said in the beginning, it took me 6 hours to put all the hardware together. If
you have assembled everything correctly, it will take no more than 30 minutes to do
the formatting.
Tools Needed
Tool: What you need it for:
Regular Screwdriver Putting the parts together
Philips Screwdriver
Soldering Iron There are only 12 wires that need soldering.
Pliers For attaching connectors to ribbon cable.
File, Hacksaw, Drill For adding new slots for connectors on the back
panel of the box that you use.
Volt Ohm Meter To check that cables are made correctly.
Magic Marker
Heat Shrink Tubing
Parts List