CSC 325 Operating Systems with an Emphasis on UNIX

Chapter 1 Introduction


What is an Operating system?

Functionality of an Operating System

Operating system goals:

Computer System Components

  1. Hardware - provides basic computing resources (CPU, memory, I/O devices).
  2. Operating system - controls and coordinates the use of the hardware among the various application programs for the various users.
  3. Applications programs - define the ways in which the system resources are used to solve the computing problems of the users (compilers, database systems, video games, business pro grams).
  4. Users (people, machines, other computers).

  5. Graphic1

Operating System Functions

Major Issues in OS:

  1. structure - how is OS organized
  2. sharing - how are resources shared
  3. naming - how are resources named (by users/programs)
  4. protection - how is one user/program protected from another.
  5. security - how to restrict the flow of information.
  6. performance
  7. reliability and fault tolerance
  8. extensibility
  9. communication
  10. concurrency
  11. scale and growth
  12. accounting
  13. ....

What is this course about?

Several aspects of OS which will be covered again and again in this course:

  1. OS as illusionist: Hardware is kept transparent.
  2. OS as government: protect users from each other as well allocate resources fairly and efficiently.
  3. OS as a complex system: but made of simpler functional units.
  4. How OS design changes with technology!
  5. How the knowledge from other areas is integrated.


Early Systems (early 1950s) - First Generation.

Simple Batch Systems - Second Generation.

In the second generations of computers, the operating system was simple. Its major task was to transfer the control automatically from one job to the next. The operating system was always memory resident. To speed up processing, the operator grouped all the jobs with similar needs called a batch together and run them together. The control card told what the job was supposed to do, e.g. a PASCAL program or a Fortran program etc.

Main Disadvantages: There is no interaction with the user. Often CPU is idle.

Remember that at that time hardware was phenomenally expensive.

Problems:

  1. How does the monitor know about the nature of the job (e.g., Fortran versus Assembly) or which program to execute?
  2. How does the monitor distinguish
    a) job from job?
    b) data from program?

Solution: introduce control cards

Control Cards

  • Advantage of off-line operation - main computer not constrained by the speed of the card readers and line printers, but only by the speed of faster magnetic tape units.
  • No changes need to be made to the application programs to change from direct to off-line I/O operation.
  • Real gain - possibility of using multiple reader to-tape and tape-to-printer systems for one CPU.

Spooling - overlap the I/O of one job with the computation of another job.

Abstraction: Spooling overlaps I/O of one job with computation of another job, at the cost of some disk space and some tables that the operating system needs to manage.

Spooling and Buffering were a simple improvement: Read the cards before hand into a faster media such as disks/ or tapes, which are faster than the cards, ahead of time. Of course the operating system needs to manage, where the card data should go into the disks. The location of card images will be somehow maintained by the operating system. Instead of reading from the card reader, now the job reads it from the disk. Similarly, if a data has to be sent to the printer, it sends to a buffer onto the disk and from there it is printed. This is the notion of SPOOLING = Simultaneous Peripheral Operation Online. Remember that at that time hardware was phenomenally expensive.

Graphic3
(Simultaneous Peripheral Operation On Line).


Multiprogramming and Time Sharing- Third Generation

Multiprogramming

Since several jobs are often available on disk, the operating system must select which job to run, which eventually leads to job scheduling. The idea of multiprogramming is that several jobs are kept in main memory at the same time, and the CPU is shared between them. Each job is called a process. The main motivation for multiprogramming is to try to ensure that the CPU is always busy. A single job may not be able to be keep CPU busy due to slow I/O, so multiprogramming allows to keep the CPU more busy as follows:

There are several jobs in the job pool. Some are selected to be loaded in memory, since main memory is often much smaller than the job pool. A job is picked from memory, then the CPU executes it until it finishes or requests I/O. Since the CPU has to wait for the slow I/O, it loads another job and executes it and so on. The task of the operating system is to manage these jobs neatly. There are several issues to grapple with:

OS Features Needed for Multiprogramming

Time-Sharing Systems- Interactive Computing

In the previous approaches, the user is inactive during the whole execution cycle. But the user wants to have some control to see the intermediate results of execution, etc. Also, in the previous approaches, the program had to be debugged statically! In a time-sharing system or a multitasking system (TSS/MTS), Multiple jobs are executed by the CPU, but the switching is so frequent that the user may interact with the program while it is running (e.g. using the keyboard).

Personal-Computer Systems - Fourth Generation

A personal computer is a computer system designed to be used by a single user.

Parallel Systems - multiprocessor systems with more than one CPU in close communication.

Parallel systems have more than one processors in very close communication, sharing the bus, clock, and sometimes memory and peripheral devices. They are called tightly coupled.

Distributed Systems - distribute the computation among several physical processors.

A distributed system is a loosely coupled system in which each processor has its own local memory and do not share a clock.

Real-Time Systems

Real-Time operating systems are used where there are rigid time requirements, especially used in control devices.

History of UNIX Operation System: