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.

The Resource Principle 32 THE RESOURCE PRINCIPLEIn this book you will find both specific and general information about the structure andbehavior of operating systems. We will start by presenting two very different‘‘definitions’’ of an operating system. These definitions will serve to introduce the majorconcepts that are elucidated in the rest of the book. Our first definition is called theResource Principle. The second is the Beautification Principle. We will also introducethe Level Principle, an important structuring concept for operating systems. Hereis the Resource Principle:Resource Principle<strong>An</strong> operating system is a set of algorithmsthat allocate resources to processes.A resource is a commodity necessary to get work done. The computer’s hardwareprovides a number of fundamental resources. Working programs need to reside somewherein main store (the computer’s memory), must execute instructions, and need someway to accept data and present results. These needs are related to the fundamentalresources of space, time, and transput (input/output). In addition to these fundamentalresources, the operating system introduces new resources. For example, files are able tostore data. Programs might be able to communicate with each other by means of portsthat connect them. Even higher-level resources can be built on top of these, such asmailboxes used to pass messages between users.The notion of a process is central to operating systems, but is notoriously hard todefine. To a first approximation, a process is the execution of a program. It is a fundamentalentity that requires resources in order to accomplish its task, which is to run theprogram to completion.One can picture processes as actors simultaneously performing one-actor plays in atheater; stage props are their resources. As actors need props, they request them from theproperty manager (the operating system resource allocator). The manager’s job is tosatisfy two conflicting goals on behalf of the actors:to let each actor have whatever props are neededto be fair in giving props to each actor.The manager also is responsible to the owners of the theater (that is, the owners of thecomputer), who have invested a considerable sum in its resources. This responsibilityalso has several goals:to make sure the props (resources) are used as much as possibleto finish as many plays (processes) as possible.

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

Saved successfully!

Ooh no, something went wrong!