home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of A1200
/
World_Of_A1200.iso
/
programs
/
disk
/
backup_utils
/
mrbackup1.5
/
docs
/
mrtape.doc
< prev
next >
Wrap
Text File
|
1995-02-27
|
9KB
|
191 lines
MRTape: SCSI Tape Handler V1.07
-------------------------------
Mark R. Rinfret
MRSoftware, July 1991
This is a tape handler designed primarily for MRBackup Professional.
Portions of this handler were originally derived from code written by
Markus Wandel and Bob Rethemeyer. I am very grateful to them for their
contributions to my understanding of SCSI tape operations.
The current version of mrtape-handler represents a complete rewrite of the
earlier code and sports many new features, several of which were designed
specifically to support MRBackup Professional. It is known to support the
following SCSI tape drives:
Wangtek 5XXX ES
This drive has an on-board 64K byte cache. Specify "64" as the
buffer size if you can afford it (this results in 128k bytes
being set aside by the handler, so plan accordingly). I believe
you'll get optimal results with MRBackup if you also set "his"
buffer size to 64K. This results in an optimal double-buffering
arrangement.
Data Cartridge Technology MCD-40 (and -20)
This drive uses a fixed-size block of 8192 bytes. Specify "8" as
the buffer size in your mountlist entry. This drive does not seem
to provide any reasonable asynchronous behavior. I was quite
disappointed with its performance compared to the Wangtek or the
Sony.
Archive ????
Sony SDT-1000 (added 03/30/91)
On the SONY DAT drive, it is currently assumed that the drive
defaults to "variable block size" mode. Since this is the
vendor-preferred mode, MRBackup uses it. The drive is a real
performer, though settling time after a rewind is a bit
unsettling. :-)
Tandberg 3600 series
This is quite similar to the WangTek drive. It has an on-board
64K byte cache, though only 60K is really available for buffering.
This one may have a few glitches when run in asynchronous mode.
The use of the word "handler" is significant. This is not a "device
driver". It responds to AmigaDOS I/O packets. Implementing tape support
in this way (as opposed to embedding SCSI direct calls within the MRBackup
Professional program) provides a large degree of device independence for
MRBackup Professional. MRBackup Pro simply writes a stream of data
(encoded in MRBackup's "FastDisk" format) to the Backup Path. This may
just as easily be the SER: device, a file (local or networked) or some
other device configured to respond to standard filesystem calls.
Here are the packets supported and the degree to which they are supported:
ACTION_FINDINPUT
Opens the drive for exclusive read access only.
ACTION_FINDOUTPUT
Opens the drive for exclusive write access only.
ACTION_INFO (26)
ACTION_DISK_INFO
These fill in an InfoData structure with as much useful information
as possible. Specifically, an attempt is made to fill in the
following fields:
id_DiskState
If a tape is inserted, this field is set to ID_UNREADABLE_DISK.
If no tape is inserted, this field is set to ID_NO_DISK_PRESENT.
id_NumBlocks
An approximation of the tape cartridge capacity is provided.
id_BytesPerBlock
If a 3M drive (MCD-40) is detected, 8192 is assumed. Otherwise,
512 is assumed.
id_DiskType
This field is set to 'TAPE'. The first 4 characters of the
manufacturer's code might be used in a later revision.
id_InUse
This field is set to the boolean equivalent of "tape cartridge
inserted".
ACTION_LOCATE_OBJECT (Lock)
A rather hokey lock is created and returned. It should be sufficient
for programs which require such things.
ACTION_EXAMINE_OBJECT (Examine)
This packet is recognized, but ERROR_OBJECT_WRONG_TYPE is currently
returned.
ACTION_READ
Just what you'd expect.
ACTION_WRITE
Just what you'd expect.
ACTION_END (Close)
If the write buffer has any residue, it is padded to the device block
size with zeros and written to the drive. If the drive is not the
3M variety, a filemark is then written. The device is then marked
as closed.
ACTION_DIE
All resources allocated to the handler are released and the handler
is unloaded from memory. If you replace the current handler code
with a new version and then re-access the drive, the new code will
be loaded and initialized (great for development - no need to
reboot).
(There are others, to be documented later.)
MRBackup currently treats the backup set as one contiguous file.
Individual files have special header blocks and the data blocks have
control information which defines the end of each file. There is a special
control block to mark the end of tape. Thus, the filemark isn't typically
ever "read" and isn't required, which is how the 3M drive
(block-structured) is able to work.
MRTape-Handler uses asynchronous I/O, but you might not believe it when you
use the 3M tape drive. I'm not sure what the problem is, but I wasn't able
to get good performance from the 3 1/2" ministreamer that I tested with.
The buffer size parameter in the Startup field of the mountlist entry must
be chosen with care. This is the size of 1 buffer (as opposed to 1 block,
as is typically specified for filesystems). The handler allocates one
buffer for synchronous I/O and two buffers when using asynchronous I/O.
For example, I reccommend 8 (8192 bytes) for the 3M drive (this is required
by the drive) and 64 (65536 bytes) for the Wangtek 5150 ES. The Wangtek
has a 64K cache buffer. Setting MRTapeHandler to use 64K buffers causes
128K bytes to be allocated (a significant chunk!) but performance is quite
good. To obtain the best performance for other drives, you may need to
experiment. Use MRBackup Professional's "Throughput" measurement as a
relative guide to the effects that changes in buffer sizes have on your
backups.
Here is a sample mountlist entry for MRTape-Handler:
/* This is a mountlist entry for the SCSI tape handler provided with */
/* MRBackup. Pay particular attention to the StartUp message. Its */
/* format is: */
/* "<buffer_size>/<device_name>/<unit>/<luno>/<flags>" */
/* */
/* where */
/* <buffer_size> is the total amount of buffer memory, specified */
/* in K (K = 1024); */
/* */
/* <device_name> is the SCSI device driver name; */
/* */
/* <unit> is the SCSI unit number; */
/* */
/* <luno> is the SCSI logical unit number (not currently used but */
/* must be set to zero); */
/* */
/* <flags> is a set of bits controlling certain tape drive options */
/* The bit values, which may be added together are: */
/* */
/* 1 asynchronous mode, 0 = synchronous mode */
/* 2 use on-board buffer, 0 = don't use on-board buffer */
/* */
/* Example: to enable async mode and the on-board buffer, the */
/* <flags> value would be 3 (1 + 2). */
/* */
/* Other flag bits will be provided as new features are added. */
MRTAPE: Handler = l:mrtape-handler
StartUp = "64/scsi.device/4/0/3"
Stacksize = 4000
Priority = 10
GlobVec = -1
#
To determine the version number of MRTapeHandler, view the handler with any
binary file editor and look for a string that begins with the letters
"$VER:". You may also use the "version" command under WorkBench 2.0.
A small program, named "die", has been supplied with the handler. It
allows you to force the handler to free up all resources and unload itself.
Example:
die mrtape: