home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / dskutl / msodball.arc / DU87DATA.DOC < prev    next >
Encoding:
Text File  |  1993-12-06  |  3.3 KB  |  77 lines

  1. Introduction
  2. ▓▓▓▓▓▓▓▓▓▓▓▓
  3. The following information is useful if the CP/M public domain disc sector
  4. editor DU87 is used to examine the contents of an MSDOS Oddball disc. See
  5. "Sector editors" in MSODBALL.DOC.
  6.  
  7. DU87 terminology
  8. ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  9. A DU87 sector corresponds to a CP/M 128-byte logical record, not to the
  10. 512-byte sector which physically is written to and read from disc. Numbering
  11. within DU87 is hexadecimal and starts from zero (mostly):
  12.  
  13.     Disc, 180k type =  40 Tracks, numbered 00 to 27
  14.           720k type = 160 Tracks, numbered 00 to 9F
  15.     Track           =  36 Sectors, numbered 01 to 24
  16.     Sector          = 128 bytes, numbered 00 to 7F.
  17.  
  18. CP/M and Locoscript
  19. ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  20.   Disc space is allocated to files in units known as Allocation Groups (not to
  21. be confused with LocoScript's Groups).
  22.  
  23. Formatting produces:
  24. 173k CP/M format:  175 1k Groups numbered 00 to AE, starting at track 01
  25. Data-only format:  180 1k Groups numbered 00 to B3, starting at track 00
  26. 706k CP/M format:  357 2k Groups numbered 000 to 164, starting at track 01.
  27.  
  28. The disc directory occupies Groups 00 and 01 (173k or 178k formats), or 00 01
  29. 02 and 03 (706k and large-directory format).
  30.  
  31. The Groups allocated to a file are listed in the file's directory entry (or
  32. entries).
  33.  
  34. MSDOS, PCDOS, DRDOS
  35. ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  36.   Under DOS Allocation Groups are known as clusters. A DOS Oddball disc
  37. contains 353 2k clusters, numbered 000 to 160.
  38.  
  39. DOS Oddball disc usage in terms of DU87 track/sector numbers:
  40.     Boot sectors        00/01 to 00/10
  41.     File alloc table 1    00/11 to 00/1C
  42.     File alloc table 2    00/1D to 01/04    (duplicate of FAT 1)
  43.     Directory        01/05 to 02/1C
  44.     File Clusters        02/1D to 9F/23  (same place as for CP/M).
  45.  
  46.   The first cluster in a file is indicated in the file's directory entry.
  47. Subsequent clusters are traced through the file allocation table. Within the
  48. table each cluster is allotted 1 whole + 1 half byte to indicate the next
  49. cluster. For an odd-numbered cluster the whole byte is suffixed with the high
  50. nibble from the preceding byte. For an even-numbered cluster the whole byte is
  51. prefixed with the low nibble from the following byte. FFF indicates the last
  52. cluster of a file. 000 indicates an unused cluster.
  53.  
  54.   A DOS sub-directory occupies clusters in the file storage area, with the
  55. first cluster indicated in the sub-directory entry in the parent directory. The
  56. first cluster of a sub-directory starts with entries '.' and '..'.
  57.  
  58.   The DU87 commands that deal with CP/M files, such as F (ind file) and M (ap
  59. disc) will be of no use with DOS discs.
  60.  
  61. Conversion formulae in decimal notation.
  62. ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  63. C = cluster number                      G = DU87 Allocation Group number
  64.                                  D = DOS absolute sector number
  65. N = position of whole byte within FAT    T,S = DU87 track,sector numbers.
  66.  
  67. C = G - 2                       G = C + 2
  68. D = 4 * C + 17            T = D div 9    S = (D mod 9) * 4 + 1
  69. N = (3 * C + 1) div 2        C = (9 * T + (S-1) / 4  - 17) div 4.
  70.  
  71.  
  72. Decimal (n) / Hexadecimal (xyz) conversions using pocket-calculator
  73. arithmetic (taking A = 10, B = 11, C = 12, D = 13, E = 14, F = 15):
  74. x * 16 + y * 16 + z =        n / 256 - x * 16 - y * 16 =
  75.              l             l      l       l
  76.              n             x=int()  y=int()  z
  77.