home *** CD-ROM | disk | FTP | other *** search
/ Futura 21 / Futura_Issue_21_1997_NOSAUG_Side_A_BASIC.atr / vtoc.doc < prev   
Text File  |  2023-02-26  |  3KB  |  1 lines

  1. ¢A CAUTIONARY TALE¢¢by Alan Hitchen, 1997.¢¢    The importance of the Volume Table Of Contents on a disk had never entered my mind until the day it failed me.¢¢    I was using DRAW 7 (see review on this disk) and I needed to save a picture.  Not having a blank formatted disk to hand, I thought I could safely put it on the flip side of the disk, where I knew there was space after the documentation.¢¢    I then loaded PIXEL ARTIST DELUXE to use its airbrush facility on the picture, which loaded in ok.  I then saved the altered picture back to the same disk as a different file.  I then called the directory to check on free space only to be greeted by a display of garbage.¢¢    Using DOS WIZARD to examine the disk, sector by sector, I could see that my first picture file had been written over the documentation.  The second picture had also been written over the existing files as well as the VTOC and directory sectors, hence the garbage display when the directory was called.¢¢    What had happened?  After reading up on the subject I concluded that the VTOC must have been corrupted, probably when being duplicated, thus allowing access to a random selection of already allocated sectors.¢¢    As I didn't have a backup of this disk (another mistake) I decided to try and salvage what I could.  So first of all I had to rebuild the VTOC and directory sectors.¢¢    The VTOC lives in sector 360 and provides DOS with a map of sector allocation.  Byte 0 should be 2 for a DOS 2.5 disk.  Bytes 1 and 2 give the total sector count, which should be 707 in single density, or 1010 for enhanced density.  Bytes 3 and 4 have the free sector count.  From byte 10 to 99 is the sector map of a single density disk.  Each Byte contains the status of eight sectors.¢¢    The VTOC of an enhanced density disk continues in sector 1024, where bytes 0 to 121 represent sectors 48 to 1023.  Bytes 122 and 123 hold the additional number of free sectors available up to a maximum of 303, plus 707 equals 1010 in total.¢¢    Instead of doing a lot fiddling about, I simply filled the table with zeroes to allocate all sectors.  Then I used DOS WIZARD to free up the unused sectors.¢¢    The next problem was the directory which can be found in sectors 361 to 368.  After clearing out the garbage I re-entered the information, using DISKMEND.¢¢    Each entry has sixteen byes.  Byte 0 is the status byte and in this case had the value 66, it would be 98 for a locked file.  Other possible values are 3 for file using sectors 721 upward, 35 is the same but locked.  128 denotes a deleted file.  Bytes 1 and 2 have the sector length count.  Bytes 3 and 4 have the first sector number.  Bytes 5 to 12 hold the file name, and 13 to 15 hold the extention.¢¢    Although I could then have recovered the picture files I decided it wasn't worth it.  So I then went through the files sector by sector, using a DISKMEND option to repair the sector chains. I then used the sector trace facility to check if all was well.¢¢    After re-adjusting the directory to correct my initial guesses, my repair was complete.  Needless to say large chunks of the documentation have been lost but enough remains to get by with pending a replacement.¢¢¢DRAW 7 can be found on NOSAUG PD disk AIM09.  PIXEL ARTIST DELUXE is on U07.  DOS WIZARD is on Futura issue 16.  DISKMEND is on U13.  Go to it!¢¢