Scor­pio News

  

October–December 1987 – Volume 1. Issue 4.

Page 16 of 55
HexDecInterpretation
0028H40;SPTCP/M Sectors (128 bytes) per track
05H5;BSHBlock Shift Factor
1FH31;BLMBlock Mask
03H3;EXMExtent Mask
00C4H196;DSMDisk Size in Blocks-1
007FH127;DRMNumber of directory entries-1
80H;AL0Reserved directory..
00H;AL1..blocks
0020H32;CKSChecksum Size
0002H2;OFFNumber of system tracks on disk

The abbreviations used are those used by Digital Research in the CP/M 2 Alteration Guide. Decimal value are given where appropriate. Note that CP/M 1.4 doesn’ use disk Parameter Blocks and that the DPB for CP/M 3 contains extra information about physical sector size.

CP/M uses the value SPT to calculate the track and sector numbers for a particular disk data block. The block number and an offset showing where in the block the required record lies need to be converted to that the appropriate track and sector can be accessed. SPT is determined by the physical disk format. Gemini in the QDDS format have 10 sectors of 512 bytes on each track. CP/M uses 128 byte records and so 40 CP/M sectors will fit on a tack. The Gemini SDDS format disks use a figure of 18 for SPT while the Gems DDDS format uses 80. The latter figure is possible because of the method of access to the disk for the DDDS format. Some explanation seems in order.

Cylindrical and Track methods of disk access

There are two methods of accessing disks. The first method is to start on side 1 of the disk and number the tacks from say 0 to 79 (QDDS) then flip sides and call the tracks 80 to 159. Note that this is just for convenience as the tracks on side 2 of the disk are also physically numbered 0-79. As far as CP/M is concerned, it is seeing a single sided disk with 160 tacks. This is known as the Track method of accessing a disk.

The second method is to have the tracks on both sides of the disk numbered from say 0 to 34 (DDDS) and having filled track 0 on side 1 we flip sides and continue writing to tack 0 of side 2 of the disk. In this case. CP/M thinks it seeing a single sided disk with 35 tracks but the tracks are twice as long as before (i.e. 80 SPT). Thus method of access is known as the Cylinder method. You should note that the Gemini Quad density format is a misnomer used by a number of companies. In realty, it should be called 80 track double density or double density with double track density.

BLM, BSH and EXM

The block mask (BLM) is basically one less than the umber of 128 byte records that will fit in one block. Our figure of 31 means that 32 records will fit in the block. This enables the BDOS to calculate the block size as, you will have noticed, it wasn’t given in the DPB. If we take the current record count from the FCB and logically AND it with the block mask, we will obtain a number in the range 0-31 which tells us where in a block the particular record may be found. Take, for example, that the current record count is 92 or 01011100. If we AND that figure with 31 or 00011111 we get the result 00011100 or 28. This indicates that the record occupies the 29th (0-31 remember) record position in the block,

The extent mask (EXM) is one less than the umber of extents that may be controlled by one directory entry. This depends upon the maximum disk size as, if 16 bit values are recorded in the directory, then each directory entry will refer to half the number of extents than it would if 8 bit entries were being used. In the case of the QDDS format, this value is 3 which indicates that 4 extents may be recorded in a single directory entry. When used as a mask by ANDing the extent byte of the directory entry with EXM, we produce a number in the range 0-3 which tell the BDOS which extent we are referring to in the entry.

The next field is the Block Shift Factor (BSH), and is used by the BDOS when converting CP/M records and extents into block positions in a directory entry and vice versa. BSH is defined as the logarithm base two of the block size in 128 byte records or, LOG2(BLS/128) where LOG2 represents the binary logarithm function. That last bit is more or less a direct quote from Digital Research and probably means as much to you now as it did to me initially.

Page 16 of 55