*********

Welcome to Project 64!

The goal of Project 64 is to preserve Commodore 64 related documents
in electronic text format that might otherwise cease to exist with the
rapid advancement of computer technology and declining interest in 8-
bit computers on the part of the general population. If you would like
to help by converting C64 related hardcopy documents to electronic
texts please contact the manager of Project 64, Cris Berneburg, at
74171.2136@compuserve.com.

Extensive efforts were made to preserve the contents of the original
document.  However, certain portions, such as diagrams, program
listings, and indexes may have been either altered or sacrificed due
to the limitations of plain vanilla text.  Diagrams may have been
eliminated where ASCII-art was not feasible.  Program listings may be
missing display codes where substitutions were not possible.  Tables
of contents and indexes may have been changed from page number
references to section number references. Please accept our apologies
for these limitations, alterations, and possible omissions.

Document names are limited to the 8.3 file convention of DOS. The
first characters of the file name are an abbreviation of the original
document name. The version number of the etext follows next. After
that a letter may appear to indicate the particular source of the
document. Finally, the document is given a .TXT extension.

The author(s) of the original document and members of Project 64 make
no representations about the accuracy or suitability of this material
for any purpose.  This etext is provided "as-is".  Please refer to the
warantee of the original document, if any, that may included in this
etext.  No other warantees, express or implied, are made to you as to
the etext or any medium it may be on.  Neither the author(s) nor the
members of Project 64 will assume liability for damages either from
the direct or indirect use of this etext or from the distribution of
or modification to this etext.

*********

The Project 64 etext of the Disk Doctor article. Converted to etext by
Harold Robbins, obtained from either The Ranch (Harold Robbins),
WireNuts (Jim Dillard), or Enterprise (Tom Hoot) BBS's in Austin TX.
The original document was called "disk dr.dox", supplied by Tom Hoot
<thoot@neosoft.com>.

DISKDR10.TXT, July 1996, etext #59.

*********

 -=[ Disk Doctor ]=-
 by: Harold Robbins

In a previous article, I described the structure of data on a disk. I
discovered the structure and explored it with a public domain utility,
by Solidus International, called 'Disk Doctor'.  This is a
fascinatingly easy utility to use, AND ABUSE.  Reread the article on
disk structure in the February issue of the Monitor before you try to
use Disk Doctor.  It may provide you somewhat of a guide to what you
will find while using Disk Doctor.  Disk Doctor is one of several
programs called 'sector editors' and its display requires some
explanation, it is somewhat mysterious.  The Solidus International
version is different from others in that it displays characters for
each byte rather than Hex code.  It also permits you to edit the
sectors in text strings or Chr$(x) values.  Most other versions
including the Epyx Fast Load requires you to make your entries in Hex
code.  The Disk Doctor can be found on the CUGA Library Disk called
the CUGA Membership Disk.  It will cost you $1.00 for a copying fee at
one of the CUGA Library sessions.  Use it to explore your disks.
You'll find the directory in track 18 of your disk, and the Block
Allocation Map in sector 0.  The directory starts in Sector 1, and
continues, eight files to a sector until it uses up all of track 18
(144 files), or the disk runs out of free sectors.  It is best to
disable your 'FastLoad' cartridge before you load Disk Doctor because
the cartridge reserves a channel to the disk that Disk Doctor wants to
use.  If you forget, when you get the error message, reset your drive
(turn it off/then on) and follow the prompts in the program.  When you
load and run disk doctor, you will get an instruction to insert the
'sick disk' and touch any key.  The program will open a communication
channel to your drive.  You will then get a prompt for track; then
sector.  If you are using a 1571, you may even go up to track 70 if
the disk was formated double-sided.  To start with, use track 18 and
sector 0.  The program will obtain the information from the disk and
display it in the window.  This includes information for finding the
directory, block allocation codes, the directory header, disk id, and
format codes.  The bytes (characters) are numbered from 0, so the
first character is 0, and it is a code for 18 and tells the system
where the directory is started.  Byte 1 directs the disk operating
system to sector 1, which is the first sector of the directory.  Byte
2 is usually a character (reverse A) which is Hex 41 or decimal 65.
It tells the disk operating system the disk was formatted with a 1541
compatible drive.  If it has been changed, it often is done for copy
protection or to write protect the disk.  Any other character in this
byte will write protect the disk.  From this point on is a bit map of
the disk which tells the disk operating system which sectors are
already in use so it will know where to find free sectors for your
next save command.  There are some characters which you can usually
read somewhere near the end of the window, which is the disk name,
followed by the ID and format code.  The unused portions of this part
is padded out with reversed spaces and defines what is included in
quotes in your directory header.  While you are learning to use this
utility, it is best to practice on a scrap disk or extra copy of a
disk.


Disk Doctor Commands

The menu for Disk Doctor is displayed below the window.  The most
useful command in Disk Doctor is the 'N'ext command.  This will take
you to the next used sector in the directory or file.  This saves you
from having to read the track and sector from the 0/1 byte vectors and
type them in yourself, but that will work.  'J'ump, will do the same
thing if you are in the 0 position of the sector.  I will explain this
feature more fully later when I describe the directory entries.  The
New 'B'lock command will permit you to reenter the track and sector of
the disk where you wish to go next.  A plus or minus (+/-) command
will advance one sector in the track or back up one sector.  It does
NOT follow the file or program through the disk.  A 'Q'uit command
will return you to the initial screen with instructions to insert the
sick disk.  It is best to use this command at the end of every session
with the disk as it closes the command channel to the drive before you
exit.  You then may use the run/stop key to finish.  The 'R'ewrite
command is powerful, it writes any changes you have made in the sector
to the disk.  Use this command sparingly.  It will ask you if you are
sure.  If you go to another sector without using this command or leave
the system, the disk will be unchanged.  You do not have to rewrite
the sector to quit.  The 'T'ext command is useful.  It permits you to
use the keyboard to type new text strings to the window, just like a
typewriter.  Using the <return> key will terminate the text mode.  If
you forget to return, you'll just keep on typing and overwriting
whatever is in the window.  Do not dispair!  Until you write the
sector back to the disk, no harm is done.  Just use the <return>, B
key, and <return><return> and the sector is back to the original form.
Another useful command to write to the window is the '@' command.
This permits you to enter a character code (decimal) to replace the
byte under the cursor.  Like the text command, caution must be
observed before rewriting the sector to the disk.  Once you lose
reference to the original data that was in the sector, it is difficult
to repair the damages.  The 'c'opy command in Disk Doctor is obscure.
I've been unable to detect its function or make it do anything.
Solidus no longer provides instructions for the use of the program,
and no one I know of has been able to figure it out.  All in all, I
think this is the best and easiest sector editor to use, and it is
free to give away to anyone to use, so long as you do not try to adapt
it for commercial sale.  I'll explain how to use Disk Doctor to edit
your directory, to unscratch files, to write protect or un-write
protect files, to change files on the disk from one file type to
another, and even trace a program through the disk....  Next time.

*********

The end of the Project 64 etext of the Disk Doctor article.

*********
