home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / utilitys / 483 / ddhelp / diskmap.hlp < prev    next >
Encoding:
Text File  |  1991-05-30  |  5.0 KB  |  199 lines

  1.  
  2.  
  3.                              The Disk Doctor
  4.  
  5.  
  6.     The ST Disk Structure:
  7.  
  8.        sector 0 is the boot track
  9.        sectors 1 through 5 are the first copy
  10.            of the File Allocation Table (FAT)
  11.        sectors 6 through 10 are the second FAT copy
  12.        sectors 11 through 17 are the directory
  13.        the remainder of the disk is data space.
  14.  
  15.          On floppies, the boot track is 1 sector long, each FAT is 5
  16.     sectors, the directory is 7 sectors. On a single-sided disk, this
  17.     theoretically leaves 702 sectors for data, but the operating
  18.     system seems to count somewhat less: when a disk is formatted, it
  19.     shows only 698 sectors available. Double-sided floppies also have
  20.     1 sector boot tracks, On at least one hard disk, the boot track is
  21.     again 1 sector long, each FAT is 41 sectors and the root directory
  22.     (the main directory or desktop) is 16 sectors. Other hard disk
  23.     structures may vary.
  24.  
  25.  
  26.     DIRECTORY STRUCTURE
  27.  
  28.          The root or main directory is in the seven consecutive
  29.     sectors mentioned above. A subdirectory (a folder or path) is
  30.     actually a file on the disk. While the root directory is limited
  31.     in the maximum number of files it can take, since files need not
  32.     be contiguous, a subdirectory is not thus limited.
  33.  
  34.  
  35.          Each directory entry is 32 bytes long: there are 16 entries
  36.     per sector, laid out so:
  37.  
  38.  
  39.          file name          bytes 0-7
  40.          extension          bytes 8-10
  41.          attributes         byte 11
  42.          reserved space     bytes 12-21
  43.          time stamp         bytes 22-23
  44.          date stamp         bytes 24-25
  45.          starting cluster   bytes 26-27 (an integer)
  46.          length (bytes)     bytes 28-31 (a 4-byte integer)
  47.  
  48.          File name is the part of the name before the period, eight
  49.     bytes padded on the right with blanks if less than that in length.
  50.     If the first byte in a name is zero, the entry is unused. If $E5
  51.     (229 decimal), then the file has been erased. If the first byte is
  52.     a period, ($2E), then the entry is a special type of subdirectory.
  53.     Extension is the remainder of the file name; three bytes, again
  54.     padded with blanks. Reserved bytes are usually all zero.
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.                           Disk structure: Page 8
  65.  
  66.  
  67.  
  68.  
  69.                              The Disk Doctor
  70.  
  71.  
  72.          Attributes describe how the files are treated by the system.
  73.     If the bit is zero, the attribute is off, if one it is on (used):
  74.  
  75.  
  76.             bit 0 means the file is read only
  77.             bit 1 means the file is hidden
  78.             bit 2 means it is a system file
  79.             bit 3 means it is a volume label, not a file
  80.             bit 4 means it is a subdirectory
  81.             bit 5 is an archive bit
  82.             bits 6 and 7 are unused at present
  83.  
  84.          A read-only file cannot be written to or deleted. Hidden and
  85.     system files are normally not seen in the directory listing but
  86.     you can see these files by viewing the directory from the repair
  87.     menu. The volume label is the disk name usually entered at format
  88.     time. It normally only appears in the root directory.
  89.  
  90.  
  91.          The subdirectory attribute says this is a folder (path)
  92.     rather than a file, although they are stored in the same manner. A
  93.     subdirectory is structured in the same manner as a root directory
  94.     except that has no fixed size and can grow as large as necessary.
  95.  
  96.  
  97.          The archive bit is set if a file has been changed since its
  98.     last backup. Used normally only with hard disks. Attributes are
  99.     marked on the disk information screen by a single letter. If an
  100.     'x' appears below that letter, then the attribute is set.
  101.  
  102.  
  103.          The time and date stamps record the last change of a file.
  104.  
  105.  
  106.     time stamp:
  107.             bits 0-4 are seconds/2 (0 - 29)
  108.             bits 5-10 are minutes (0 - 59)
  109.             bits 11-15 are hours (0 - 23)
  110.  
  111.     date stamp:
  112.             bits 0-4 are the date (1-31)
  113.             bits 5-8 are the month (1-12)
  114.             bits 9-15 are the year (add 1980 to get the correct
  115.     value)
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.                           Disk structure: Page 9
  131.  
  132.  
  133.  
  134.  
  135.                              The Disk Doctor
  136.  
  137.  
  138.          Starting cluster is an Intel 8088 format integer: that is,
  139.     its bytes are swapped. That is, the low byte comes before the high
  140.     byte. It is simply the cluster number where the file begins (there
  141.     are two sectors in each cluster). For where the file goes after
  142.     that, see the FAT. File Length is an Intel 8088 format longint:
  143.     that is, its words are swapped and within each word, the bytes are
  144.     swapped.
  145.  
  146.  
  147.          File size contains the size on disk in bytes but the actual
  148.     size in memory may be smaller if DOS reaches the last cluster in
  149.     the FAT before this many bytes are read.
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.                           Disk structure: Page 10
  197.  
  198.