[comp.sys.amiga.tech] async diskcopy -- internals

deven@rpi.edu (Deven T. Corzine) (04/13/90)

This posting is on some of the internals of the asynchronous diskcopy
I've been writing.

Internally, there is a Track structure, which consists of a Node
structure, a short for the track number, and pointers to data and
sector label areas.  There is a List structure for each of the drives,
one for reading, one for writing.  The Tracks are always linked into
one of these Lists.  The Tracks are allocated dynamically and freed
when no longer needed.  The copier will run to completion so long as
at least one Track can be allocated.  If more memory is available, it
will use more.

When it completes a read, it queues the track in the writing List and
allocates a new Track for the next read if it can.  When it completes
a write, it either queues it in the reading List if it is empty, or
frees the memory otherwise.  For both cases, if the List it's queueing
to is empty, it starts a new read or write operation on the Track, as
appropriate.  The entire operation is event-driven, using asynchronous
I/O, and a ^C will abort the copy at any time.

It shouldn't be too hard to extend to a single-drive copy, and I also
want it to work correctly with the source disk inserted only -- that
is, read ahead until memory is exhausted and start writing as soon as
the destination disk is available.  [single-drive copy is an extension
of this.]  I also want to use Intuition requesters such as those AmigaDOS
uses for situations of no disk in the drive or improper protection
status.

But I don't want to ever require any use of the mouse to operate the
copier.  Amiga-V and Amiga-B and disk insertion should all be
recognized by the requester, as well as return in the window.  (and
possibly in the requester as well)  I haven't gotten this to work yet.

Deven
-- 
Deven T. Corzine        Internet:  deven@rpi.edu, shadow@pawl.rpi.edu
Snail:  2151 12th St. Apt. 4, Troy, NY 12180   Phone:  (518) 274-0327
Bitnet:  deven@rpitsmts, userfxb6@rpitsmts     UUCP:  uunet!rpi!deven
Simple things should be simple and complex things should be possible.