home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / ENTERPRS / CPM / UTILS / S / UNDEL11.ARK / UNDEL.DOC next >
Text File  |  1989-09-27  |  3KB  |  67 lines

  1.                  Rejoice, all Hard Disk Users!!
  2.    At last, an UNDELETE program that will work on a hard disk!
  3.  
  4.      To the best of my knowledge,  this program will work on  any
  5. physical disk media - regardless of sector skew factors,  maximum
  6. directory entries per disk, or groups per directory.  As far as I
  7. know,  this is the only UNDELETE that looks at the Disk Parameter
  8. Header to get the Sector Translation Table and the Disk Parameter
  9. Block  and all of its associated values to go out and access  the
  10. directory  one sector at a time through either the physical  end-
  11. of-directory  or  an 'E5 wall' (note:  because of the 'E5  wall',
  12. this  will  not work on TURBO DOS's hashed  directory).   It  was
  13. written  in MicroSoft Fortran-80 only because I  couldn't  figure
  14. any  way  to  get  a 16-bit by 16-bit divide to  work  nicely  in
  15. assembly (don't panic,  I don't use ANY of Fortran's I/O, I do my
  16. own); thus since not everyone HAS Fortran, I am not including the
  17. source.   But if anyone out there would like to provide mK1with a
  18. nice divide routine,  I would be more than happy to re-write this
  19. in Z-80 assembly and take advantage of a little faster execution.
  20.      If you are interested, the execution goes as follows:
  21.  
  22. 1)   clear the crt screen (I use a general purpose clear code:  1
  23.      carriage return,  24 line feeds, then 23 vertical tabs) then
  24.      give the sign-on.
  25.  
  26. 2)   check for CP/M 2.0 or greater
  27.  
  28. 3)   get  the input file name from the system FCB (I don't  allow
  29.      ANY wild cards,  as I know this could be a 26Mbyte disk  and
  30.      that's asking for trouble).
  31.  
  32. 4)   get  and  stash  the current drive,  then  BIOS  select  the
  33.      working drive (thus getting the address of the DPH).
  34.  
  35. 5)   get  the addresses of the Sector Translation Table  and  the
  36.      DPB.
  37.  
  38. 6)   from  the  values in the DPB,  calculate the maximum  number
  39.      groups in the directory.
  40.  
  41. 7)   then  start stepping through the directory at group 0  using
  42.      the  BIOS sectrn to convert from logical to physical  sector
  43.      numbers  until  encountering  either an  'E5  wall'  or  the
  44.      physical end-of-directory.
  45.  
  46. 8)   when  done,  inform  user  of physical  or  logical  end-of-
  47.      directory, and whether we did any undeletions.
  48.  
  49. 9)   if  we did any undeletions,  use BDOS function 37  to  reset
  50.      only that working  drive.
  51.  
  52. 10)  finallly BDOS select the old current drive, and we are done!
  53.  
  54. As  usual for any undelete program,  there is the caveat  that  I
  55. don't check if you are undeleting any older-and-larger-extents or
  56. re-used entries, but this sure beats using DU as I can't think of
  57. any way that DU can do this as nicely.
  58.  
  59. If  you  would  like to contribute that 16-bit by  16-bit  divide
  60. routine, please respond to:
  61.  
  62.                Matthew R. Ward
  63.                Mail Stop:  201-230
  64.                Jet Propulsion Laboratory
  65.                4800 Oak Grove Drive
  66.                Pasadena, CA     91109
  67.