850102 DFRAG (Disk FRAGmentation) is a program that reads BITMAP.SYS from a disk drive and prints a histogram of its analysis in terms of lengths of runs of 1's (available blocks) and 0's (in-use). The main FORTRAN program reads the entire bitmap into a byte array, then counts runs of bytes of all zeroes, all ones, and mixed. The current version (2.0G) attempts to extract information from mixed bytes adjacent to 00 or FF bytes, and then does a quick analysis of the remainder to extract information about some combinations of single and double bits. The pseudo-log (base 2) of the length of the run is used to establish the histogram bucket to be incremented. After the bitmap has been scanned, the histograms are printed (individually scaled), in conjunction with arithmetic and logarithmic means*, and the arithmetic median. A blank line between histogram lines indicates that one or more empty histogram buckets was skipped. (* Logarithmic mean is the anti-log of the arithmetic mean of the pseudo-logs of the run-lengths; as such it is a little more useful than the arithmetic mean of the run-lengths, but has a quirk such that its value may be less than, equal to, or greater than the median, depending on how many runs of length 1 were encountered (log(1) === 0), whereas arithmetic mean will always be greater than or equal to the median.) Output is paginated and time-stamped. Two MACRO routines complete the package: 1) ACCBITMAP assigns a channel, and accesses BITMAP.SYS by its file-id (2,2,0); the statements ; *** .ASCII /_/ .ASCII /$255$/ should be alternately activated or commented out depending on operation in or out of a cluster. 2) L2X2 performs the pseudo-log2 function with a scaling factor of 4 (2**2): L2X2(I) = log2(I)*4 + [(I - (exp2(log2(I)))/(log2(I)*4)] but it's really not that complicated: it floats its integer parameter, subtracts the exponent bias (to regain the "hidden" bit), and shifts to return the scaled value. Examples: I L2X2(I) 1 0 2 4 3 6 4 8 5 9 6 10 7 11 8 12 9 12 10 13 It has potential application for histogram scaling also, where the bins are linear but have an exponential range of values. Generation FORTRAN DFRAG MACRO ACCBITMAP MACRO L2X2 LINK DFRAG,L2X2,ACCBITMAP [ L2X2 first due to frequency of usage ] Execution DFR*AG :== $dev:[directory]DFRAG DFRAG Dxyz options [ produces output file Dxyz.DAT ] [ with FORTRAN carriage-control ] options: /TRace produce Dxyz.TRC showing runs and adjacent-bit adjustment /SHort suppress output line for empty bins (default) /LOng print bin-number, with blank value, for empty bins or RUN DFRAG [ prompts for Dxyz ] /SHort option is the default, no /TRace Caveats, problems, etc The current version does not evaluate all run lengths in "mixed" bytes; that is planned for version 2.1, after I figure out whether to do it by table lookup or LIB$FF{S/C} calls. The output (and trace) file(s) will be incorrect by the amount of extent-caching current for the drive. I have not been able to determine how to (temporarily) force extent-caching to be disabled for a drive. The following sequence will usually yield two different successive versions of Dxyz.DAT: DFRAG Dxyz ANA/DISK Dxyz: [ let run for a few seconds, then ^Y or ^C ] DFRAG Dxyz If anyone can tell me how the VERIFY utility does it (I tried to figure it out from the microfiche), the information would be greatly appreciated, and quickly incorporated into the next release. Device name MUST be 4 characters, and options MUST follow the device name (spaces are not required, however). User must have read-access to [000000]BITMAP.SYS in the disk in question, either directly, or by SYSPRV or READALL privileges. Charles Garman 609-866-8821 RCA MSR (soon to be GE?) Borton Landing Rd, POW-2 Moorestown NJ 08057