Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: Notesfiles $Revision: 1.7.0.8 $; site uiucuxc Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxn!ihnp4!inuxc!pur-ee!uiucdcs!uiucuxc!grayson From: grayson@uiucuxc.Uiuc.ARPA Newsgroups: net.micro.cpm Subject: Re: CP/M directory information Message-ID: <104600005@uiucuxc> Date: Fri, 16-Aug-85 09:01:00 EDT Article-I.D.: uiucuxc.104600005 Posted: Fri Aug 16 09:01:00 1985 Date-Received: Tue, 20-Aug-85 22:05:39 EDT References: <1215@hcrvx1.UUCP> Lines: 25 Nf-ID: #R:hcrvx1.UUCP:-121500:uiucuxc:104600005:000:1625 Nf-From: uiucuxc.Uiuc.ARPA!grayson Aug 16 08:01:00 1985 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