Preliminary

Handouts:

TA office hours.

Introduction

What Is an Operating System?

An operating system (OS) is a set of procedures that provides two basic functions:
1.
allocate resources to processes, and (resource manager)
2.
hide the details of the physical machine and provide a more pleasant virtual machine (abstract the resources of the physical machine).
We call these the resource and beautification principles respectively.

Resource is a commodity needed to get work done.

``New York Times Magazine definition''--Sunday, August 25, 1991 (Layman's defn)

An operating system is a program that might be likened to a computer's consciousness, turning a set of chips and circuit boards into a working brain, able to respond to instructions. Applications software is put in after the operating system to make the computer perform specific tasks, like processing words, constructing spreadsheets, or doing income taxes.

Actual Operating Systems

What are operating systems we know:

Layers of a System

Also look at picture from Tanenbaum's book.

        USER                 (Human)
         |
         |        <---- Interface (Program Interface)
         |
    APPLICATION              (Compiler, editor)
      PROGRAM
         |
         |        <---- Interface (System Calls)
         |
     OPERATING               (Serves process requests)
      SYSTEM
         |
         |        <---- Interface (Hardware/privileged instructions)
         |
      HARDWARE               (Disk, tape, memory, CPU)

Processes

Processes are hard to define precisely and exact definitions are usually operating system specific.

A program is a set of data and code that manipulates it.

A process is a program in execution. When a CPU executes a program, the operating system allocates space for data, space for a stack, and space for local variables. Processes need resources--CPU, disk, transput (input/output).

Resources

Operating System allocates and manages resources needed by processes.

What resources does the OS manage?

For example, if a printer is not managed then get garbled output.

Services Provided by an Operating System

What an Operating System is not?

The Design Process

It is a fundamental point that the two goals of an operating system are often contradictory. The operating system should

We'll study policies and mechanisms. Whenever possible, the operating system designer should build mechanism, rather than policy. Once a policy is placed in the implementation, it cannot easily be changed. Leaving policy in the hands of the user or system administrator provides the greatest flexibility. It is important to study both policy and mechanism, because there is a cost associated with carrying out specific policies.

The operating system designer wants to implement mechanism and allow policy to be flexible.

History

How did operating systems evolve?

(more details in Tanenbaum)

1.
Single program execution. (no Operating System) In early days, machines didn't have operating systems; programs took over the entire machine. Programs, written in assembly language (or worse), had to know such low-level details such as how to perform input/output. Punched on paper tape and then computer cards. However, early programs spent most of their time performing the input/output needed to read and print the job!

2.
Batch (Spooling). To make better use of resources, spooling systems were developed that copied jobs from card readers to tape, so that once the job could be run, the CPU could fetch it from tape rather than from the (relatively) slow card reader. Later spooled onto disk.

Interrupts. Introduced the notion of interrupts so devices could alert the CPU when they were finished. However, running just one job by itself was still inefficient.

3.
Multiprogramming. The next step in operating systems development, multiprogramming, gave the illusion of executing several programs simultaneously. Multiprogramming systems execute each job for several thousands of a second providing the appearance of running several jobs simultaneously. Thus, notion of a process. Still compute bound jobs could monopolize the CPU.

Time-slicing. In time-sharing systems, all processes are scheduled to run in round-robin fashion. One of the systems was MULTICS at M.I.T. Was a predecessor of the UNIX operating system done at Bell Labs. 1970ish.

4.
Personal Computers. MS-DOS did not allow multiprogramming. Windows NT and Windows 95 uses multiprogramming.

5.
*nix for the Masses. Linux, FreeBSD, ...

6.
Distributed and Network Operating Systems. Spans multiple machines. Distributed is transparent of machines, N.O.S. is not.

7.
Internet/Web. Operating system services are tightly intertwined with network. Integration of server applications, operating system and network is important.

Operating System Structure

What does the operating system look like? How is it organized?

A trend towards this latter type of organization. More amenable for moving towards a distributed system.

Build minimum mechanism into the kernel and leave policy decisions to the servers.

Issues of flexibility vs. performance. Windows NT uses partial microkernel approach.

Operating Systems for Study