Computer Algorithms  «Prev  Next»
Lesson 4 The role of the operating system
Objective Describe the role of an operating system.

Role of the Operating System

The operating system is a special program that is always running on your computer. It provides other programs with a common interface to the resources of the computer and is responsible for tasks such as getting input from the mouse, sending output to the printer, and managing the files and directories of the file system. The operating system is essentially the air traffic controller of your computer. Just as the air traffic controller is responsible for when planes take off and land and what runways they use, the operating system is responsible for running other programs and making the computer's resources available to them. As a simple example, let's assume you are currently running several programs on your computer: a word processing program, a spreadsheet program, and a Web browser. When you enter text at the keyboard, how do you know which program receives the text? The operating system keeps track of which program currently has keyboard focus . If you are using an operating system such as Windows or MacOS, you are presented with a graphical user interface (GUI) in which each program is displayed in a window. The window that is highlighted indicates which program will receive the text. You are now familiar with what a computer program is and what it does. You can also describe the major components of a computer and explain the role of an operating system. In the next lesson you will learn how all these things work together when you run a program.

Adds new instructions for the Programmer

An operating system is a program that, from the programmer’s point of view, adds a variety of new instructions and features, above and beyond what the ISA level provides. Normally, the operating system is implemented largely in software, but there is no theoretical reason why it could not be put into hardware, just as microprograms normally are (when they are present). For short, we will call the level that it implements the OSM (Operating System Machine) level. It is shown in Fig. 4-2. Although the OSM level and the ISA level are both abstract (in the sense that they are not the true hardware level), there is an important difference between them. The OSM-level instruction set is the complete set of instructions available to application programmers. It contains nearly all of the ISA level instructions, as well as the set of new instructions that the operating system adds. These new instructions are called system calls. A system call invokes a predefined operating system service, effectively, one of its instructions. A typical system call is reading some data from a file. We will typeset system calls in lowercase Helvetica. The OSM level is always interpreted. When a user program executes an OSM instruction, such as reading some data from a file, the operating system carries out this instruction step by step, just as a microprogram would carry out an ADD
Figure 2-4: Positioning of the operating system machine level.

instruction step by step. However, when a program executes an ISA-level instruction, it is carried out directly by the underlying microarchitecture level, without any assistance from the operating system. We will focus on three topics of importance.
  1. The first is virtual memory[1], a technique provided by many modern operating systems to make the machine appear to have more memory than it in reality has.
  2. The second is file I/O, a higher-level concept than the I/O instructions.
  3. The third topic is parallel processing, how multiple processes can execute, communicate, and synchronize.

The concept of a process is an important one, and we will describe it in detail later in this chapter. For the time being, a process can be thought of as a running program together with all its state information (memory, registers, program counter, I/O status, and so on). After discussing these principles in general, we will show how they apply to the operating systems of two of our example machines, the Core i7 (running Windows 7) and the OMAP4430 ARM CPU (running Linux). Since the ATmega168 microcontroller is normally used for embedded systems, it does not have an operating system.

Role of the Operating System

An operating system organizes the interaction between the user and the computer, starts application programs, and manages disk storage and other resources. Instead, IBM offered customers the option of three separate operating systems. Most customers could not care less about the operating system. They chose the system that was able to launch most of the few applications that existed at the time. It happened to be DOS (Disk Operating System) by Microsoft. Microsoft cheerfully licensed the same operating system to other hardware vendors and encouraged software companies to write DOS applications. A huge number of useful application programs for PC-compatible machines was the result. PC applications were certainly useful, but they were not easy to learn. Every vendor developed a different user interface: the collection of keystrokes, menu options, and settings that a user needed to master to use a software package effectively. Data exchange between applications was difficult, because each program used a different data format. The Apple Macintosh changed all that in 1984. The designers of the Macintosh had the vision to supply an intuitive user interface with the computer and to force software developers to adhere to it. It took Microsoft and PC-compatible manufacturers years to catch up. At the time of this writing, most personal computers are used for accessing information from online sources, word processing, and home finance. Some analysts predict that the personal computer will merge with the television set and cable network into an entertainment and information appliance.
[1]Virtual memory: Virtual memory is a memory management technique that provides an illusion of a larger physical memory than is actually available. This is done by temporarily transferring data from random access memory (RAM) to disk storage, which is much slower than RAM but also much cheaper and larger.