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.

exceeds this capacity, then it must be divided in<strong>to</strong> more than one drive in order <strong>to</strong><br />

address its <strong>to</strong>tal capacity.<br />

<strong>The</strong> DOS also limits the number of files per logical drive <strong>to</strong> 256 (of which two are taken<br />

up by the BOOT/SYS and DIR/SYS files). Although data base applications may find the most<br />

practical arrangement is a single volume, the typical use of even a 5 megabyte drive will<br />

find the file slots filled before all of the space is allocated - thus space is wasted<br />

[It is possible and highly practical for the hard disk integra<strong>to</strong>r <strong>to</strong> consider combining<br />

individual static files in<strong>to</strong> members of a partitioned data set <strong>to</strong> free up multiple file<br />

slots. PRO-PaDS is a utility program capable of creating and maintaining such files].<br />

<strong>The</strong>refore, even with the smaller 5 megabyte drive, there exists a rationale for<br />

partitioning.<br />

Once the decision is made <strong>to</strong> divide a drive, the question arises as <strong>to</strong> how <strong>to</strong> go about<br />

such a division. <strong>The</strong>re are three methods of partitioning. One is <strong>to</strong> divide the drive by<br />

cylinder. For example, Take a 306 cylinder, four head, 10 megabyte drive. This can be<br />

divided in<strong>to</strong> two drives with the first logical drive using cylinders 0-152 while the<br />

second uses cylinders 153-306. <strong>The</strong> DOS actually uses logical cylinder numbers 0-152 for<br />

both partitions and the hard disk driver must recognize that it needs <strong>to</strong> translate the 0-<br />

152 for the second partition in<strong>to</strong> the range 153-306. Obviously, one can divide up the<br />

drive in<strong>to</strong> partitions smaller than 5 megabytes. A second method is <strong>to</strong> divide the drive so<br />

that all of the cylinders are included in a single logical volume, but volumes use<br />

different heads. Thus, the previously mentioned drive could be divided in<strong>to</strong> two, three,<br />

or four logical drives. A third method would be <strong>to</strong> translate the drive's physical<br />

parameters in<strong>to</strong> quantities acceptable <strong>to</strong> the system while staying within the maximum<br />

number of 256 sec<strong>to</strong>rs per logical cylinder.<br />

<strong>The</strong>re are advantages and disadvantages <strong>to</strong> each method. First, our discussion of floppy<br />

configurations pointed out a use for addressing as much capacity in a single cylinder<br />

prior <strong>to</strong> having <strong>to</strong> step the drive. This means that we would lean <strong>to</strong>wards divisions by<br />

cylinder. However, if we are alternately selecting different partitions, the drive must<br />

be stepped a great distance <strong>to</strong> get <strong>to</strong> each partition. Another problem is that a head<br />

crash would essentially wipe out all drives since a single head is used on all<br />

partitions. Of course, if the drive physically has more than 406 cylinders, it must be<br />

partitioned by cylinders (or translation) <strong>to</strong> address the higher cylinders.<br />

Partitioning by head provides less sec<strong>to</strong>rs per physical cylinder; however, since hard<br />

drives <strong>to</strong>day usually use very fast buffered seek, the stepping time <strong>to</strong> advance a track is<br />

minimal. A head crash will also only wipe out a single logical drive.<br />

Translation methods can be useful with drives whose parameters do not lend themselves <strong>to</strong><br />

the DOS limits (a 39 sec<strong>to</strong>r per track drive, for instance). A drawback <strong>to</strong> translation<br />

methods is the difficulty in keeping logical cylinders referencing a physical cylinder.<br />

<strong>The</strong> important point in any method, is that the driver must be written <strong>to</strong> do the<br />

conversions as the operating system's reference is <strong>to</strong> logical cylinder and sec<strong>to</strong>r within<br />

that cylinder when it issues an I/O request. <strong>The</strong> driver may make use of the CURCYL byte<br />

and FLAG-2, bits 3-0 for s<strong>to</strong>rage of partition specific data. <strong>The</strong> driver can also<br />

establish its own table when these DCT fields do not provide sufficient space <strong>to</strong> s<strong>to</strong>re<br />

the quantities needed by the driver.<br />

Let's take a look at a few examples. <strong>The</strong> number of file slots identified assumes that all<br />

logical drives are considered <strong>to</strong> be data drives. Subtract 14 from the number for each<br />

SYSTEM drive. In the first, case we will use an ST-506 type drive which has four heads<br />

and 153 cylinders. This will be the division of a 5 megabyte drive partitioned by head.<br />

Figure 4-8 illustrates the DCT parameters <strong>to</strong> divide the drive in<strong>to</strong> two logical drives of<br />

2.5 megabytes each. Notice that we are using 8-sec<strong>to</strong>r granules (2K). Since we can have at<br />

4-14

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

Saved successfully!

Ooh no, something went wrong!