Scor­pio News


July–September 1987 – Volume 1. Issue 3.

Page 13 of 67

The length of the vector is calculated to be (Number of blocks)/8 bytes long, rounded up to the nearest whole byte. In the Digital Research manuals, this is quoted as (DSM/8)+1 where DSH is one less than the total number of blocks contained on the disk. Here is another good reason for having larger block sizes in that the bigger the block size, the fewer blocks there will be and the smaller the allocation vector will be (i.e. the BIOS will be smaller and the TPA, consequently, may be larger).

The CP/M 3 DPH

By contrast, a CP/M 3 DPH is given below. Digital Research needed to increase the amount of date provided by the DPH while providing upwards compatibility with CP/M 1.4 and CP/M 2.2, Further, they have come to realise that many systems require to access disks of different formats and that few systems use a 128 byte sector size on their disks.

READ; Address of sector read routine
WRITE; Address of sector write routine
LOGIN; Address of disk login routine
INIT; Address of disk initialisation routine
UNIT; FDC relative drive code for this drive (Byte)
TYPE; BIOS scratchpad, Current density etc. (Byte)
XDPH:XLT; Translate table address
0000; 9 bytes scratchpad
MF; Media Flag (Byte)
DPB; Disk Parameter Block address
CSV; Checksum Vector address
ALV; Allocation Vector address
DIRBCB; Directory Buffer Control Block address
DTABCB; Data Buffer Control Block address
HASH; Hash Table address
HBANK; Hash Table Memory Bank (Byte)

The major differences between a CP/M 2.2 and CP/M 3 DPH are quite obvious at a glance. The DPB entry is as described in the section concerning the CP/M 2.2 DPH and will not be repeated here. Under CP/M 3, all disk transfers are in terms of physical disk sectors and the sector translation table, at long last, now also applies to physical sectors of whatever size. This means that it is no longer necessary to provide special translation routines in the BIOS for sectors that are larger than 128 bytes. Note also that the BDOS scratchpad area has been increased to 9 bytes and that there is no entry for DIRBUF.

Additionally, the DPH for CP/M 3 has been extended and is now known as the extended Disk Parameter Header or XDPH. For compatibility with CP/M 2.2, the BIOS still returns the address of the DPH when a drive is logged in and in fact returns the address of the XLT field of the DPH as with CP/M 2.2.

Before examining the XDPH fields in detail, a word or two is required about. the CP/M 3 Drive Table.

The drive table (@dtbl in the CP/M 3 manuals) is a 32 byte area of RAM that is comprised of 16 addresses. Each entry in the table points to the XDPH for its associated drive so that the first entry applies to drive A and the last entry applies to drive P. If no physical drive exists, the table entry is zero but there must be an entry of some sort for each of the 16 drives that may be supported. The BDOS can obtain the address of the drive table by calling BIOS function 22 (ie calling address WBOOT+3FH in the BIOS jump table) but for most purposes, the BIOS is the main user of the table.

Page 13 of 67