<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Fri, 16 Aug 1985 13:01:00 GMT
From   : grayson%uiucuxc.uiuc.arpa@BRL.ARPA
Subject: Re: CP/M directory information

In a directory entry are 16 bytes for storing allocation group numbers of
the extent.  If the number of allocation groups is larger than 255 then
these numbers take up two bytes, else one byte.  Now, once you know the
size of an allocation group (typically 1K or 2K) you can compute how much
disk space one directory entry can refer to - this typically comes to 16K
or 32K.  If it is 16K or less, then the maximum number of 128-byte sectors
in that space is 128 or less, so the field giving the number of sectors
holds that number just fine, and extents are numbered sequentially.
On the other hand, if it is 32K or more, then the maxmimum number of 128-
byte sectors is 256 or more.  In this case we define an extent to be 16K
of file space, and each directory entry will refer to more than one extent.
The extent number field of the directory entry will contain the number of
the LAST extent referred to, and the number-of-sectors field will indicate
the number of sectors in that last extent.  The extents other than the 
last one all contain 128 sectors, so everything is determined.
  Another way to think about it is this.  Suppose 2**(n+7) is the number of
sectors one directory entry can reference.  Then we have n bits of overflow
from the number-of-sectors field (7 bits) and those n bits are stashed in
the low order part of the extent-number-field.  What makes this not QUITE
right is that on occasion the 8-th bit of the number-of-sectors field is 1,
and then that bit is the overflow bit for the other n+7 bits.

       uucp:   {ihnp4,pur-ee}!uiucdcs!uiucuxc!grayson
               Dan Grayson, Math Dept, Univ of Ill, Urbana 61801
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>