Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Unit_3.doc
Скачиваний:
4
Добавлен:
25.02.2016
Размер:
163.33 Кб
Скачать

Unit 3. Operating System Software

An operating system performs a vital role in enabling users to interact with a computer system. In this unit, we will learn about the specific responsibilities of an operating system, such as device management, memory management, resource sharing, and process control. After learning about the operating system, you will understand some of the problems that can cause your computer to perform less than optimally and some of the solutions that can resolve those problems. You will also learn how to customize your computing environment to your personal taste.

3.1 Structure

Just as we previously discussed with respect to hardware, a computer system's software has its own structure. The operating system is not a single entity but is composed of multiple layers, each with its own area of responsibility. The operating system's layers and the applications the user runs are considered unique "tasks" or "processes," competing for access to the CPU and other hardware resources. The management of this competition through the proper scheduling of processes is a major responsibility of an operating system and can have a significant impact on system performance.

3.1.1 Layers of Software

  • Layers and Process Management

  • Encapsulation and Abstraction

  • Layers of Software

Layers and Process Management

Software systems are composed of multiple layers, but the same can be said of many other features of everyday culture. In U.S. culture, to take just one example, when you sign a credit card slip to pay for dinner at a restaurant, as far as the credit card company is concerned, it is just "a meal." No more detail is required. But, the meal was actually composed of several courses. That is a layer of detail the waiter needs to keep track of in order to know what dishes to bring, and in what order. Let us say the first course was salad. The details of salad preparation were handled by another layer, the kitchen, where a chef tossed together lettuce, tomatoes, and some croutons—which came out of a box, at least as far as the chef was concerned. 1

But, where do croutons actually come from? They were bought from a bakery, which made them from flour, yeast, and seasoning. The flour came from a flourmill, which purchased wheat and ground it up. The wheat came from a farmer who planted seeds and eventually harvested the mature wheat plants. When you pay for your dinner, you are paying (indirectly) about one thousandth of a cent (assuming you are paying in U.S. currency) to that farmer for the wheat in your croutons. And, you are paying several thousand other people who contributed to your meal in various ways. Fortunately, you do not have to pay all those people directly! You make one payment for "a meal," and the details are sorted out in the layers below.

By organizing the production process into layers that are relatively independent, the entire system can be kept manageable, and great efficiencies can be achieved. In computer science, the principles underlying these benefits are called encapsulation and abstraction.

Encapsulation and Abstraction

Encapsulationmeans that each layer needs only a limited amount of knowledge to do its job, and none of the other layers has access to that information. The farmer does not know what the wheat will be used for. The bakery does not know how the wheat was harvested. And, you do not even need to know that croutons contain wheat! In the software world, encapsulation means that your word processing program does not need to know how to control disk drives in order to be able to open and save files; there are layers of software below it that handle those details.

However, if a layer were fully encapsulated it would be unable to communicate with the layers above and below. In order for there to be some exchange of information, but not too much, the designer of a layer specifies an abstraction that the layer promises to support. The bakery supports an abstraction called a "crouton order," whereby a customer can submit an order for X pounds of croutons and the bakery will respond by producing the croutons and delivering them. Inside the bakery, all sorts of things are going on that the customer does not see. For example, the bakery may have a big oven and a little oven, and the manager must decide which one to use to fill each order. Sometimes it might make sense to bake two small batches of croutons instead of one big batch. Sometimes one or the other oven is down for maintenance. These details are hidden from the customer; in computer science terminology we say the information is encapsulated. Furthermore, even if a customer somehow knew that there were two ovens, they could not specify which oven they wanted to be used to produce their order, because there is no place on the order form to indicate that. In computer science terms, we say that the crouton ordering abstraction does not support oven choice.

The existence of well-defined abstractions at each layer means that one implementation can be replaced by another with no effect on the layers above and below. Lots of bakeries sell croutons. If they all accept the same order form, it is possible to switch suppliers at will. On your computer, it is possible to have multiple implementations of a software component and switch from one to another. For example, your Web browser calls on a helper program when it needs to play a sound file or video clip. There are several programs that can perform this function. All you have to do is tell your browser which player to use. This isolation of functionality means that if a new, improved player becomes available, you can switch to that one; you do not have to get a completely new browser.

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]