Welcome to Diskwik 2.0! This file, I hope will help explain some things about your Amiga disks. First of all I would like to tell you about the other programs I included on the disk. DosKwik: DosKwik is a program that consists of two separate programs, ReadKwik and RiteKwik. To find out more about DosKwik read the DosKwik.doc file. Dcomp: The program Dcomp will compare one disk to another. To use this program just enter 'Dcomp' and it will prompt you to insert the disks to compare in DF0: and DF1:, then hit RETURN. It will then compare the disks byte for byte. When a difference is found it will print the BLOCK where it was found, the OFFSET into the block, and then the byte that is on DF0: and then DF1:. When done it will display the total number of bytes that are different. Fcomp: Fcomp will compare two files and report the differences. If the files are not the same size Fcomp will stop when the shorter file ends. To run Fcomp enter "Fcomp file1 file2 '.The screen will show the OFFSET into the file where the two are different, and then the bytes for the first then second file. It will print a total when done. Use Control-C to abort either Fcomp or Dcomp. Hash: The third file will tell you what the HASH value of a filename is. Just enter 'HASH filename ' and it will return the hash value. When the DOS is asked to put a file on the disk it will hash the name and will use that value to know where to put that entry in the hash table. That way it knows where to find it the next time instead of searching the entire hash table. Look in your manual at the diagram of either the ROOT or USER DIRECTORY BLOCK, and find the HASH TABLE. Now if you were to hash the filename 'Dcomp' you get the value 20 (Decimal). The hash table starts at the longword just to the right of the checksum. Start counting longwords (starting at 0) from left to right until you get to 20. This is the longword that will point to the file header for Dcomp. If there was another file that had the same hash value the DOS couldn't put both in the same place, so this is what happens. First DOS found that 'Dcomp' was already there so it goes to the FILE HEADER BLOCK for 'Dcomp' and will use the longword called NEXT and put it there. To sum it up, if you had say 5 filenames (or Directory names) with the same hash value, file 1 will be in the ROOT DIR and the longword called NEXT in file 1's FILE HEADER BLOCK will point to file 2 and so on to the last file. All of these files are still considered to be in the ROOT DIRECTORY BLOCK. You can check that by looking at the longword called PARENT in the FILE HEADER BLOCK's of all 5 files. They will all point to the same parent directory. You might use Hash when you need to check and make sure a file is in the right place. More Details Look at the FILE HEADER BLOCK diagram in the manual. The section called DATA BLOCK KEYS, is where DOS records the locations of all the data blocks for that file. This section differs from a hash table in that the KEYS are stored sequentially from the bottom to the top. KEYS are pointers to the DATA BLOCKS for that file. If you had a file that was 2900 bytes long you would need 6 data blocks to save the data in. The location of the first block would be put in the last longword directly below the checksum and just above the bold line. The second is stored just to left of the first, and so on. If for instance your file needed 100 blocks, the first 72 KEYS would fill the table all the way up to the longword to the right of the checksum. Now the DOS can see that it will need more room so it finds an empty sector and creates a FILE LIST BLOCK, in which it will put the remainder of the KEYS. Now the DOS will need to know where to find this block next time so back in the FILE HEADER at the location called EXTEN it will put the block number where to find the FILE LIST BLOCK. The FILE LIST BLOCK also has a location called EXTEN in case even more room is needed. It also has a location called PARENT that points back to the FILE HEADER. Most of the questions I recieved have been about the data keys and hash table, I hope that clears up everything. Now some options for when you get an error on your disk. DISK ERRORS The problem with errors on Amiga disks, is that you always get a whole track wiped out since the Amiga writes the whole track at the same time. When this happens you could be a little unlucky or very unlucky. If the contents of the bad track was all from one file you are a little unlucky, (unless that was the most important file on the disk) because the problem is localized to one file. This will usually be the last file you saved. If so, use the ERROR SCAN to find and then repair the track, and then delete the file. After the track is fixed try reading it a few times. If it is still bad then you can use Diskcopy to copy the disk, and then throw it away. If you can read it, it was probably just a one time thing. It's up to you whether or not you want to keep using the disk. Now if you were very unlucky the track contained other directories and file headers, or the disk has multiple errors. This calls for a more drastic approach, and a lot more work. There are two things you might do in this instance. The first and easiest is if there are just one of two files that you really need on the disk. All you do is try to copy them off the disk using the Copy command from CLI. The file structure on the disk is just like that of a tree. (hence ROOT BLOCK) If the files you need are closer to ROOT BLOCK than the error, or on a different branch you can copy them off the disk. Now if the disk is really messed up you can try this. First use the ERROR SCAN to find all the bad tracks, then go back and try to repair them all. If you can't read a track after it's repaired that means the disk is bad, but we can still work on it for now. Next use the ZERO DISK menu option. This will clear out the ROOT BLOCK and the BITMAP BLOCK. This has the same effect as deleting everything on the disk. Now remove the disk and set it aside for the moment. Take a blank disk and format it so we will have a place to put the files we recover from the bad disk. Now select the RESTORE option from the side menu and put the bad disk in DF0: and the disk you just formatted in DF1:. When this is done hit RETURN. Since we have zeroed out the bad disk all the files were deleted, so now we will recover the deleted files, everything on the disk. As the filenames are displayed one by one select the ones you need. Sometimes the same filename will come more than once. If this happens and you also save the second file it will overwrite the first one, so skip it this time and after you are done check to see if the first file is the one you wanted. If not just use RESTORE again and save the second one. This last case is only for the most desperate. Say if you had a large text file and you have a track that goes bad in the middle of it. Well it might be worth it to try and recover what's left. What you do since you know what was in the file, is to use the SEARCH option to look around the disk and find a block that has part of your file in it. Once you have found a DATA BLOCK that contains part of your file look at the location called KEY. This points to the FILE HEADER of the file and all of the DATA BLOCKS in your file will have this value in common. Next use SEARCH again to find the rest of the data blocks in your file using the KEY value in your search. Look at the location called SEQ NUM. If your file had 5 blocks in your file each block would be numbered 1 to 5, this is the SEQ NUM. If you find the block that has a 1, then this is the first DATA BLOCK in you file and a 0 in the location NEXT means it is the last block. On a DATA BLOCK there is a location called NEXT. This points to the next DATA BLOCK in the file. What you want to do is find the DATA BLOCK closest to the start of you file. Next click on the OPEN option. This opens a file in the RAM: disk so that you can use the DUMP option to save the block on the screen to ram. Make sure that the DUMP SIZE menu option is set to DATA. Now click on DUMP. Next you want to click on JUMP and then move the mouse pointer over the location called NEXT (look at the DATA BLOCK diagram in the manual) and click again. This moves you the next block in the file. From here on it's DUMP and JUMP until NEXT location is 0, meaning the end of the file. At this point click on CLOSE to close the file in RAM:. You also want to make sure that all the blocks have the same KEY. (second longword on screen.) While doing this if you reach the track where the error is, you have to look around to find where the file continues and start DUMPing from there. Now the file in RAM: called DUMP1 will have your file in it with a gap of missing data where the error was. After reading this I hope you see the reasoning behind making backup copies of all your important disks. One last thing. When you get an error on your disk use Diskcopy to make a copy of it before you start working on it. This way you can try to fix the copy and the bad disk can't get any worse. Good Luck Copyright (C) 1988 by TIGRESS Written by Gary Kemper