Scor­pio News

  

October–December 1987 – Volume 1. Issue 4.

Page 19 of 55

DRM contains the number of directory entries of the disk less one. Again, the directory entries are numbered from 0 to DRM (0-127 or 0-7FH for the QDDS format).

AL0 and AL1 contain the first two bytes of the allocation vector for the drive for which the DPB applies. These two bytes are copied into the allocation vector when the drive is logged in. Remembering that the directory occupies the first block or two on the disk we need to reserve the required number of blocks by filling in the appropriate bits in the allocation vector. In our case, we only need to reserve one block and this has been done by setting bit 7 of AL0, hence the valve 80H. Clearly, we can now see that a maximum of 16 blocks may be reserved for directory entries (by setting all 16 bits in AL0 and AL1). With a 1K block size, a maximum of 512 directory entries may be allocated at 32 directory entries in each block. If a 16K block size is used, the maximum number of directory entries will now be 8192.

CKS is known as the check size and simply tells the BDOS the length of the checksum vector for the currently logged in drive. If fixed media drives are in use, the value of CKS may be set to zero to prevent directory checking.

OFF is the number of system tracks on the disk. This figure depends upon the physical disk format and the CP/M system size. Clearly, a single density disk will require more system tracks than a double density disk in order to save the system. As an example, the SDDS format 3 system tracks, the QDDS and QDSS formats have 2 and the DDDS format has 1. The discrepancy between the QD and DD formats is again because of the apparent length of the tracks in the DD which uses the cylindrical method of disk access. CP/M uses the OFF parameter when calculating track numbers for pending read or write so that it effectively ignores system tracks. This is particularly useful whee partitioning a high capacity drive (i.e. a Winchester) into a number of logical drives. If, say, the first 50 tracks are defined as logical drive A, logical drive B could have a value of 50 for the OFF parameter so that it would start at the 51st track of the physical drive.

The CP/M 3 DPB

Now that we have exhausted the CP/M 2.2 Disk Parameter Block, we can now examine the CP/M 3 DPB. An example of the later is given below:

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
02H2;PSHPhysical Record Shift Factor
03H3;PHMPhysical Record Mask

A brief examination of the CP/M 3 Disk Parameter Block will reveal that it is identical to the CP/M 2.2 DPB apart from the last two entries so I shall only explain these additions.

PSH is the physical record shift factor and is described by Digital Research at being LOG2(physical sector size/128). For the Gemini QDDS format which uses 512 byte physical sectors, this value is 2.

PHM is the physical record mask and calculated to be (physical sector size/128)-1.

PSH and PHM are used in exactly the same way as BLM sod BSH except that instead of converting CP/M records and extents to block numbers, they are now converting CP/M records to physical sector numbers. Imagine that we have extracted a block and CP/M record number from the directory using BSH, BLM and EXM. The value that we obtained when explaining BSH and BLM were block number 36 on the disk and record number 11 within that block.

There are 32 CP/M record in the block numbered from 0 to 31 as described before. Additional, we now know that there are eight physical sectors (of 512 bytes each) in the block, each containing

Page 19 of 55