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.

NAME START END DESCRIPTION<br />

LOWCORE X’0000 @$SYS RST vec<strong>to</strong>rs, NMI vec<strong>to</strong>r, System flags, Date, <strong>Tim</strong>e,<br />

System FCB, DEBUG register save area, JCL FCB,<br />

Command FCB, SVC Table, DCB Table, System stack,<br />

Miscellaneous data, Command input buffer, Drive<br />

Control Table, Device I/O handler, Clock task, Memory<br />

management routines.<br />

IOR @SYS X’12FF Keyboard, Video, Printer, and Disk drivers.<br />

SYSRES X’1300 X’1DFF File access routines, SVC processor, System overlay<br />

handler, System program loader, Interrupt Task<br />

Schedular, System buffer.<br />

SOR X’1E00 X’23FF Execution region for system overlays 2-5, 9-13,<br />

overlay disk file buffer.<br />

LOR X’2400 X’25FF Execution region for system library comands contained<br />

in libraries A, B, & C.<br />

UPR X’3000 (HIGH$) Execution region for user transient programs (note:<br />

programs not accessing the system libraries can start<br />

at X'2600'.)<br />

HIMEM (HIGH$)+1 X’FFFF Region for relocation of extended system and user<br />

static modules.<br />

Table 2-1 System Map<br />

<strong>The</strong> task scheduler is also used by the despooling function of the printer spooler. <strong>The</strong><br />

DOS spooler implements a combination of memory and disk buffers <strong>to</strong> temporarily hold the<br />

printer output. This output is despooled <strong>to</strong> the printer under the control of the task<br />

scheduler. <strong>The</strong> function, being transparent <strong>to</strong> the user, can continue the despooling even<br />

after the application generating the output is finished and another started. When the<br />

system contains 128K (or more) of RAM, the extra RAM can be set aside for the spooler's<br />

memory buffer.<br />

<strong>The</strong> primary function of any operating system is <strong>to</strong> provide the user with a facility for<br />

managing and accessing files s<strong>to</strong>red on disk s<strong>to</strong>rage devices. Since the user must not be<br />

burdened with the physical details of the s<strong>to</strong>rage devices themselves, it is the operating<br />

system's responsibility <strong>to</strong> translate all file record access requests in<strong>to</strong> specific drive,<br />

track, sec<strong>to</strong>r, and head parameters that pinpoint the s<strong>to</strong>rage location of each record. <strong>The</strong><br />

DOS supports a wide range of disk s<strong>to</strong>rage capacities. Let's take a brief look at how a<br />

disk drive is organized.<br />

Each track is formatted in<strong>to</strong> a specific quantity of 256-byte sec<strong>to</strong>rs with a maximum<br />

capacity of 32 sec<strong>to</strong>rs per track. Sec<strong>to</strong>rs are grouped in<strong>to</strong> blocks called "granules" which<br />

vary in size according <strong>to</strong> <strong>to</strong>tal track capacity. Whenever additional disk space is needed<br />

for a file, an additional granule is allocated. <strong>The</strong> granule thus becomes the minimum size<br />

s<strong>to</strong>rage unit. Where multiple headed drives are in use, the track numbers on a surface are<br />

duplicated on each surface with all similarly numbered tracks constituting a cylinder.<br />

Cylinder capacities also have an upper limit of 256 sec<strong>to</strong>rs per cylinder or eight<br />

granules per cylinder while the system supports a maximum of eight heads per drive.<br />

In order <strong>to</strong> evenly use the entire surface of a drive, files are uniformly distributed<br />

across each surface [note: LSI unfortunately has changed <strong>to</strong> a fixed allocation scheme<br />

effective with release 6.1]. That means the head has a tendency <strong>to</strong> be randomly located<br />

whenever a direc<strong>to</strong>ry access is needed. Because of this, each disk drive's direc<strong>to</strong>ry is<br />

placed on the cylinder closest <strong>to</strong> its midpoint which provides a tendency <strong>to</strong> minimize the<br />

average seek time for direc<strong>to</strong>ry accesses. <strong>The</strong> direc<strong>to</strong>ry, of course, contains information<br />

on each file s<strong>to</strong>red on the drive as well as additional tables and codes pertinent <strong>to</strong> the<br />

drive.<br />

<strong>The</strong> first sec<strong>to</strong>r of the direc<strong>to</strong>ry contains a granule allocation table (GAT). <strong>The</strong> GAT is<br />

bit mapped <strong>to</strong> each granule of space on the drive. Other fields in the GAT contain the<br />

2-4

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

Saved successfully!

Ooh no, something went wrong!