[comp.sys.apple2] DMA?

grochoci@mentor.cc.purdue.edu (Paul Grochocinski) (04/16/91)

	I have seen DMA referred to several times. Could somebocy please
	explain just what it stands for and what it is used for.

			Thanks in advance.

toddpw@nntp-server.caltech.edu (Todd P. Whitesel) (04/16/91)

grochoci@mentor.cc.purdue.edu (Paul Grochocinski) writes:

>	I have seen DMA referred to several times. Could somebocy please
>	explain just what it stands for and what it is used for.

DMA stands for Direct Memory Access. It is a faster way to get data in and
out of the computer, usually to disks or other storage devices but it can and
has been used for a variety of purposes.

DMA is basically any method of transferring to data to/from the computer's
memory that bypasses the main CPU (hence the term 'Direct'). It is nearly
always faster than a programmed memory move (executed by the main CPU to
a peripheral device, say) because there is no overhead for reading the
instructions that perform the move. Also, DMA can be made to occur in the
background as far as the main CPU is concerned, so it can run normally
while the transfer is taking place (with a slight speed hit because it
may have to wait for the memory).

In general, DMA is a performance enhancing technique used by nearly every
general-purpose computer in existence. I don't know how to explain much
more without going into more detail than you probably want, so I'll stop
here -- I think this answered your question though.

Todd Whitesel
toddpw @ tybalt.caltech.edu

taob@pnet91.cts.com (Brian Tao) (04/17/91)

    Since we are back on the topic of DMA devices for the time being, I have a
question concerning the RAMFast DMA SCSI card.  I've got it hooked up to a
Quantum 100-meg HD.  Using Prosel-16, I can get close to 600K/second on block
reads, but some reason, block WRITES max out at barely 150K/second.  I realize
that writing takes longer than reading, but 4 times longer?!?!  DMA is turned
on, I have a fully-populated Chinook RAM4000 card, no RAM disk, and I'm using
the GS/OS RAMFast driver.  Any suggestions?

Brian T. Tao   *B-) |  t569taob@bluffs.scar.utoronto.ca  | "Though this be
U of Metro Toronto  |               - or -               |  madness, yet there
Scarberia, ON       |        taob@pnet91.cts.com         |  is method in 't."

bazyar@ernie (Jawaid Bazyar) (04/17/91)

In article <613@generic.UUCP> taob@pnet91.cts.com (Brian Tao) writes:
>    Since we are back on the topic of DMA devices for the time being, I have a
>question concerning the RAMFast DMA SCSI card.  I've got it hooked up to a
>Quantum 100-meg HD.  Using Prosel-16, I can get close to 600K/second on block
>reads, but some reason, block WRITES max out at barely 150K/second.  I realize
>that writing takes longer than reading, but 4 times longer?!?!  DMA is turned
>on, I have a fully-populated Chinook RAM4000 card, no RAM disk, and I'm using
>the GS/OS RAMFast driver.  Any suggestions?

   The RAMfast cache is what is termed as "write-through", i.e. any data
written to the card is immediately written through to the disk.  This is
for consistency (note that Unix machines don't operate this way- you can't
just unplug a Unix box without losing filesystem data).
   What are you using to test your speeds in K/second?
   Someone needs to write a sort of "Nortonish" utility for the ][ series.
That way we can compare ourselves at least to each other.

--
Jawaid Bazyar               |  "Twenty seven faces- with their eyes turned to
Senior/Computer Engineering |    the sky. I have got a camera, and an airtight
bazyar@cs.uiuc.edu          |     alibi.."
   Apple II Forever!        |  I need a job... Be priviliged to pay me! :-)

toddpw@nntp-server.caltech.edu (Todd P. Whitesel) (04/18/91)

bazyar@ernie (Jawaid Bazyar) writes:

>   The RAMfast cache is what is termed as "write-through", i.e. any data
>written to the card is immediately written through to the disk.  This is

I thought the writes were supposed to be done in the background in order to
speed things up!

Just copying files in finder (and this is with a Zip at 10 mhz) the Ramfast
and quantum doesn't seem to operate as quickly as a Ramfast and a 'dumber'
drive like a seagate or a syquest. I get this feeling that the Ramfast's
transfer algorithm causes track-caching drives like the Quantum and Conner
to thrash somewhat -- the fastest I seem to be able to get is 512K/sec
(finder Verify on a 32 meg partition) and 200K/sec (finder Validate on a
32 meg parition w/ 176k free and files of various sizes). Writes are also
slower.

I have a theory on this: ProDOS is very space efficient, but it wasn't
designed for raw speed when the seek time outweighs the time to read a
single block. This is a real problem when you have 1 block of file data,
an index block, ~128K of file data, a master index block, another index
block, another ~128k of file data, and so on. Add to that the fact that
the Quantum reads a track at a time, and you have at least one guaranteed
thrash when reading a >128K file. Worse, the RAMfast may be assuming that
it can sync to the drive per block read (ok for Seagates and such) as
opposed to a track read (which is more appropriate for Quantum and Conner
mech's). I can easily see lots of unnecessary delays, because the RAMfast
is assuming that the drive will be free as soon as the block comes back,
but instead the drive is not free until the entire track containing that
block is available.

Somebody, please tell me the 2.0 ROMs do something about this. I paid more
money for a quantum and with a Ramfast it's actually slower than a Seagate
I was helping somebody set up. The only other alternative is to optimize
my filesystems but that doesn't solve the problem with write synchronization
(I figure the RAMfast is waiting on writes as well and not taking into
account the fact that the quantum will perform a background write of its
own).

Todd Whitesel
toddpw @ tybalt.caltech.edu

stc7@cunixb.cc.columbia.edu (Steven T Chiang) (04/18/91)

In article <1991Apr17.210147.13550@nntp-server.caltech.edu> toddpw@nntp-server.caltech.edu (Todd P. Whitesel) writes:
>
>Just copying files in finder (and this is with a Zip at 10 mhz) the Ramfast
>and quantum doesn't seem to operate as quickly as a Ramfast and a 'dumber'
>drive like a seagate or a syquest. I get this feeling that the Ramfast's
>transfer algorithm causes track-caching drives like the Quantum and Conner
>to thrash somewhat -- the fastest I seem to be able to get is 512K/sec
>(finder Verify on a 32 meg partition) and 200K/sec (finder Validate on a
>32 meg parition w/ 176k free and files of various sizes). Writes are also
>slower.
>

	This brings me back to a question I had...  Does anyone have
numbers or theories about which combination of drive and interface
card will be the fastest....  I'm going to purchase one of these
combinations... 

	1.  RamFAST and Quantum 100
	2.  RamFAST and Seagate 80
	3.  High Speed SCSI and Quantum...

	I'm leaving out HS SCSI and seagate, because I'm assuming that
it will be the slowest...

	I was thinking the quantum and ramfast would be too expensive,
so I was debating 2 and 3...  

thanks..

Steven Chiang                  Coming Soon:  DreamGrafix  3200 color power  
stc7@cunixb.cc.columbia.edu
America On_Line:  DWS Steve    Apple IIgs Forever!
#  With a 4 line .sig, which is all my mailer will post!  :P  #

taob@pnet91.cts.com (Brian Tao) (04/19/91)

From bazyar@ernie (Jawaid Bazyar):

>     The RAMfast cache is what is termed as "write-through", i.e. any
> data written to the card is immediately written through to the disk.

    That's what I thought, but I've noticed on some occasions the hard drive
activity LED would blink almost a full second AFTER the write operation.  This
only happens with small files (less than about 10 blocks).  On larger files,
the LED only blinks once every 1.5 seconds or so.  I might also add that I'm
using a Quantum P105S hard drive, which has its own 64K cache.  Still, 1.5
seconds to fill 64K?!?

>   What are you using to test your speeds in K/second?

    The Finder can pull in about 550K/second on a disk verify.  Prosel-16's
Volume Repair in Bad Block Lockout mode will read very close to 600K/second. 
The 150K/second figure was calculated by writing out a 2.2 meg sound file onto
a clean, optimized partition.

>    Someone needs to write a sort of "Nortonish" utility for the ][ series.
> That way we can compare ourselves at least to each other.

    How usable are the values from DiskTimer GS or Prosel-16's disk access
test?  I've been getting nice values (like 1.2 ms access for linear reads,
14.5 ms access for random reads) but I that doesn't say anything about the
transfer rate to/from the SCSI bus.

Brian T. Tao   *B-) |  t569taob@bluffs.scar.utoronto.ca  | "Though this be
U of Metro Toronto  |               - or -               |  madness, yet there
Scarberia, ON       |        taob@pnet91.cts.com         |  is method in 't."

bazyar@ernie (Jawaid Bazyar) (04/19/91)

In article <1991Apr17.210147.13550@nntp-server.caltech.edu> toddpw@nntp-server.caltech.edu (Todd P. Whitesel) writes:
>bazyar@ernie (Jawaid Bazyar) writes:
>
>>   The RAMfast cache is what is termed as "write-through", i.e. any data
>>written to the card is immediately written through to the disk.  This is
>
>I thought the writes were supposed to be done in the background in order to
>speed things up!
>

  As has already been mentioned, I blew it. :-)

>Just copying files in finder (and this is with a Zip at 10 mhz) the Ramfast
>and quantum doesn't seem to operate as quickly as a Ramfast and a 'dumber'
>drive like a seagate or a syquest. I get this feeling that the Ramfast's
>transfer algorithm causes track-caching drives like the Quantum and Conner
>to thrash somewhat -- the fastest I seem to be able to get is 512K/sec
>(finder Verify on a 32 meg partition) and 200K/sec (finder Validate on a
>32 meg parition w/ 176k free and files of various sizes). Writes are also
>slower.

  Ack! How could it be any faster?  :-) 
  So how exactly are you timing this thing?  Are you just 'validate'ing
your drive and dividing it's size by how long it takes?

>Somebody, please tell me the 2.0 ROMs do something about this. I paid more
>money for a quantum and with a Ramfast it's actually slower than a Seagate
>I was helping somebody set up. The only other alternative is to optimize
>my filesystems but that doesn't solve the problem with write synchronization
>(I figure the RAMfast is waiting on writes as well and not taking into
>account the fact that the quantum will perform a background write of its
>own).

  I don't know. I'd like to get ahold of the 2.0 ROMs and try some tape
backup fun.  
  Is there some way to turn off the cache on the Quantum? I didn't notice
anything on mine, but then I was concentrating on hooking the puppy up
and watching it fly.
  Alternatively, you could turn off the RAMfast cache, and still have
a fast DMA card.  It might be even slower, though.

--
Jawaid Bazyar               |  "Twenty seven faces- with their eyes turned to
Senior/Computer Engineering |    the sky. I have got a camera, and an airtight
bazyar@cs.uiuc.edu          |     alibi.."
   Apple II Forever!        |  I need a job... Be priviliged to pay me! :-)

6600prao@ucsbuxa.ucsb.edu (Parik Rao) (04/19/91)

 RamFast and Quantum 105 will be fastest.  I'd avoid seagate.  If you look
around, you can get a 330 meg drive for dirt-cheap (~$600), and the
cdc WREN drives are the fastest things since sliced bread.
 
BTW, Conner's are also very fast and good.  They're coming out with
a new model soon, a 500 meg drive thats supposed to be (relatively)
cheap.

[btw, the 330 meg "dirt" cheap drives are almost invariably 
refurbished or used... buyer beware]

--
Apple II Forever |       6600prao@ucsbuxa.ucsb.edu      | IBMs get the job done
Parik Rao       |      Amiga - for the creative mind     |        Class of 1994
                 Macintosh - buy it or Apple will sue you.

taob@pnet91.cts.com (Brian Tao) (04/19/91)

From bazyar@ernie (Jawaid Bazyar):

>   Is there some way to turn off the cache on the Quantum? I didn't
> notice anything on mine, but then I was concentrating on hooking the
> puppy up and watching it fly. 

    There might be a DIP switch setting (this from memory, I read something
about this in the ProDrive manual) which selects the cache.  Of course, you'd
have to open up the case to get at the switches, something I don't intend on
doing at this moment.

Brian T. Tao   *B-) |  t569taob@bluffs.scar.utoronto.ca  | "Though this be
U of Metro Toronto  |               - or -               |  madness, yet there
Scarberia, ON       |        taob@pnet91.cts.com         |  is method in 't."