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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

5.4 THE DIRECTORY RECORD STRUCTURE<br />

<strong>The</strong> disk direc<strong>to</strong>ry contains the information sufficient <strong>to</strong> access all files on the disk.<br />

We have already shown that disk space allocation is defined in the Granule Allocation<br />

Table. We have also revealed in the previous section how the operating system uses file<br />

hash codes s<strong>to</strong>red in the Hash Index Table <strong>to</strong> locate the Direc<strong>to</strong>ry Entry Code for each<br />

file. Each DEC refers <strong>to</strong> a specific direc<strong>to</strong>ry entry record. A direc<strong>to</strong>ry record is 32bytes<br />

in length. Thus, each direc<strong>to</strong>ry entry sec<strong>to</strong>r contains eight direc<strong>to</strong>ry entry<br />

records.<br />

<strong>The</strong> HIT was shown <strong>to</strong> contain a maximum of 256 Direc<strong>to</strong>ry Entry Codes. Since there are<br />

eight entries per sec<strong>to</strong>r, the maximum number of direc<strong>to</strong>ry entry sec<strong>to</strong>rs is 32 (256<br />

divided by 8). If we add one sec<strong>to</strong>r for the GAT and one for the HIT, we discover that the<br />

maximum length of the entire direc<strong>to</strong>ry can be 34 sec<strong>to</strong>rs. <strong>The</strong> direc<strong>to</strong>ry must be contained<br />

completely on a single cylinder. <strong>The</strong>refore, the exact length of the direc<strong>to</strong>ry and hence<br />

the number of direc<strong>to</strong>ry entries is highly dependent on the size of a cylinder. For<br />

example, an 18-sec<strong>to</strong>r per cylinder formatted disk will have 16 direc<strong>to</strong>ry entries and<br />

hence 16 times 8 or 128 direc<strong>to</strong>ry entries. Consult the section on the HIT for the formula<br />

calculating the number of direc<strong>to</strong>ry sec<strong>to</strong>rs.<br />

=====================================================================<br />

| |<br />

| SECTORS PER DIRECTORY FILES AVAILABLE PER DIRECTORY |<br />

| CYLINDER RECORDS TOTAL SYSTEM DISK DATA DISK |<br />

| ----------- ---------- ------- --------- ---------- |<br />

| 5" SDEN-1 10 8 64 48 62 |<br />

| 5" SDEN-2 20 18 144 128 142 |<br />

| 5" DDEN-1 18 16 128 112 126 |<br />

| 5" DDEN-2 36 32 256 240 254 |<br />

| 8" SDEN-1 16 14 112 96 110 |<br />

| 8" SDEN-2 32 30 240 224 238 |<br />

| 8" DDEN-1 30 28 224 208 222 |<br />

| 8" DDEN-2 60 32 256 240 254 |<br />

| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |<br />

| 5" HARD- 128 32 256 240 254 |<br />

| |<br />

| 5" HARD- 64*2 32*2=64 256*2=512 240*1+ 254*2=508 |<br />

| 254*1=494 |<br />

| 5" HARD- 32*4 30*4=120 240*4=960 224*1+ 238*4=952 |<br />

| 238*3=938 |<br />

| |<br />

| Note: Hard drive values show <strong>to</strong>tal entries for all partitions. |<br />

| "" denotes the number of logical drives. |<br />

=====================================================================<br />

Figure 5-7: Direc<strong>to</strong>ry entries for various media<br />

<strong>The</strong> first two direc<strong>to</strong>ry entries of the first eight direc<strong>to</strong>ry entry sec<strong>to</strong>rs are reserved<br />

for system overlays on a SYSTEM disk. A DATA disk reserves only the first direc<strong>to</strong>ry entry<br />

of the first two direc<strong>to</strong>ry entry sec<strong>to</strong>rs. <strong>The</strong> <strong>to</strong>tal capacity of files is equal <strong>to</strong> the<br />

number of direc<strong>to</strong>ry sec<strong>to</strong>rs times eight (since 256/32 = 8). <strong>The</strong> quantity available for<br />

use will always be reduced by 16 on a SYSTEM disk or by two on a DATA disk <strong>to</strong> account for<br />

those entries reserved for the operating system. Figure 5-7 shows the record capacity<br />

(file capacity) of each floppy format type. <strong>The</strong> dash suffix on the density indica<strong>to</strong>r<br />

represents the number of sides formatted. <strong>The</strong> figure also lists representative values for<br />

5 megabyte winchester drives (typical ST-506 compatible: 4 heads, 32 sec<strong>to</strong>rs per track,<br />

153 tracks per head).<br />

5-9

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

Saved successfully!

Ooh no, something went wrong!