[comp.sys.mac] DIY SCSI... It's done!

hedley@imagen.UUCP (Hedley Rainnie) (09/15/87)

A few months ago there was a flurry of talk about this.
Well I successfully built a 20MB HD system for a 512Ke mac. Rather
than paying $90 for a SCSI clip on I built my own with 2 chips
a PAL and the NCR5380 (act. AMD) The controller I got was the 
Adaptec 4000A and the drive a Seagate ST225. The software was 
provided by Ephriam Vishniac and rather than donate blood I am sending
him $10. Everything seems to work except the disk must be mounted via
floppy rather than auto booting, I have the old 128K ROMS's, Does anyone
know what 30bytes were changed in the ROM to correct the booting problem?
It would be nice to be able to boot directly and unlike a system update
it it much harder to get a ROM update.

I will write all my efforts up if there is interest, i.e. pictures doc
etc...

Cheers, Hedley
{decwrl|sun}!imagen!hedley

khayo@sonia.cs.ucla.edu (Erazm J. Behr) (09/17/87)

Another "yea" vote here! I'd like to see the whole description.
(sorry for posting - mail bounced)
Thanks...................                           Eric

----------------------------------------------------------------------
          >>>>--------------->         khayo@math.ucla.edu

puckett@decwrl.UUCP (09/18/87)

I'd like to see a full description of the DIY SCSI, drawings and all.
If you have time to write it up, please post to comp.sys.mac and/or
mail it to me (not sure what mail path as I'm out on the digital easynet)
I have others here who would be interested as well as the general net
population...

= Giles Puckett =

Sydney Australia Telephone Support Centre VMS/Communications Digital Equipment
Easynet: SHEILA::PUCKETT
Phone: (61) (02) 412 5148 wk / 452 4506 home

jww@sdcsvax.UUCP (09/18/87)

In the September batch of Tech Notes, #159 finally addresses
the issue of "How do I build my own SCSI drive?"  I would say,
overall, it's no more encouraging than, say, writing your own
printer driver.

I suppose this is yet another confirmation that the Mac is
a business PC, not a hacker's PC.  It's hard to imagine that
a for-profit company would make any other choice.

___________________________________________________
Macintosh Technical Notes


#159: Hard Disk Hacking


See also:	Technical Note #96QSCSI Bugs
		Technical Note #134QHard Disk Medic
		Device Manager

Written by:	Bo3b Johnson	September 1, 1987
___________________________________________________
For those of a technical bent with some extra time,
you can build your own hard disk system from a cheap
SCSI drive and a driver that you write.  This is not
a project for those short on time, so beware.
___________________________________________________

We often get questions regarding the feasibility of
connecting a TgenericU SCSI drive to the Macintosh,
usually the Macintosh II.  It is possible to use a
standard drive, but it is important to be aware that
there is a reason why a fully assembled drive costs
more.  When buying a hard disk you have two choices:

	1) buy a fully assembled drive, formatting and
driver software included

	2) buy the pieces necessary to assemble your
own:  the drive itself, power supply if needed,
cables, and development system to write a driver and
formatter.

The second choice will often appear to be cheaper,
since you donUt have to pay for a fancy case with a
fancy label.  However, you are also missing the
chance to pay for some fancy software that took some
fancy amounts of time to write.

Do not underestimate the difficulty of building your
own hard disk.  SCSI drives are only partially
standardized so a driver written for one drive will
probably not work (at least not well) on another
drive.  All drives come with a formatting utility
that also contains a driver for reading and writing
sectors to the disk. For example, the Apple drives
come with a program called HD SC Setup.  Most
third-party drives have a similar utility that is
specific to their drive.  The formatting operation
varies widely depending on the drive, and the driver
also may have to know about specific timing problems
with a given drive.  HD SC Setup can only support
the drives which we produce.  

If you decide that you want to hack together your
own drive, you will need to write this
formatter/driver program.  It is non-trivial, and
this is part of what you pay for when you buy an
off-the-shelf drive.  If you have the time, you may
save some money.  If you are writing your own
formatter/driver program we can help you with
problems you run into, but you must be familiar with
SCSI terminology, the SCSI Manager, and be able to
use an assembly level debugger like Macsbug or TMon. 
You may run into timing difficulties that require
the use of a logic analyzer or SCSI analyzer to
resolve.

This may sound like it is hard to write your own
driver.  It is.  This may sound like we are trying
to scare you off from writing your own driver.  We are.

-- 
	Joel West  (c/o UCSD)
	Palomar Software, Inc., P.O. Box 2635, Vista, CA  92083
	{ucbvax,ihnp4}!sdcsvax!jww 	jww@sdcsvax.ucsd.edu
   or	ihnp4!crash!palomar!joel	joel@palomar.cts.com

sl@van-bc.UUCP (Stuart Lynne) (09/21/87)

In article <3898@sdcsvax.UCSD.EDU> jww@sdcsvax.UCSD.EDU (Joel West) writes:
>In the September batch of Tech Notes, #159 finally addresses
>the issue of "How do I build my own SCSI drive?"  I would say,

.... misc. warnings etc deleted to save space

>This may sound like it is hard to write your own
>driver.  It is.  This may sound like we are trying
>to scare you off from writing your own driver.  We are.

I built my own when the Mac Plus first came out. While they make some
obvious points about the difficulty involved they are going overboard a bit.
I make no pretense to being Joe C/Asm Hacker, don't know +5 from ground and
had never worked with SCSI.

It took me less than two weeks to get something useable. Some of *that* time
was implementing the SCSI driver hooks (this was late '85, before you get
get the libraries etc from Apple or anyone else); and debugging Apple's ROM
driver to get Blind transfer's to work. 

Given the level of knowledge available about the subject matter, and
availability of misc. bits of software I don't think that anyone with
reasonable programming skills shouldn't attempt this *if* they want to have
some fun and learn something about how drivers work with the Mac.

Basically this project is fun because *it is* moderately difficult in spots,
but without any huge amounts of drudge. As a learning tool it's fun and you
do end up getting yourself a drive for about half price. (E.g. pick up a
Seagate ST225N for about $400, last time I checked, probably cheaper now!)

Start with one of the RAM disk's available. The SCSI code slot's right in.
Formatting is usually a matter of issuing one or two commands to the drive
via the SCSI manager. You will probably want to implement a simple program
to right the boot blocks on the drive so you can auto-boot.

Good luck and have fun. 

PS. I use a Dataframe these days.. provided by my employers.


-- 
{ihnp4!alberta!ubc-vision,uunet}!van-bc!Stuart.Lynne Vancouver,BC,604-937-7532

shap@sfsup.UUCP (J.S.Shapiro) (09/22/87)

In article <1355@van-bc.UUCP>, sl@van-bc.UUCP writes:
> 
> Given the level of knowledge available about the subject matter, and
> availability of misc. bits of software I don't think that anyone with
> reasonable programming skills shouldn't attempt this *if* they want to have
> some fun and learn something about how drivers work with the Mac.
> 

On the other hand, while I also encourage people to give things a try, and
hardware being what it is it is quite difficult to really
screw things up, I don't recommend doing it unless you are
really comfortable in assembler. The complexity of doing the
job right is still considerable.

Jon SHapiro

sl@van-bc.UUCP (Stuart Lynne) (09/28/87)

In article <2081@sfsup.UUCP> shap@sfsup.UUCP (J.S.Shapiro) writes:
>In article <1355@van-bc.UUCP>, sl@van-bc.UUCP writes:
>> 
>> Given the level of knowledge available about the subject matter, and
>> availability of misc. bits of software I don't think that anyone with
>> reasonable programming skills shouldn't attempt this *if* they want to have
>> some fun and learn something about how drivers work with the Mac.
>> 
>
>On the other hand, while I also encourage people to give things a try, and
>hardware being what it is it is quite difficult to really
>screw things up, I don't recommend doing it unless you are
>really comfortable in assembler. The complexity of doing the
>job right is still considerable.
>

Well no...

I just went and had a peek at my SCSI driver. Very *little* assembler
involved. Mostly Aztec C. Basically only three small bits in assembler.
First, the driver host. Usually you will find something like this in a demo
desk accessory or RAM disk demo.

Second was two things to correct some bugs in the original Mac Plus ROMS.
First the stat routine didn't work. Secondly the Blind I/O routines did not
work reliably. Both of these are fixed in current ROMS.

Finally at the same time I fixed the Blind I/O routines to work I did some
small optimizing to allow a 2:1 interleave to be used on the disk. Simply
unrolling the i/o loops does the trick.

Something along the lines of:
		
	lsr.l	#3,d5		# divide count by 8
	beq.s	done		# is there anything left
	subq	#1,d5		# predecrement count register
loop
	move.b	(a0),(a2)+
	move.b	(a0),(a2)+
	move.b	(a0),(a2)+
	move.b	(a0),(a2)+
	move.b	(a0),(a2)+
	move.b	(a0),(a2)+
	move.b	(a0),(a2)+
	move.b	(a0),(a2)+

	dbf	d5,loop
	bra.s	done
	....

The easy way to see how where to put this is to use MacNosy on the old ROM
patch for fixing SCSI.

Anyhow the assembler stuff is pretty well optional with the exception of the
host which you link into, and that's usually provided for you in some form.

-- 
{ihnp4!alberta!ubc-vision,uunet}!van-bc!Stuart.Lynne Vancouver,BC,604-937-7532