Tandy Professional Forum   Section: Model 4 / 4P
Subject: Rebuild Directory   Total messages: 2
==============================================

#62714   1 Reply   12/10/96   10:39:29
From: Gil Parrish, 73430,1546
To:   All

I have a Model 4 disk that apparently has a bad directory sector;
the rest of the disk appears to be OK.  I have a couple of
programs that claim they will fix the HIT table or GAT table or
something, but those programs first try to read the directory (!)
and, when they can't, crash with a disk read error.  Is there a
program that will rebuild the directory by going through the rest
of the disk, find and what is there and where, and write it
down?

I've just arrived in this forum (the name "Tandy Professional"
seems to me to be misleading for the old TRS-80 line, although
the "TRS80PRO" tag is clearer).  I have a bunch of Tandy models,
including the I, III, 4, 4p, 12, and others (in the CoCo line)
not relevant here.  I assume (hope) it has a nice library.  Can
someone suggest some really good software?  I mean, about the
most advanced game I have for the 4 is Tetris, and even some of
the pure text-based software for that unit seems to be somewhat--
moldy.


#62718   Reply to #62714   12/11/96   03:21:18
From: Frank Slinkman, 72411,650
To:   Gil Parrish, 73430,1546

If the directory sector has been overwritten, you're out of
luck.

HOWEVER, it may just be that it's difficult to read -- magnetic
media doesn't hold it's pattern forever, after all.

If you go into DEBUG, you can do direct track and sector reads
and writes.  First, read track 0, sector 0, to determine which is
the directory track.  To do this, put a good system disk in Drive
0, and the bad one in Drive 1, and, within DEBUG, type:
     1,0,0,r,3000

This will read Drive 1, Track 0, Sector 0, into the memory page
@ 3000H

The first two bytes will be FE 14, probably.  The second byte,
14H, is 20 decimal, meaning the directory is on track 20.  If it
is any other value, that is the directory track number.

Now you are ready to try reading the directory track.  Assuming
it is on track 14H = 20D, type:
     1,14,0,r,3000,12

The last number, 12H = 18D, assumes a 2-sided diskette.  If
single side, use 9 instead.

This command will read 18 (or 9) sectors starting at Drive 1,
Track 14H, sector 0, into RAM starting at address 3000H.

You may get an error indication.  If so, just hit the space bar
and the low level read will continue.  If you got no error
indication, then the read was successful.  However, if you did
get an error, then use the + and - keys to step thru memory until
you get a page with nothing but zeros or 14's.  This will be the
page corresponding to the sector which caused the error.

Now, you can keep attempting to read until  you get an error-free
read, or you can dump the data into a file on the disk in Drive
0, and email it to me for analysis.

A good read of the DEBUG chapter will tell you how to write the
data back to disk when you do get a clean read, and this should
restore the directory.  But don't screw up, because one small
screw-up is all it takes to destroy the directory track beyond
any hope of repair.

Don't hesitate to ask further questions if you're not totally
sure of what you're doing.


