home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 2
/
FFMCD02.bin
/
new
/
disk
/
misc
/
devblocks
/
devblocks.doc
next >
Wrap
Text File
|
1993-12-21
|
9KB
|
203 lines
Programs: GetDevBlocks, PutDevBlocks
Author: Christian Wasner
Last changed: Oct 13, 1993
i) Disclaimer
The author cannot be held liable for the suitability or accuracy of this
manual and/or the program(s) it describes. Any damage directly or
indirectly caused by the use or misuse of this manual and/or the program
it describes is the sole responsibility of the user her/him self.
ii) Copyright/Distribution
GetDevBlocks, (c) Copyright 1993 Christian Wasner. All rights reserved.
PutDevBlocks, (c) Copyright 1993 Christian Wasner. All rights reserved.
These programs are FREEWARE, so no financial donations are required (but
welcome).They may be freely distributed as long as all documentation and
executable(s) remain unchanged and are included with the distribution. Also
no profit is to be made by selling this program.
They must not be added to other PD-libraries than AmigaLibDisks from Fred
Fish without my written permission. The price must not exceed the costs of
disk, package and mailing.
iii) Files
The following files should come along:
DevBlocks.doc
GetDevBlocks
PutDevBlocks
Anything that does not contain these three files is an ILLEGAL COPY !
iv) Documentation
WARNING ! THIS TOOLS ARE FOR EXPERT USERS ONLY !
USE OF THESE PROGRAMS, ESPECIALLY PUTDEVBLOCKS, CAN CAUSE SEVERE DAMAGE TO YOUR
FLOPPY DISKS OR HARD DISK ! USE WITH CARE !
General note: There is a difference between sectors and blocks. A block can
have more than one sector. Since my program only supports
devices with one sector par block, both means the same.
GetDevBlocks and PutDevBlocks can be used only from CLI, it will abort when
started from WB. For this reason it is described like a CLI command.
Program: GetDevBlocks
Format: GetDevBlocks <diskdevice> <track> <head> <block> <numblocks>|ALL
<filename> [LAB] [DUMP]
Template: DISKDEV/A,TRACK/A,HEAD/A,BLOCK/A,NUMBLOCKS/A,FILENAME/A,LAD/S,
DUMP/S
Purpose: To read blocks from any disk device (i.e. any DOS device with
tracks, heads and blocks like DF0:)
Specification: This program reads blocks from a disk-type DOS device (e.g. DF0:
or DH0:). Such a device is organized by accessing it by tracks, surfaces and
blocks. Only devices that have one sector per block are supported. The block
length may be something other than the usual 512 bytes. The data to be read
is specified by the the first track/head/block and the number of blocks. If
the keyword ALL is given for the number of blocks the device all blocks
after the start position are read. The data is written into a file. If the
keyword DUMP is set a hex dump is written into the file, in a format like
TYPE OPT H. A hex dump line looks like this:
000A4520: 4E55FCF8 48E73032 307C0004 2650204B NUüøHç020|..&P K
^ ^ ^
| | |
| | ASCII dump (non-printable
| | characters are displayed
| | with a '.')
| |
| Hexadecimal dump (4 longwords separated by spaces)
|
Hexadecimal offset from device start
If the keyword LAB is set the label buffers are saved into 'foo.lab'
(assuming the filename of the other data is 'foo').
If you specify '*' as filename the data is written to the standard output,
not to the standard error output (which is normally specified by '*'). If
DUMP is not set an ASCII dump (i.e. 64 characters per line, '.' for non-
printable characters) is sent to the standard output then. Each two blocks
you are asked to press RETURN. If DUMP is set a hex dump is written (see
above) and each 256 bytes you are asked to press RETURN.
Examples:
Reading the boot block and the label buffers of the disk in df0: to a
hex dump named 'bb'. The label buffer file is 'bb.lab':
1> GetDevBlocks DF0: 0 0 0 2 bb lab dump
Reading df0: from track 60, head 1, block 4 to its end without label
buffers into '40_1_4_all':
1> GetDevBlocks DF0: 40 1 4 all 40_1_4_all
PutDevBlocks
Format: PutDevBlocks <diskdevice> <track> <head> <block> <numblocks>|ALL
<filename> [LAB] [DUMP] [FORMAT]
Template: DISKDEV/A,TRACK/A,HEAD/A,BLOCK/A,NUMBLOCKS/A,FILENAME/A,LAD/S,
DUMP/S,FORMAT/S
Purpose: To write blocks to any disk device (i.e. any DOS device with
tracks, heads and blocks like DF0:)
Specification: This program writes blocks to a disk-type DOS device (e.g. DF0:
or DH0:). Such a device is organized by accessing it by tracks, surfaces and
blocks. Only devices that have one sector per block are supported. The block
length may be something other than the usual 512 bytes. The blocks to be
written to are specified by the the first track/head/block and the number of
blocks. If the keyword ALL is given for the number of blocks the device will
be written until the file ends or the end of the device is reached.If the
source file ends before all specified tracks are written the program writes
the last incomplete block to disk and stops. If the keyword DUMP is set
the source file is treated like a hex dump with exactly the same format as
the one used by GetDevBlocks, i.e. a hex dump line must look like this:
xxxxxxxxxx4E55FCF8 48E73032 307C0004 2650204Bxxxxxxxxxxxxxxxxxxx
^ ^ ^ ^
| | | |
| | | RETURN ($0A)
| | |
| | Any 19 characters
| |
| Hexadecimal dump (4 longwords separated by one space each)
|
Any 10 characters
If the keyword LAB is not set then zeroes will be written into the label
buffers. If LAB is set the label buffer data is read from <file>.lab in
the same way as from <file>. If <file>.lab is not long enough to fill all
label buffers, the program writes the last incomplete block to disk and
stops.
The keyword FORMAT specifies that any track which data is written to will
be formatted. This means that all other blocks of the track are erased.
Use this keyword for unfomatted disks only. Note that using FORMAT along
with LABEL may fail because label buffers will only be written when for-
matting with ETD_FORMAT. ETD_FORMAT may not be implemented to some disk
devices (e.g. with my hard disk controller device, oktagon.device, doesn't
support ETD commands fully) while with DFx: it works. Typical types of
failure are a command-not-implemented error or a verify error. To circumvent
this problem you have to format your disk device before using PutDevBlocks
(without FORMAT keyword of course). See autodocs, trackdisk.doc, TD_FORMAT
for more.
Examples:
Writing the contents of a hexdump 'bb' to the boot block of df0: along with
the label buffers (from a hex dump 'bb.lab'):
1> PutDevBlocks DF0: 0 0 0 2 bb lab dump
Writing file '40_1_4_all' to df0: from track 60, head 1, block 4 to its end
with cleared label buffers (the track to be written to are formatted):
1> PutDevBlocks DF0: 40 1 4 all 40_1_4_all format
v) Compatibility
These programs should run with Kickstart V1.3 and up. They may run with
lower Kickstart but this isn't tested (I haven't plugged in ye olde ROMs).
vi) Bugs
No bugs are known to me but I don't believe that there aren't. If you should
detect a bug, please tell me (email or phone). Be as specific as you can.
vii) Sourcecodes
The sourcecodes are not for free and may not be distributed in any way. They
may be obtained in exchange with other sourcecodes that interest me (only C
and Assembler, please). See my address below.
ix) Address
I will not give my address to the public because of bad experiences I have
heard of ("We know that you are a pi