You are on page 1of 37

Chapter 2

Operating System Overview

based on:

William Stallings
Operating Systems—Internals and Design Principles, 6th ed.
Pearson Education International
Chapter Table of Contents
Informatik ∙ CAU Kiel

1. Evolution of Operating Systems

2. Major achievements in OS design

3. Towards modern Operating Systems

2
Evolution of Operating Systems
Informatik ∙ CAU Kiel

• OS Generations
– Generation 1 (1945 – 55)
Vacuum tubes, plugboards, and serial processing
– Generation 2 (1955 – 65)
Transistors and batch systems
– Generation 3 (1965 – 80)
ICs and multiprogramming
– Generation 4 (1980 – present)
Personal computers and interactivity
– Generation 5 (present – ?)
self-organizing systems?

3
Evolution of Operating Systems
Informatik ∙ CAU Kiel

• Serial processing
– No operating system: direct interaction
programmer—computer hardware
– Machine operation controlled from a console
with display lights and toggle switches
– Typical input device: card reader;
typical output device: printer
– No scheduling, programmers had to sign up for "computer time"
– "Job" included loading the compiler and the source program,
saving compiled program, linking and loading the compiled program,
program execution

4
Evolution of Operating Systems
Informatik ∙ CAU Kiel

• Operation of an early batch system:


1. Programmer brings cards to 1401.
2. 1401 reads batch
of jobs onto tape.

5
Evolution of Operating Systems
Informatik ∙ CAU Kiel

• Operation of an early batch system:


3. Operator carries input tape to 7094.
4. 7094 does computing.

6
Evolution of Operating Systems
Informatik ∙ CAU Kiel

• Operation of an early batch system:


5. Operator carries output tape to 1401.
6. 1401 prints output.

7
Evolution of Operating Systems
Informatik ∙ CAU Kiel

• Simple batch system


– Monitor
o Software that controls the sequence of events
o Batch jobs together
o Application program returns control to monitor when finished
– Job Control Language (JCL)
o Special type of programming language
o Provides instruction to the monitor:
What compiler to use, what data to use

8
Evolution of Operating Systems
Informatik ∙ CAU Kiel

• Simple batch system


(Interrupt handling)
– Monitor features
Device drivers
o resident in main memory Monitor
Job sequencing
o protection: if user program
crosses boundary, Boundary JCL interpreter
abort job
o timer to prevent a job to
monopolize the system User
program
o privileged instructions, for e.g. area
I/O, available in "kernel mode"
only

9
Evolution of Operating Systems
Informatik ∙ CAU Kiel

• Simple batch system


– Pile of punchcards
for typical FMS job
(Fortran Monitor
System)

JCL instructions

10
Evolution of Operating Systems
Informatik ∙ CAU Kiel

• Problem with simple batch systems:


– Only one job at a time is active in system
→ low CPU utilization, as CPU is idle during I/O operations
– example:
read one record from file 15 ms
execute 100 instructions 1 ms
write one record to file 15 ms
total 31 ms

CPU utilization = 1/31 = 3.2%

11
Evolution of Operating Systems
Informatik ∙ CAU Kiel

• Multiprogramming
– Put more jobs into memory!

12
Evolution of Operating Systems
Informatik ∙ CAU Kiel

• Uniprogramming

Processor must wait for I/O instruction to complete before preceding

• Multiprogramming with two programs

When one job needs to wait for I/O, the processor can switch to the other job
13
Evolution of Operating Systems
Informatik ∙ CAU Kiel

• Multiprogramming with three programs

− Price for task switching should be less than gain in system utilization!

14
Evolution of Operating Systems
Informatik ∙ CAU Kiel

• Multiprogramming example

Job 1 Job 2 Job 3


Type of job heavy compute heavy I/O heavy I/O
Duration 5 min 15 min 10 min
Memory required 50 Mbyte 100 Mbyte 75 Mbyte
Need disk? No No Yes
Need terminal? No Yes No
Need printer? No No Yes

15
Evolution of Operating Systems
Informatik ∙ CAU Kiel

• Utilization graphs for example

16
Evolution of Operating Systems
Informatik ∙ CAU Kiel

• Effects of multiprogramming for example

Uniprogramming Multiprogramming
Processor use 20 % 40 %
Memory use 33 % 67 %
Disk use 33 % 67 %
Printer use 33 % 67 %
Elapsed time 30 min 15 min
Throughput 6 jobs/hr 12 jobs/hr
Mean response time 18 min 10 min

17
Evolution of Operating Systems
Informatik ∙ CAU Kiel

• Time Sharing Systems


– Using multiprogramming to handle multiple interactive jobs
– Processor’s time is shared among multiple users
– Multiple users simultaneously access the system through terminals
– Goals compared:
Batch Multiprogr. Time Sharing
Principal objective Maximize Minimize
processor usage response time
Source of directives JCL commands Commands entered
to OS provided with job at the terminal

18
Evolution of Operating Systems
Informatik ∙ CAU Kiel

• Time Sharing Systems


– One of the first time-sharing OS:
Compatible Time-Sharing System (CTSS),
developed at the
Massachusetts Institute of Technology (MIT)
– CTTS developed for IBM 709, later IBM 7094
o 32 k words à 36 bits, 5 k words for CTTS
o timer interrupt period: 200 ms
→ return control from user program to CTSS
o focus on minimizing transfers to/from disk

19
Evolution of Operating Systems
Informatik ∙ CAU Kiel

• Sample CTSS run

20
Major Achievements
Informatik ∙ CAU Kiel

• Processes

• Memory management

• Information protection and security

• Scheduling and resource management

• System structure

21
Major Achievements
Informatik ∙ CAU Kiel

• What is a process?
Different definitions are given, among them:
– A program in execution
– An instance of a program running on a computer
– The entity that can be assigned to and executed on a processor
– A unit of activity characterized by
o A single sequential thread of execution
o A current state
o An associated set of system resources

22
Major Achievements
Informatik ∙ CAU Kiel

• A process consists of three components


– An executable program
– Associated data needed by the program
– Execution context of the program
o All information the operating system needs
to manage the process

23
Major Achievements
Informatik ∙ CAU Kiel

• A typical memory layout for management


of several processes

24
Major Achievements
Informatik ∙ CAU Kiel

• Memory Management
– Process isolation
– Automatic allocation and management
– Support of modular programming
– Protection and access control

25
Major Achievement
Informatik ∙ CAU Kiel

• Memory Management:
Paging and Virtual Memory
– Partition memory into small equal fixed-size chunks
called frames
– Divide each process into chunks of the same size
called pages
– Each page may be located in any frame anywhere in main memory

26
Major Achievements
Informatik ∙ CAU Kiel

• Memory Management: Paging

27
Major Achievements
Informatik ∙ CAU Kiel

• Common goals for information protection and security


– Availability
o Concerned with protecting the system against interruption
– Confidentiality
o Assuring that users cannot read data for which access is
unauthorized
– Data integrity
o Protection of data from unauthorized modification
– Authenticity
o Concerned with the proper verification of the identity of users
and originators of messages, files etc.
28
Major Achievements
Informatik ∙ CAU Kiel

• Scheduling and Resource Management


– Fairness
o Give equal and fair access to resources
– Differential responsiveness
o Discriminate among different classes of jobs
– Efficiency
o Maximize throughput, minimize response time, and
accommodate as many uses as possible

29
Major Achievements
Informatik ∙ CAU Kiel

• System Structure
– View the system as a series of layers
– Each layer performs a related subset of functions
– Each layer relies on the next lower layer to perform
more primitive functions
– This decomposes a problem into a number of
more manageable subproblems

30
Major Achievements
Informatik ∙ CAU Kiel

Layers Name Objects Sample operations


13 Shell User programming env. Shell statements
12 User processes User processes Quit, kill, suspend, resume
11 Directories Directories Create, destroy, attach, detach, list
10 Devices External dev.: printers, … Open, close, read, write
9 File system Files Create, destroy, open, read, write
8 Communications Pipes Create, destroy, open, read, write
7 Virtual memory Segments, pages Read, write, fetch
6 Local sec. storage Blocks of data, channels Read, write, allocate, free
5 Primitive processes Prim. proc., semaphores Suspend, resume, wait, signal
4 Interrupts Interrupt handlers Invoke, (un)mask, retry
3 Procedures Proc., call stack, display Mark stack, call, return
2 Instruction set Microprogramm interpr. Load, store, add, subtract, branch
1 Hardware Registers, gates, buses 31
Clear, transfer, activate, complement
Towards Modern Operating Systems
Informatik ∙ CAU Kiel

• Microkernel architecture
– Assigns only a few essential functions to the kernel
o Management of address spaces
o Interprocess communication (IPC)
o Basic scheduling

32
Towards Modern Operating Systems
Informatik ∙ CAU Kiel

• Multithreading
– Process is divided into threads that can run concurrently
o Thread
– Dispatchable unit of work
– Executes sequentially and is interruptable
o Process is a collection of one or more threads

33
Towards Modern Operating Systems
Informatik ∙ CAU Kiel

• Symmetric multiprocessing (SMP)


– There are multiple processors
– These processors share same main memory and I/O facilities
– All processors can perform the same functions

34
Towards Modern Operating Systems
Informatik ∙ CAU Kiel

• Multiprogramming and Multiprocessing


blocked running
time

P1
P2
P3
Multiprogramming, one processor: interleaving

P1
P2
P3
Multiprocessing, two processors: interleaving and overlapping

35
Towards Modern Operating Systems
Informatik ∙ CAU Kiel

• Distributed operating systems


– Provides the illusion of a single main memory space and single
secondary memory space

• Object-oriented design
– Used for adding modular extensions to a small kernel
– Enables programmers to customize an operating system without
disrupting system integrity

36
Feedback for this Chapter
Informatik ∙ CAU Kiel

• Well understood –
easy material

• Mostly understood –
material is ok

• Hardly understood –
difficult material

37