Title: Why do we need an operating system
1 Introduction
- Why do we need an operating system ?
- Basis for all software
- Simplifies access (for user processes) to
- Memory
- Permanent Data
- i/o extended machine
- Security and Protection
- of executing user programs
- of resources (devices)
2What is an Operating System
- A program that acts as an intermediary between a
user of a computer and the computer hardware. - Operating system goals
- Execute user programs and make solving user
problems easier. - Make the computer system convenient to use.
- Use the computer hardware in an efficient manner.
3Operating System Definitions
- Resource allocator manages and allocates
resources. - Control program controls the execution of user
programs and operations of I/O devices . - Kernel the one program running at all times
(all else being application programs).
4What is an Operating System
- It is an extended machine
- Hides the messy details which must be performed
- Presents user with a virtual machine, easier to
use - It is a resource manager
- Each program gets time with the resource
- Each program gets space on the resource
5Layered Hardware-Software Machine Model
6Operating Systems - Extended Machines
- Problems
- Bare machine has a complex structure
- Processors
- Many Devices
- Primitive Instruction Set
- Different for Different Machines
- Solutions provided by the OS
- Simple, easier to use interface
(machine-independent) - Hiding of unnecessary details
7Operating Systems as Resource Managers
- Many Resources
- Processors Memory
- Disks Tapes Printers
- Network interfaces Terminals
- Controlled allocation of Resources among
- Users Programs Processors
- Control means sharing/multiplexing, monitoring,
protection, report/payment
8Computer 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
programs). - 4. Users (people, machines, other computers).
9Abstract View of System Components
10History of Computing Systems
- First generation 1945 - 1955
- vacuum tubes, plug boards
- Second generation 1955 - 1965
- transistors, batch systems
- Third generation 1965 1980
- ICs and multiprogramming
- Fourth generation 1980 present
- personal computers
11Batch systems - Transistors (1955-1965)
- Cards into card readers
- Batch similar jobs (to save on set-up time)
- Transferring control automatically, from one
batch job to another -- a rudimentary OS - Job Control Language (JCL)
- Program LOAD RUN Data EOF.
- Resident monitor (user ? operator)
- Initial control in monitor
- transfers control to job
- upon completion, control transfers back to
monitor
12Simple Batch Systems
- Hire an operator
- User ? operator
- Add a card reader
- Reduce setup time by batching similar jobs
- Automatic job sequencing automatically
transfers control from one job to another. First
rudimentary operating system. - Resident monitor
- initial control in monitor
- control transfers to job
- when job completes control transfers back to
monitor
13History of Computing Systems
- Early batch system
- bring cards to 1401
- read cards to tape
- put tape on 7094 which does computing
- put tape on 1401 which prints output
14Memory Layout for a Simple Batch System
15History of Computing Systems
- Structure of a typical FMS job 2nd generation
16Control Cards
- 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
17Control Cards (Cont.)
- Special cards that tell the resident monitor
which programs to runJOBFTNRUNDATAEND - Special characters distinguish control cards from
data or program cards in column 1// in column
1 and 2709 in column1
18Control Cards (Cont.)
- Parts of resident monitor
- Control card interpreter responsible for
reading and carrying out instructions on the
cards. - Loader loads systems programs and applications
programs into memory. - Device drivers know special characteristics and
properties for each of the systems I/O devices. - Problem Slow Performance I/O and CPU could
not overlap card reader very slow. - Solution Off-line operation speed up
computation by loading jobs into memory from
tapes and card reading and line printing done
off-line.
19Spooling
- Overlap I/O of one job with computation of
another job. While executing one job, the OS. - Reads next job from card reader into a storage
area on the disk (job queue). - Outputs printout of previous job from disk to
printer. - Job pool data structure that allows the OS to
select which job to run next in order to increase
CPU utilization.
20Multiprogramming - Integrated Circuits
(1965-1980)
- Several programs reside on disk (and in memory)
at the same time
Job_1
Memory Partitions
Job_2
Job_9
Operating System
21Multiprogramming Why how its possible?
- CPU much faster than I/O
- Memory large enough (512K!)
- requires protection!
- Scheduler which manages flow of jobs in and out
- and shares CPU between jobs requires
Timer - Spooler which takes care of slow I/O (e.g.
printing). -
22OS Features Needed for Multiprogramming
- I/O routine supplied by the system.
- Memory management the system must allocate the
memory to several jobs. - CPU scheduling the system must choose among
several jobs ready to run. - Allocation of devices.
23User mode Privileged mode
- All I/o instructions are privileged instructions
- I/o devices and cpu can execute concurrently
- cpu moves data main memory -- buffers of
device controllers - I/o itself is from device to controllers buffer
- Device controllers interrupt upon completion
- Interrupts or Traps enable mode switching..
- control to interrupt service routine (interrupt
vector) - Architecture saves address of interrupted
instruction - Operating systems are interrupt-driven
24Multiprogramming - Issues
- Protect user programs from each other and OS
from User programs - Schedule CPU between jobs
- Schedule I/O between jobs
- Avoid concurrent access to exclusive devices (e.g
Printer) - Control job flow into and out the system
25Multiprogramming (Cont.)
- I/o routines supplied by the system - device
allocation - Memory management - allocate memory among jobs
- Processes contend for CPU time - cpu scheduling
- Spooling (Simultaneous Peripheral Operations On
Line) - Timesharing i.e. Terminals - jobs kept in
memory and on disk control statements issued
by user (keyboard) - On-line file system is needed, for users access
to data - Examples CTSS Multics Unix.
26Time-Sharing SystemsInteractive Computing
- The CPU is multiplexed among several jobs that
are kept in memory and on disk (the CPU is
allocated to a job only if the job is in memory). - A job is swapped in and out of memory to the
disk. - On-line communication between the user and the
system is provided when the operating system
finishes the execution of one command, it seeks
the next control statement not from a card
reader, but rather from the users keyboard. - On-line system must be available for users to
access data and code.
27Multics(beg. Of 70s) - Innovations
- Programmed in high-level language PL/I
- Time-sharing via terminals
- Virtual memory including Segmentation paging
- Files as segments
- Strong emphasis on protection including
protection rings and segment descriptors -
28Unix (middle of 70s) - Innovations
- First OS on a mini-computer (PDP-11 by Dec)
- High-level language (C )
- Hierarchical file system
- Powerful and convenient shell
- Standard interface to OS via C system calls
- Unification of many concepts via files (e.g.
devices, pipes, etc.) - Protection? forget it! Convenience was more
important! (fixed over the years).
29Personal-Computer Systems
- Personal computers computer system dedicated to
a single user. - I/O devices keyboards, mice, display screens,
small printers. - User convenience and responsiveness.
- Can adopt technology developed for larger
operating system often individuals have sole use
of computer and do not need advanced CPU
utilization of protection features.
30VLSI and personal computers (1980-
- Friendly operating software
- Examples Unix (here too ?) Windows-NT
- Parallel (multiprocessor) systems shared
memory symmetric processing - same OS (no
master) - Networks (distribution)
- Distributed file systems - shared among many
systems - Network operating systems - protection for
simple OSs - Distributed operating systems - distribute
computation among several machines/processors
31The Operating System Zoo
- Mainframe operating systems
- Server operating systems
- Multiprocessor operating systems
- Personal computer operating systems
- Real-time operating systems
- Embedded operating systems
- Smart card operating systems
32Comparison of some operating system sizes
33Migration of Operating-System Concepts and
Features
34Parallel Systems
- Multiprocessor systems with more than one CPU in
close communication. - Tightly coupled system processors share memory
and a clock communication usually takes place
through the shared memory. - Advantages of parallel system
- Increased throughput
- Economical
- Increased reliability
- graceful degradation
- fail-soft systems
35Parallel Systems (Cont.)
- Symmetric multiprocessing (SMP)
- Each processor runs an identical copy of the
operating system. - Many processes can run at once without
performance deterioration. - Most modern operating systems support SMP
- Asymmetric multiprocessing
- Each processor is assigned a specific task
master processor schedules and allocates work to
slave processors. - More common in extremely large systems
36Symmetric Multiprocessing Architecture
37Real-Time Systems
- Often used as a control device in a dedicated
application such as controlling scientific
experiments, medical imaging systems, industrial
control systems, and some display systems. - Well-defined fixed-time constraints.
- Hard real-time system.
- Secondary storage limited or absent, data stored
in short-term memory, or read-only memory (ROM) - Conflicts with time-sharing systems, not
supported by general-purpose operating systems. - Soft real-time system
- Limited utility in industrial control or robotics
- Useful in applications (multimedia, virtual
reality) requiring advanced operating-system
features.
38Distributed Systems
- Distribute the computation among several physical
processors. - Loosely coupled system each processor has its
own local memory processors communicate with one
another through various communications lines,
such as high-speed buses or telephone lines. - Advantages of distributed systems.
- Resources Sharing
- Computation speed up load sharing
- Reliability
- Communications
39Distributed Systems (Cont.)
- Network Operating System
- provides file sharing
- provides communication scheme
- runs independently from other computers on the
network - Distributed Operating System
- less autonomy between computers
- gives the impression there is a single operating
system controlling the network.
40Client-Server Model
Memory Server
File Server
Client Process
. . . . . .
Client Process
Kernel
Machine4
Machine3
Machine1
Machine2
Client
File Server
Process Server
. . . .
. . .
Kernel
Kernel
Kernel
Kernel
Network
Distributed System
41Operating System Structure
42Advanced Architectures
- Multi-processors
- Parallel Computers
- Networks and Distributed systems
- Each of these architectures requires a
corresponding Operating System
43- Fig. 9-5. A bus-based multiprocessor
- Fig 9-8. (a) Grid. (b) Hypercube.
44- Fig. 9-7. A Distributed System consisting of
workstations on a LAN. - Fig 9-1. Advantages of distributed systems over
centralized ones.