home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga MA Magazine 1998 #6
/
amigamamagazinepolishissue1998.iso
/
disks
/
tools
/
hd_examine
/
hd_examine.doc
< prev
next >
Wrap
Text File
|
1996-05-10
|
7KB
|
173 lines
HD_examine
Version 1.0
The program allows examination and changing of any sector
of devices connected to an Amiga's SCSI bus. The pro-
gram is a GUI-based utility requiring AmigaDOS 2.04 or
later.
The program may be freely distributed in its binary form.
It is freeware although the author would appreciate any
donations sent his way. Comments and critiques would be
appreciated also.
No source is provided for the program since many of the
components are from the author's commercial genealogy data
management program, Family Connections. Use of the com-
ponents expedited production of HD_examine.
When started from either the CLI or Workbench, the program
presents a window on its own screen. The window and screen
follow your Workbench screen and font preference settings.
You may get a rare font selection in that the program re-
quests a default mono-spaced font consistent with your
screen mode. Intuition selects the actual font used.
No icon for operating the program from the Workbench is
provided because the author is a pathetic artist and has no
tools nor talent for producing a pretty icon. If anyone
should be inclined to produce an icon and donate it to the
cause, proper acknowledgement will be given in future dis-
tributions.
The window contains gadgets to allow specifying the I/O
device name to be used and the SCSI device ID. The device
ID selection can be clicked through the seven legitimate
selections (0-6); as each ID is selected, a display of
the device's inquiry data will appear in the two text
gadgets if there is a device with that ID on the bus.
For those familiar with the SCSI standard, the upper text
gadget displays an interpretation of the inquiry data's
peripheral device type, peripheral qualifier, and ANSI
version fields. The lower text gadget displays the con-
tent of the inquiry data beginning with the vendor ident-
ifcation field to the end of the inquiry data. This latter
data includes the vendor identification, product ident-
ification, and revision level, followed by anything the
manufacturer cares to include.
A hex listing of the first sector's data will appear at the
same time if the device is present. If the device is a
hard disk which has been formatted to operate with AmigaDOS,
the characters "RDSK" will appear as the first four bytes
of the first sector. The first line of the display shows
the number of bytes which are valid in case the read of the
sector's data failed to complete properly. The sector data
will not be displayed if the device type is such that an
attempt to read its sector data is nonsensical (a printer
device, for instance).
If the program encounters an I/O error while performing an
operation on the SCSI bus, a requester will appear showing
the operation being attempted and the error codes. The
error codes are shown as two decimal numbers, the first
being the AmigaDOS I/O error code (see below) and the second
being the SCSI status byte. The only value of SCSI status
you will probably ever see is 2 ("check condition").
If the disk sector being examined is a known component of
the RigidDisk data, an expanded presentation of the sec-
tor's data can be obtained by clicking on the "Expand"
button in the lower left corner of the window. A separate
window will open with a textual interpretation of the sec-
tor's content given. At the present time, this feature
works only for RDSK, PART, and FSHD sectors. In all other
cases, the clicking of the "expand" button will be ignored.
The "Next" and "Prev" button gadgets allow stepping to the
next or previous sector. These two buttons have keyboard
equivalents.
The "Quit" button gadget exits the program and has a
keyboard equivalent.
The "Load", "Save", "Edit", and "Write" button gadgets
allow operations to be performed on the current sector.
Attempting to use these functions when there is no device
selected will result in a requester being displayed and
the command ignored.
The "save" and "load" gadgets are more or less complement-
ary in that the "save" gadget will allow writing the con-
tent of the current sector to a file or the printer while
the "load" button will allow loading the sector with data
obtained from a file (previously created by saving a sec-
tor). The mechanism for loading sector data is somewhat
crude and is sensitve to the format of the file data, so
be judicious in its use.
The "edit" button allows making changes to the current
sector's content. The mechanization of this feature is
a "brute force" approach of writing the sector data to a
temporary file in the T: directory and invoking Memacs to
allow the making of changes. When the changes are com-
plete, exiting Memacs will result in the file's content
being processed to retrieve the data values. The hex
display is updated to reflect the changes, if any. It is
wise to verify that the changes have been made as intended
before proceeding.
Note: You can only change the hexadecimal values in the
editing file. The ASCII equivalents and data offsets
into the block are included for assistance in locating the
values to change but are otherwise ignored when being read
the data back into the program.
A word of warning about editing a sector's data: Do not
alter the format of the file during the editing process!
The program makes a crude check of the format for correct-
ness when processing it, but it is far from foolproof.
Any arbitrary format changes made during the editing pro-
cess will undoubtedly result in garbage being seen.
The "write" button gadget provides for writing the sector
data currently displayed to the disk sector. This is a
highly sensitive operation and you should do this only if
you know what you're doing! Writing garbage data to the
boot blocks especially can result in your having to recover
your drive's data as best you can and rebuilding the drive's
content (or at least a partition's worth). To prevent inad-
vertant write operations from occurring, a requester will
appear asking you to confirm that you really wish to write
the data.
Error code summary
------------------
The following error codes are extracted from the programming
"include" files for the relevant "devices". The entire set
is included for completeness, although many will never be
seen by the user.
* Trackdisk device error codes
20 general catchall
21 couldn't even find a sector
22 sector looked wrong
23 ditto
24 header had incorrect checksum
25 data had incorrect checksum
26 couldn't find enough sectors
27 another "sector looked wrong"
28 can't write to a protected disk
29 no disk in the drive
30 couldn't find track 0
31 ran out of memory
32 asked for a unit > NUMUNITS
33 not a drive that trackdisk groks
34 someone else allocated the drive
35 user hit reset; awaiting doom
* SCSIdisk device error codes
40 cannot issue SCSI command to self
41 DMA error
42 illegal or unexpected SCSI phase
43 SCSI parity error
44 Selection timed out
45 status and/or sense error
Everett M. Greene
May 10, 1996
mojaveg@ridgecrest.ca.us