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 Beautification Principle 13Beautification Principle<strong>An</strong> operating system is a set of algorithms that hide the details of the hardware and provide a more pleasant environment. Hiding the details of the hardware has two goals. Security. We have already seen that the operating system must secure itself andother processes against accidental or malicious interference. Certain instructionsof the machine, notably those that halt the machine and those that perform transput,must be removed from the reach of processes. Modern hardware provides severalprocessor states that restrict the use of instructions. For example, some architecturesprovide two states, called privileged state and non-privileged state.Processes run in non-privileged state. Instructions such as those that performtransput and those that change processor state cause traps when executed in nonprivilegedstate. These traps force the processor to jump to the operating systemand enter privileged state. The operating system runs in privileged state. Allinstructions have their standard meanings in this state. As we will see in Chapter3, the operating system can restrict access to main store so that processes may notaccess all of it. Abstraction. <strong>Operating</strong> systems, like other software components, constructhigher-level (virtual) resources out of lower-level (physical) ones. Details of thelower-level structures are hidden, and higher-level structures are introduced. Fromthe point of view of a process, the physical machine is enhanced by the operatingsystem into a virtual machine. Enhancement includes both simplicity (hidingdetails) and function (introducing new structures). Neither time (ability to execute)nor space (main store) appears to be shared with other processes. The virtualmachine is thus simpler than the physical machine. The process interface providesextra instructions that improve on the basic hardware instruction set, particularlywith respect to transput. The virtual machine is thus more functional than the physicalmachine.From the point of view of the user, the operating system provides services thatare not present in the underlying machine. These services include loading and runningprograms, providing for interaction between the user and the running programs,allowing several programs to run at the same time, maintaining accounts tocharge for services, storing data and programs, and participating in networks ofcomputers.<strong>An</strong> important example of the beautification role of the operating system is found intransput services. transput devices are extremely difficult to program efficiently andcorrectly. Most operating systems provide device drivers that perform transput operationson behalf of processes. These drivers also ensure that two processes do notaccidentally try to use the same device at once. The operations that are provided areoften at a much higher level than the device itself provides. For example, devicecompletioninterrupts might be hidden; the operating system might block processes thatperform transput until the transfer completes. Chapter 5 is devoted to a discussion of

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

Saved successfully!

Ooh no, something went wrong!