                         UPGAT/CMD Ver. 2.0
                     By Scott Toenniessen 1991


Some older disk directory repair utilities such as pfix/cmd from the Toolbox
for LDOS 5 and Toolbelt for LS-DOS 6 by Powersoft (both now sold by
Misosys) are unable to correctly repair the GAT sector found on LDOS 5.3.x
and LS-DOS 6.3.x type disks.  This occurs because beginning with LS-DOS 6.3.0, the previously unused bit 3 of byte CDh in the GAT sector was assigned to
indicate whether or not a disk used the new or old style dating.  When this bit
is set, 6.3 style dating  is assumed, when it is reset, pre 6.3 style dating is
indicated.

Older versions of directory repair utilities (specifically pfix/cmd) reset
this bit when repairing a disk, even on 6.3 style disks.  This causes LS-DOS
6.3.x to think it is reading an old date style disk and causes it to omit
the time stamp and incorrectly interpret the date stamp when using the DIR
command.  Running DATECONV on the disk sets all the time stamps to 12:00 and
makes the dates inaccurate.

This is where UPGAT/CMD comes in.  This Model 1/3/4 program simply sets
GAT+CDh bit 3 to 1.  This allows LDOS/LS-DOS to correctly recognize the dating
style used on the disk.

Operation: After a directory repair operation which corrects a corrupted
GAT sector (pfix :d,g would do that), simply type:

UPGAT :d

where d is the drive number. The colon may be omitted. Optionally, the command:

UPGAT :d (old)

may be executed where old indicates that pre 6.3.x style dating is used. This option is included in case the program is ever used on an earlier LDOS/LS-DOS disk by mistake


Comments: In my experience with pfix6/cmd, I only need to run UPGAT after
repairing the GAT sector.  After repairing only the HIT sector or file
records, the GAT is not changed thus eliminating the need for UPGAT.
This may not hold true with other disk repair utilities.  I have used 
UPGAT on my hard drive, floppy drives and diskDISK files successfully.

Caveats: If repair utilities other than those found in Toolbox/Toolbelt are
used, I would suggest testing UPGAT on a scrap disk after running that
utility.  It is also possible that some or all of the file dates and times
will be scrambled after directory file records are repaired even though I have never had this happen.

I would suggest formatting a disk using LS-DOS 6.3.x, copying a couple
visible files to it, looking at the directory noting the date and time field
contents, and then running pfix/cmd with the command:

pfix :d,g   or    pfix6 :d,g

Now type dir and note what is listed in the date and time fields.  Then
type UPGAT :d and look at the directory again.  This will help demonstrate
what will happen in the event of a real disk error.

UPGAT5/CMD is for model 1 LDOS 5.1.5, model 3 LDOS 5.3.x and UPGAT6/CMD is for  LS-DOS 6.3.x

Note: I have not tested the program on a Model 1 as mine bit the dust when I
      about to test it.  It should work, though. 

Version 2.0 of UPGAT/CMD is in the public domain and may be freely distributed.

As usual, use UPGAT at your own risk.
