Short: Un*x like raw device access handler Author: thor@math.tu-berlin.de (Thomas Richter) Uploader: thor@math.tu-berlin.de (Thomas Richter) Version: 40.2 Type: util/sys Requires: OS 2.04 ------------------------------------------------------------------------------ Purpose of this program: The DEV-Handler allows easy access to raw sectors of an exec type device under the dos.library environment. A typical application would be to use the "copy" command to make a full backup of a floppy to a file, or to use "copy" to make a backup of the RDB of your HD. The DEV-Handler is very powerful, but also very dangerous in the wrong hands because it modifies the device structure going down to the exec handler directly without using any kind of filing system access. This DEV-Handler replaces various other DEV-Handlers and improves and fixes many problems of these earlier releases. Note that no original code of these versions have been used, this handler is a complete rewrite. ------------------------------------------------------------------------------ Usage: A file name for the DEV-Handler is either a "DOS" device name like "df0" or "DH0" in which case this "file" indicates the full partition addressed by this name. For example, "DEV:df0" is the raw, unmapped first internal floppy drive, "DEV:dh0" the first harddisk partition. The start of the file using this syntax is always the start of the partition, the length of the file the full length of the partition. Especially, this does NOT include the RDB, if there is one. The alternative syntax addresses an exec device directly and completely, ignoring partitions. A file name using this syntax looks as follows: DEV:device/unit/flags/bufmemtype/mask/maxtransfer where device is an exec device name, i.e. "scsi.device". This is mandatory. unit is the exec unit number, typically the SCSI ID. This is mandatory. If only one argument is given, the DEV-Handler reads the device as DOS partition name and not as an exec name. This is a numeral. flags exec flags for opening the device. Optionally and defaults to zero. This is a numeral. bufmemtype the memory type for the buffer to allocate for device I/O. Optionally and defaults to MEMF_24BITDMA|MEMF_PUBLIC. This is a numeral, or one of the following hard-coded identifiers: MEMF_ANY, ANY whatever is available, this is identical to MEMF_PUBLIC for the purpose of this handler. MEMF_PUBLIC, PUBLIC public (non-virtual) memory. MEMF_CHIP, CHIP chip memory. MEMF_FAST, FAST non-chip, i.e. FAST memory. MEMF_LOCAL, LOCAL native motherboard memory that does not go away on reset. MEMF_24BITDMA, 24BITDMA memory in the 24 bit address space reachable for Zorro-II DMA. MEMF_ZORROII, ZORROII a synonym for the above. All other values are read as numerals, hex identifiers using the "$" or "0x" notation are allowed here as well. This field fulfills the same purpose than the BUFMEMTYPE in the mount lists. mask A mask used for checking whether the supplied buffer is "proper". If "memory and not mask" is non-zero, the handler will fall back to single block-I/O like the FFS. This field has the same purpose and works in the same way as the "MASK" entry in mountlists. It is optional, the handler will compute a reasonable mask for you using the supplied or non-supplied bufmemtype. This entry is a numeral, hex notation is accepted. maxtransfer The maximal amount of bytes the exec device is able to transfer at once. Larger chunks are split into smaller pieces at most as big as the "maxtransfer". This field works as the "MAXTRANSFER" entry in mount- lists. It defaults to 32767, i.e. 32K-1. This entry is a numeral, hex notation is accepted. ------------------------------------------------------------------------------ Examples: Note that the DEV-Handler is clearly an expert-tool, unsophisticated playing with the DEV-Handler may easely destroy the data-integrity of your HD! Make a byte for byte backup of a floppy in drive 0 - known as ".adf" file: copy dev:df0 to Backup.adf No need to run or use any kind of "ADF" conversion utility. Restore a backup to the floppy: copy Backup.adf to dev:df0 Yes, it is really that simple. (-: Make a byte copy of the ZIP partition for future use: copy DEV:ZIP to Backup View the "RDB" block of your boot volume, connected to the scsi.device, unit 0: type DEV:scsi.device/0 hex ------------------------------------------------------------------------------ Installation: - Copy "Device-Handler" to L: - Copy "DEV" and "DEV.info" to "Storage/DOSDrivers". I *do not* recommend to mount DEV: automatically on startup since accidental playing with DEV: may really yield to major damage! ------------------------------------------------------------------------------ Improvements over the 37.xx releases (note that this is a re-design): - Keeps care about popular device bugs including the standard-workarounds the FFS offers as well, including a MASK, MAXTRANSFER and BUFMEMTYPE. - Allows concurrent reading and writing to the same stream. - Implements ACTION_SEEK, i.e. seeking in device streams is possible. - Automatically turns off the drive motors after a fixed delay like the FFS. - Handles large devices correctly using the TD64 and/or the TD64 standard. - Handles errors on Read/Write correctly, unlike the V37 edition. ------------------------------------------------------------------------------ The THOR-Software Licence (v2, 24th June 1998) This License applies to the computer programs known as "Device-Handler". The "Program", below, refers to such program. The "Archive" refers to the the original and unmodified package of distribution, as prepared by the author of the Program. Each licensee is addressed as "you". The Program and the data in the archive are freely distributable under the restrictions stated below, but are also Copyright (c) Thomas Richter. Distribution of the Program, the Archive and the data in the Archive by a commercial organization without written permission from the author to any third party is prohibited if any payment is made in connection with such distribution, whether directly (as in payment for a copy of the Program) or indirectly (as in payment for some service related to the Program, or payment for some product or service that includes a copy of the Program "without charge"; these are only examples, and not an exhaustive enumeration of prohibited activities). However, the following methods of distribution involving payment shall not in and of themselves be a violation of this restriction: (i) Posting the Program on a public access information storage and retrieval service for which a fee is received for retrieving information (such as an on-line service), provided that the fee is not content-dependent (i.e., the fee would be the same for retrieving the same volume of information consisting of random data). (ii) Distributing the Program on a CD-ROM, provided that a) the Archive is reproduced entirely and verbatim on such CD-ROM, including especially this licence agreement; b) the CD-ROM is made available to the public for a nominal fee only, c) a copy of the CD is made available to the author for free except for shipment costs, and d) provided further that all information on such CD-ROM is redistributable for non-commercial purposes without charge. Redistribution of a modified version of the Archive, the Program or the contents of the Archive is prohibited in any way, by any organization, regardless whether commercial or non-commercial. Everything must be kept together, in original and unmodified form. Limitations. THE PROGRAM IS PROVIDED TO YOU "AS IS", WITHOUT WARRANTY. THERE IS NO WARRANTY FOR THE PROGRAM, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. IF YOU DO NOT ACCEPT THIS LICENCE, YOU MUST DELETE THE PROGRAM, THE ARCHIVE AND ALL DATA OF THIS ARCHIVE FROM YOUR STORAGE SYSTEM. YOU ACCEPT THIS LICENCE BY USING OR REDISTRIBUTING THE PROGRAM. Thomas Richter ------------------------------------------------------------------------------ Thomas Richter, July 2000 .