13.07.2015 Views

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

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.

236 The User Interface Chapter 7instead. In a batch mode, each command assumes that all the earlier ones were executedcorrectly; error contingencies must be explicitly expected and dealt with as part of thecommands themselves.Since there is such a similarity between the requirements of batch and interactiveuse, a number of interactive command interpreters have been developed by modifyingearlier batch command interpreters. A tendency in the other direction has also occurred:Interactive command interpreters often have a batch component, which allows users tosubmit work now that is to be executed later or allows a number of related commands tobe packaged together to be interpreted as one larger command. We will describe thesecommand scripts later.1.1 Invoking programs and establishing environmentsThe easiest way to specify a program is to name the file that contains its load image.Since it may be awkward to state the full file name, conventions may be used to makestandard programs easier to invoke. For example, one or more default directories may beestablished for commonly used programs. The local name of a file in these directoriessuffices to invoke it. If more than one default directory exists, they are searched in someorder. For example, each user may have a personal program directory. That one mightbe searched before the directory that includes optional utilities, which may in turn besearched before the directory containing software built by the local community. If aname is found in one of these directories, but for some reason the program cannot be run(the user does not have the necessary access rights, for example), either the next directorycould be searched or the request could fail.The environment can be established in a global or a local fashion. A globalenvironment setting persists until it is changed; a local setting applies only to a singleprocess. As an example of a global setting, we might establish that whenever a programopens a file input, the actual file should be firstrun.data. We may have severalprocesses that are all to use the same data, so setting this global association allows eachof these programs to run in the desired environment. <strong>An</strong>other global environment settingmight dictate that all files created by processes are to have an initial disk allocation ofthree tracks, with an additional extent of one track whenever the allocation overflows.As another example, we may wish to limit all processes to use less than 15 seconds.Global environment settings are typically made through commands that have adeclarative character. A reasonable syntax would start each with the keyword set.The examples shown above might have this sort of appearance:set association input firstrun.dataset disk allocation 3 1 { three tracks for initial extent, 1 for others }set cpulimit 15Associated with each set command might be a show command that asks the commandinterpreter to display the current setting of the environment.If the command interpreter is a utility process, it might translate these declarationsinto service calls that modify the information in its context block. When it then asks thekernel to start a process, the new process might inherit these settings. Alternatively, thecommand interpreter might store global environment information in its own tables.

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

Saved successfully!

Ooh no, something went wrong!