[comp.sys.amiga.tech] amiga disk drives ...

wdao@castor.usc.edu (Walter Dao) (07/04/89)

The amiga disk drive as any other drive can only write a given number
of WORDS (2 bytes) on any single track. On my drive I can write and can only
write about $31d8 (+/- 2) bytes. (they are composing the raw MFM bytes of the
sectors, headers and gap .)
Now I have encountered disks written by other amiga computers which had 
more bytes on them (the abacus disk had 320a bytes on track) or less bytes
on disk (like Thexder which had 30ca or something ... (forgot)).

now my question : how can I slow/speed up the motor (?) write spead (?) 
of my disk drive so that I can have more/less bytes storable on a track

I have tried to play with the PRECOMP stuff but that didnt help, I was still
stuck with being able to only write 31d8 bytes on a track. 
I even tried to alter the data written by the DMA (like writting only
00 on a full track , then writing less than 31d8 bytes on that same track.
(lets say 3000 bytes) but I still got a track of 31d8 bytes storable on it..

any Hardware modification is definitely out of the question. 
I have read and reread the HArdware manual but could find any lead.

anyway ... I am waiting for any replies ... 

	
			8-#

dillon@POSTGRES.BERKELEY.EDU (Matt Dillon) (07/06/89)

	E-Gad!  Talk about fine tuning.  These deviations are due to
    minute deviations in motor speed.  You *must* allow for the worst
    case which is why there is padded gap at the end of the track when
    it gets written out (i.e. no gaps in between the sectors but a gap
    at the end of the track).  

	I'm not sure exactly what C-A does but this is the right way
    to do it (numbers picked at random) for writing a track:

    buffer: <padding ~200 bytes> <data ~12K> <padding ~200 bytes>

    Proper operation is where the padding at the end partially overwrites
    padding at the beginning.  The amount of padding must allow for the
    worst case and best case motor speed deviation.  I think if you 
    look at the spec'd allowed deviation for the drives and convert it
    to bytes you will find the numbers fit within the spec.

    You can easily *read* data written on a slightly faster or slower drive 
    because the drive uses a phase-locked loop to clock the data
    and the PLL 'locks' onto the frequency of the data on the track.

    This is the whole reason for MFM encoding in the first place... you
    must *somehow* encode a clock onto the track so the drive's PLL 
    stays locked.

	To encode more actual data onto the drive you can try a different
    encoding method.  The old commodore PET/CBM drives used a form of
    GCR encoding.

				-Matt


:The amiga disk drive as any other drive can only write a given number
:of WORDS (2 bytes) on any single track. On my drive I can write and can only
:write about $31d8 (+/- 2) bytes. (they are composing the raw MFM bytes of the
:sectors, headers and gap .)
:Now I have encountered disks written by other amiga computers which had 
:more bytes on them (the abacus disk had 320a bytes on track) or less bytes
:on disk (like Thexder which had 30ca or something ... (forgot)).
:
:now my question : how can I slow/speed up the motor (?) write spead (?) 
:of my disk drive so that I can have more/less bytes storable on a track
:
:I have tried to play with the PRECOMP stuff but that didnt help, I was still
:stuck with being able to only write 31d8 bytes on a track. 
:I even tried to alter the data written by the DMA (like writting only
:00 on a full track , then writing less than 31d8 bytes on that same track.
:(lets say 3000 bytes) but I still got a track of 31d8 bytes storable on it..
:
:any Hardware modification is definitely out of the question. 
:I have read and reread the HArdware manual but could find any lead.
:
:anyway ... I am waiting for any replies ... 
:
:	
:			8-#

jesup@cbmvax.UUCP (Randell Jesup) (07/07/89)

In article <8907051954.AA04521@postgres.Berkeley.EDU> dillon@POSTGRES.BERKELEY.EDU (Matt Dillon) writes:
>	I'm not sure exactly what C-A does but this is the right way
>    to do it (numbers picked at random) for writing a track:
>
>    buffer: <padding ~200 bytes> <data ~12K> <padding ~200 bytes>

	Actually, it's 830 data (1660 mfm encoded) bytes of gap written at
the beginning of the track.  The gap must be large enough so the track will
partially overwrite it.  The maximum number of data bytes that can be 
guaranteed to be stored on a track (including headers, sync words, etc) is
about 5999 bytes, because of timing and disk speed variations.

	Drives are speced at +-1.5%, the amiga clock (for various reasons)
is speced at +-5%, and the amiga clock is 2.5% fast nominally.  The nominal
number of data bytes on a 1-meg floppy in 6250.

>	To encode more actual data onto the drive you can try a different
>    encoding method.  The old commodore PET/CBM drives used a form of
>    GCR encoding.
>
>				-Matt

	True, but to use GCR on the amiga you must drop back to the slow
bitrate, which cuts your storage in half to start with.  There are other
MFM-style encodings that would still follow the rules about clock bits
correctly, but they are non-standard, and would be much harder to encode/
decode.

-- 
Randell Jesup, Keeper of AmigaDos, Commodore Engineering.
{uunet|rutgers}!cbmvax!jesup, jesup@cbmvax.cbm.commodore.com  BIX: rjesup  
Common phrase heard at Amiga Devcon '89: "It's in there!"

cmcmanis%pepper@Sun.COM (Chuck McManis) (07/07/89)

In article <4285@merlin.usc.edu> wdao@castor.usc.edu (Walter Dao) writes:
>The amiga disk drive as any other drive can only write a given number
>of WORDS (2 bytes) on any single track.
>  I can write ... $31d8 (+/- 2) bytes.
>  I have encountered disks ... had 320a bytes ... or 30ca .

One of the more common copy protection methods. The Amiga can synchronize
to a slightly faster data clock rate and read more bytes of the disk than
it can write to them. The copy protection comes from the fact that an 
unmodified Amiga drive cannot write that same data, hence can't make a 
copy. 

Seems like Walter has clearly taken up the challenge of writing a protected
disk copy program ala NIB or Marauder. Usually this is a good project since
it will teach you a lot about disk formats, copy protection, and how data
can and cannot be stored on magnetic media. [ If you use this knowledge to
pirate programs then you will be considered scum until you repent. ]

>now my question : how can I slow/speed up the motor (?) write spead (?) 
>of my disk drive so that I can have more/less bytes storable on a track

Answer : Not easily. Try taking the drive out of your machine and twiddling
	with the speed potentiometer(sp?). Actually, when embarking on an 
	endeavor such as yours, the proper equipment is essential. Pick up
	a logic analyzer and an oscilloscope, and connect them to an "exposed"
	drive (out of the case). That will let you monitor most anything.

On a slightly different but similar note :

	CADVision has Designer X-Cad out for $120 at my local dealer. This
	seems to be 100% of X-Cad but with a new label (including the 
	Commodore chicken head ?!?!) It is also dongle protected. I want
	to buy this program, but won't until I have a patch to eliminate
	the dongle requirement. If anyone knows how to do this send me
	some mail, thanks. Music-X is _not_ copy protected and I appreciate
	that immensely. 


--Chuck McManis
uucp: {anywhere}!sun!cmcmanis   BIX: cmcmanis  ARPAnet: cmcmanis@sun.com
These opinions are my own and no one elses, but you knew that didn't you.
"A most excellent barbarian ... Genghis Kahn!"