29.12.2012 Views

The Programmer's Guide to TRSDOS Version 6 - Tim Mann's Home ...

The Programmer's Guide to TRSDOS Version 6 - Tim Mann's Home ...

The Programmer's Guide to TRSDOS Version 6 - Tim Mann's Home ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>The</strong> DCT contains the information relating <strong>to</strong> the granule size. In the case of floppies,<br />

granule sizes are standardized by the system according <strong>to</strong> the disk size and density.<br />

Chapter 5 contains more information on granule allocation sizes. Data on the number of<br />

sec<strong>to</strong>rs per track, number of heads, number of partitions, and maximum number of cylinders<br />

is also contained in the DCT for each drive. This data is an essential ingredient in the<br />

allocation and accessibility of file records and therefore must be accurately introduced.<br />

<strong>The</strong> table contains a maximum of eight DCT records - one record for each logical drive<br />

designated 0-7. Each DCT record is fielded as follows:<br />

4.2.1 DCT VECTOR - <br />

This three-byte field specifies whether the logical drive position is enabled or<br />

disabled. <strong>The</strong> system will not attempt <strong>to</strong> communicate with a logical drive number whose<br />

DCT position is considered disabled. If the position is enabled, then the field will also<br />

contain the address vec<strong>to</strong>r of the disk driver module that communicates with the<br />

controller interfacing the disk drive. <strong>The</strong> first byte of the DCT VECTOR would contain an<br />

X'C3' value if the drive position is enabled (an X'C3' represents an absolute jump [JP<br />

nnnn] instruction in Z-80 machine code). If the drive is disabled, this byte will be an<br />

X'C9' value (an X'C9' represents an absolute return [RET] from subroutine instruction in<br />

Z-80 machine code).<br />

<strong>The</strong> second and third bytes of the field will contain the vec<strong>to</strong>r transfer address of the<br />

disk driver module that communicates with the controller. <strong>The</strong> operating system typically<br />

places the disk drivers in the low memory driver region. A "s<strong>to</strong>ck" system has available<br />

in this region, memory sufficient <strong>to</strong> s<strong>to</strong>re additional drivers that are not supplied by<br />

the system. <strong>The</strong> DOS will dynamically use this low memory region based on requests <strong>to</strong><br />

invoke system drivers and filters (such as the COM/DVR or FORMS/FLT). A retrievable<br />

pointer <strong>to</strong> the first available memory address in this region can be used <strong>to</strong> locate the<br />

origin of a user-supplied driver or filter (if sufficient space is available). This will<br />

be discussed in a later section.<br />

4.2.2 DCT FLAG-1 - <br />

This field contains a series of sub-field parameters associated with the disk drive<br />

specifications. <strong>The</strong> field is encoded as follows:<br />

Bit 7 Set <strong>to</strong> 1 will indicate the disk device is "software" write protected. It is<br />

the responsibility of the disk driver <strong>to</strong> check this bit on any disk<br />

primitive that references a WRITE operation (i.e. write sec<strong>to</strong>r, write system<br />

sec<strong>to</strong>r, format track, or format device) and return a "Write protected disk"<br />

error code (error 15) if set.<br />

Bit 6 If set <strong>to</strong> a "1", it indicates that the floppy diskette currently being<br />

accessed is formatted in double density. If set <strong>to</strong> a "0" it indicates that<br />

the diskette is single density. <strong>The</strong> disk driver is responsible for<br />

maintaining this bit by recognizing the density of the disk it is accessing.<br />

<strong>The</strong> bit is used both by the driver in the drive selection process and by the<br />

system in informative messages by such things as DEVICE displays, DIRec<strong>to</strong>ry<br />

displays, and FREE displays. This bit is not referenced by the system if the<br />

DCT is associated with a hard drive (see bit 3 of this field).<br />

Bit 5 If this bit is set <strong>to</strong> a "1", the drive associated with the DCT position is<br />

an 8" drive. This bit will be a "0" if the drive associated with the DCT<br />

position is a 5-1/4" drive. This bit is initially set by whatever installs<br />

the disk driver (see the FLOPPY/DCT utility). In the installation of a hard<br />

disk driver, this bit should be set according <strong>to</strong> the size of the hard drive<br />

- 5" or 8". In the case of floppy drives, the system formatter will use this<br />

bit <strong>to</strong> adjust its formatting data <strong>to</strong> 5" or 8". It is also used <strong>to</strong> adjust<br />

informative messages as mentioned under bit-6.<br />

4-4

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!