home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / fog / starter / fbad57.doc < prev    next >
Encoding:
Text File  |  1993-05-06  |  6.0 KB  |  130 lines

  1.  
  2.                FBAD.ASM ver. 5.7
  3.                (revised 11/29/84)
  4.             NON-DESTRUCTIVE DISK TEST PROGRAM
  5.  
  6.   FBAD will find all bad blocks on a disk and build a file [UNUSED].BAD
  7.   to allocate them, thus "locking out" the bad blocks so CP/M will not
  8.   use them.  This allows continued use of the disk as though it had no
  9.   bad areas.
  10.  
  11.   Originally written by Gene Cotton, published in "Interface Age" for
  12.   September 1980, page 80.
  13.  
  14.   This program has been written to allow it to work with (hopefully) all
  15.   CP/M 2.x systems, and most 1.4 CP/M systems.    It has been tested on
  16.   numerous different disk systems.
  17.  
  18.  =======================================================================
  19.  
  20.   SYSTST, BADUSR and ASTRS options:
  21.  
  22.   Many double-density disk systems have single-density system tracks.
  23.   If this is true with your system, you can change the program to skip
  24.   the system tracks, without re-assembling it.    To do this, set the byte
  25.   at at 103H to 0 if you don't want the system tracks tested, otherwise
  26.   keep it 1.  The program tests if you have a "blocked" disk system,
  27.   that is, when the same physical disk is separated into logical disks
  28.   by use of the SYSTRK word in the disk parameter block.  If more than 5
  29.   tracks are specified, the program skips the system tracks.
  30.  
  31.   If you are using CP/M 2.x , you may assign the user number where the
  32.   [UNUSED.BAD] file will be created, by changing the byte at 104H to the
  33.   desired user number.
  34.  
  35.   FBAD displays the TRACK-Nr it has checked on the screen-terminal.  If
  36.   you like to log the results on a printer (or you have a hardcopy term-
  37.   inal, you may want to change LOC 105H to a non-zero value, and FBAD
  38.   will display a * for each track checked.  The number in 105H controls
  39.   the number of *'s per line.  (Note patch values are HEX: 76=4CH.)  Use
  40.   ^P to turn the printer on before running FBAD, it will be automatically
  41.   turned off by the warm boot at the end.
  42.  
  43.   NOTE:  These changes can be done with DDT as follows:
  44.  
  45.          A>DDT FBAD.COM
  46.          -S103
  47.          103 01 00    ;Don't test SYSTEM tracks
  48.          104 FF 0F    ;Put [UNUSED.BAD] in USER 15
  49.          105 00 4C    ;Issue CR/LF after 76 *'s
  50.          106 31 .    ;Finished with changes
  51.          -^C
  52.  
  53.          A>SAVE 7 FBAD.COM
  54.  
  55.  =======================================================================
  56.  
  57.                 USING THE PROGRAM
  58.  
  59.   Before using this program to "reclaim" a diskette, the diskette should
  60.   be reformatted.  If this is not possible, at least assure yourself
  61.   that any existing files on the diskette do not contain unreadable re-
  62.   cords.  If you have changed diskettes since the last warm-boot, you
  63.   must warm boot again before running this program.
  64.  
  65.   To use the program, insert both the disk containing FBAD.COM and the
  66.   diskette to be checked into the disk drives.    The diskette containing
  67.   FBAD.COM can be the one that is to be checked.  Assume that the pro-
  68.   gram is on drive "A" and the suspected bad disk is on drive "B".  In
  69.   response to the CP/M prompt "A>", type in FBAD B: This will load the
  70.   file FBAD.COM from drive "A" and test the diskette on drive "B" for
  71.   unreadable records.  The only allowable parameter after the program
  72.   name is a drive specification (of the form " N:") for up to four (A
  73.   to D) disk drives.  If no drive is specified, the currently logged-in
  74.   drive is assumed to contain the diskette to check.
  75.  
  76.   The program first checks the CP/M System tracks (up to 5), and any
  77.   errors here prohibit the diskette from being used on drive "A", since
  78.   all "warm boots" occur using the system tracks from the "A" drive.
  79.   Floppy diskettes normally use 2 tracks for the system; Winchester hard
  80.   disks may use one or more.
  81.  
  82.   Version  5.5    and  later  automatically skip the system check if 5 or
  83.   more tracks are reserved for the system.  This allows the program to
  84.   be used on BOTH floppy and Winchester systems without patching.
  85.  
  86.   The  program next checks the first two data blocks containing the
  87.   diskette directory.  If errors occur here, the program terminates with
  88.   the control returning to CP/M.  No other data blockes are checked as
  89.   errors in the directory render the diskette useless.
  90.  
  91.   Finally, all the remaining data blocks are checked.  Any records that
  92.   are unreadable cause the data block which contains them to be stored
  93.   temporarily as a "bad block".  At the end of this phase, the message
  94.   "nn bad blocks found" is displayed (where nn is replaced by the number
  95.   of bad blocks, or "No" if no read errors occur).  If bad blocks occur,
  96.   the filename [UNUSED].BAD is created, the list of "bad blocks" is put
  97.   in the allocation map of the directory entry for [UNUSED].BAD, and the
  98.   file is closed.  When the number of "bad blocks" exceeds 16, the pro-
  99.   gram will open additional extents as required to hold the overflow.
  100.   If the diskette has more than 32 "bad blocks", perhaps it should be
  101.   sent to the "big disk drive in the sky" for the rest it deserves.
  102.  
  103.   If any "bad blocks" do occur, they are allocated to [UNUSED].BAD and
  104.   no longer will be available to CP/M for future allocation.  This ef-
  105.   fectively locks out bad records on the diskette allowing its continued
  106.   use.
  107.  
  108.  
  109.  =======================================================================
  110.  
  111.   11/29/84  Integrated Mike Webbs idea to display Track-Nr. Changed DOC
  112.     v57        up front accordingly.  (BGE)
  113.  
  114.   07/04/84  Added Ted Shapin's fixes from 1981 that were not included in
  115.     v56        the 06/07/84 version.  Reformatted.  (IMH)
  116.  
  117.   06/07/84  Added code at CHKSYS to skip system tracks if more than 5
  118.     v55     are present (most systems use 1 or at most 2 tracks for the
  119.             system).  This makes the program practical for both floppy
  120.          and Winchester systems.  Cosmetic change for printer logging
  121.          to add CR/LF after 76 *'s.  Fixed problem in DECOUT to give
  122.          correct total for max size Winchester disks. (DHR)
  123.  
  124.  =======================================================================
  125.  
  126.  
  127.  
  128.  
  129.  
  130.