home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / lambda / soundpot / a / diskdoc.lbr / DISKDOC.DZC / DISKDOC.DOC
Encoding:
Text File  |  1993-10-26  |  5.6 KB  |  135 lines

  1. Small-C DISKDOC:  A REPAIR AND MAINTENANCE UTILITY
  2.  
  3. By Egil Kvaleberg, N-4060 Kleppe, Norway.
  4.  
  5. Appeared in the Dr. Dobb's Journal #66, April 1982.
  6.  
  7.        Diskdoc is a utility that, like its name implies, is
  8. intended for repair and maintainance of diskettes and other
  9. random access mass storage media. Tasks accomplished include:
  10.  
  11.  i     Taking backups (also in a single drive system).
  12.  ii    Verifying data integrity.
  13.  iii   Restoring previously deleted files (by manual patching).
  14.  iv    Repairing faulty sectors.
  15.  v     Debugging disk driver routines and controller hardware.
  16.  vi    Debugging file systems.
  17.  
  18.        Diskdoc has been in frequent use for about two years now
  19. (including a one year assembly language childhood), and has proved
  20. a useful companion when exploring the oh-so-vulnerable world of
  21. diskettes.  The version listed runs under CP/M, but adapting to
  22. other operating systems will probably not be found too difficult a
  23. task to accomplish.  As explained in the listing, the program is
  24. written to be compiled by the Ron Cain Small-C compiler.  Small-C
  25. is smaller than standard C, and conoisseurs of the C language will
  26. find some of the constructions used quite primitive.  If you
  27. prepare the program for a richer dialect of C, you might consider
  28. rewriting parts of the program.  Except for efficiency, perhaps,
  29. there is little reason to take the bother since Small-C is a true
  30. subset of C.
  31.  
  32. REGARDING THE CP/M VERSION
  33.  
  34.        The CP/M version, as listed, will adapt to the physical
  35. characteristics of the drive (track and sector counts).  This is
  36. accomplished by reading the disk parameter block returned by the
  37. BIOS drive select call.  CP/M version 2.0 or better is required.
  38. For drives using sector blocking/deblocking schemes, the sectors
  39. that diskdoc works with will not correspond directly to the
  40. physical sectors.
  41.  
  42. TALKING TO DISKDOC
  43.  
  44.        Diskdoc always tries to give self explanatory prompts.  The
  45. default value can usually be displayed by typing <cr> once.  If
  46. you should enter an inappropriate character, diskdoc simply
  47. refuses to echo it.  Entries may be corrected by using the
  48. backspace key.  A final <cr> will end the input line.
  49.  
  50. THE COMMAND LEVEL
  51.  
  52.        Starting up, diskdoc will enter the command level,
  53. requesting a single letter command:
  54.  
  55.  a     Adapt to terminal type.  You will asked to enter the
  56.        character that will move the cursor home.  An escape
  57.        sequence is acceptable.  This is all that is required to
  58.        adapt diskdoc to virtually any video terminal.  It is
  59.        assumed that the width of the screen is 80 characters.
  60.  
  61.  b     Backup entire diskette on a sector-by-sector basis.  You
  62.        will be asked to enter the source and destination drive
  63.        names (a-h).  It is crucial to double-check the direction
  64.        of data flow.  The same drive might be assigned as both
  65.        source and destination, in which case diskdoc will request
  66.        a diskette change whenever necessary during the copy
  67.        process.  If an error is detected in the source diskette,
  68.        diskdoc will ask whether the sector read operation should
  69.        be retried, the error ignored, or the backup aborted.  It
  70.        is recommended to retry a few times before declaring a
  71.        sector unrecoverable, thereby filtering out intermittently
  72.        occuring errors.  If desired, backup can be aborted by
  73.        typing any character.
  74.  
  75.  c     Compare the contents of two diskettes.  Every discrepancy
  76.        will be reported.  Abort by typing any character.
  77.  
  78.  e     Exit.  You will be prompted to insert a system diskette
  79.        before leaving.
  80.  
  81.  p     Patch.  Look at and optionally patch selected sectors.  For
  82.        patch subcommands, see below.
  83.  
  84.  s     Scan diskette by reading every sector.  The test will
  85.        quickly locate any sector that doesn't give a proper CRC.
  86.        The test may be interrupted by typing any character.
  87.  
  88.  t     Test diskette.  A test pattern will be written, and the
  89.        entire diskette will then be read back and compared.  The
  90.        write operation may be omitted.  The command provides
  91.        useful verification of disk controller hardware and
  92.        software operation.
  93.  
  94.  z     Zero diskette.  The specified number of tracks will be
  95.        erased by filling the EBCDIC character 'V' (0E5H).
  96.  
  97. PATCH COMMANDS
  98.  
  99.  <sp>  Move the cursor to the next byte.
  100.  
  101.  <bs>  Move the cursor to the previous byte.
  102.  
  103.  <cr>  Move the cursor down, i.e. 16 bytes forward.
  104.  
  105.  <hex> To patch, enter the new hex byte directly. After having
  106.        entered the first digit, a <bs> will "undo" it.  After
  107.        having entered the second, the cursor will move to the
  108.        next byte.
  109.  
  110.  '     To enter an ascii character, type a single quote followed
  111.        by the desired character.
  112.  
  113.  l     Read the logically following sector.  This command is
  114.        useful where a mapping between physical and logical
  115.        sectors exists, such as in standard CP/M single density
  116.        diskettes.
  117.  
  118.  n     Read the next sequential sector.  The next track is
  119.        accessed if the end of the current one is reached.
  120.  
  121.  q     Quit patch mode.
  122.  
  123.  r     Re-read.  Read the current sector once again.
  124.  
  125.  s     Shift the rest of the sector one bit-position to the
  126.        right.  This command is useful when attempting to repair
  127.        sectors where the controller has lost a few bits here and
  128.        there.
  129.  
  130.  t     Select a new track and/or sector.
  131.  
  132.  w     Write back the current sector.  Remember to use this
  133.        command after having made any changes, since no automatic
  134.        write is performed.
  135.