Lecture 2 - OS Overview
Lecture 2 - OS Overview
g
Systems: Chapter 2
Internals
and Operating
Design System Overview
Principle Eighth Edition
By William Stallings
s
Operating System
A program that controls the execution of
application programs
Aninterface between applications and
hardware
Main objectives of an OS:
• convenience
• efficiency
• ability to evolve
Operating System
Services
Program development
application program development tools
Program execution
Access I/O devices
provides a uniform interface
Controlled access to files
Protection mechanisms
Operating System
Services
System access
protection of resources and data from
unauthorized users and must
resolve conflicts for resource contention.
Error detection and response
internaland external hardware errors
Software errors
Accounting
monitor performance
Key Interfaces
Instructionset architecture (ISA)
Functional definition of operations,
mode, storage locations supported
by hardware
Precise description of how to invoke
and access them
Key Interfaces
Application binary interface (ABI)
describes the low-level interface
between an application (or any type of)
program and the operating system or
another application.
how parameters are passed between
caller and callee, how return values are
provided to callers, how libraries are
implemented, and how programs are
loaded into memory.
Key Interfaces
Application programming
interface (API)
An API is instructions to the
compiler about what
source code can and
cannot do.
An API is instructions to a
programmer about what
functions expect and do.
The Role of an OS
A computer is a set of resources
for the movement, storage, and
processing of data
The
OS is responsible for
managing these resources
Evolution of Operating
Systems
Fixes
Evolution of
Operating Systems
Stages include:
Time
Sharing
Multiprogramme Systems
d Batch
Systems
Simple
Batch
Systems
Serial
Processin
g
Serial Processing
Earliest
Problems:
Computers:
Scheduling:
No operating system most installations used a
programmers hardcopy sign-up sheet to
interacted directly with reserve computer time
the computer hardware time allocations could
run short or long,
Computers ran from a
resulting in wasted
console with display lights,
computer time
toggle switches, some form
of input device, and a printer Setup time
Users have access to the
a considerable amount of
computer in “series” time was spent just on
setting up the program to
run
Simple Batch
Systems
Early computers were very expensive
important to maximize processor utilization
Monitor
user no longer has direct access to processor
job is submitted to computer operator who
batches them together and places them on
an input device
program branches back to the monitor when
finished
Monitor Point of
View
Monitor controls the
sequence of events
Resident Monitor is
software always in
memory
Monitor reads in job and
gives control
Job returns control to
monitor
Processor Point of
View
Processor executes instruction from the
memory containing the monitor
Executes the instructions in the user program
until it encounters an ending or error condition
“control is passed to a job” means processor is
fetching and executing instructions in a user
program
“control is returned to the monitor” means that
the processor is fetching and executing
instructions from the monitor program
Job Control Language
(JCL)
Special type of
programming language
used to provide
instructions to the monitor
what compiler to
use
Multiprogramming
also known as multitasking
memory is expanded to hold three, four, or more
programs and switch among all of them
Time-Sharing
Systems
Can be used to handle multiple interactive
jobs
Processor time is shared among multiple
users
Multipleusers simultaneously access the
system through terminals, with the OS
interleaving the execution of each user
program in a short burst or quantum of
computation
Batch
Multiprogramming
vs. Time Sharing
a program in execution
an instance of a running program
the entity that can be assigned to, and executed on, a
processor
a unit of activity characterized by a single sequential thread of
execution, a current state, and an associated set of system
resources
Components of
a Process
A Theexecution context
process
contains three is essential:
it is the internal data by
components: which the OS is able to
an executable supervise and control the
program process
the associated data
includes the contents of the
various process registers
needed by the
includes information such
program (variables,
as the priority of the
work space, buffers, process and whether the
etc.) process is waiting for the
the execution completion of a particular
context (or “process I/O event
Different
Architectural
Approaches
Demands on operating systems
require new ways of organizing the
OS
Different approaches and design elements have
been tried:
• kernel architecture
• multithreading
• symmetric multiprocessing
• distributed operating systems
• object-oriented design
Types of kernel
Kernel is the core part of an operating system which
manages system resources. It also acts like a bridge
between application and hardware of the computer. It is
one of the first programs loaded on start-up (after the
Bootloader).
Types of Kernel
MONOLITHIC KERNEL
MICRO KERNEL
HYBRID KERNEL
Monolithnic vs
Microkernel
Types of kernel
The approach:
is well suited
simplifies
provides to a
implementatio
flexibility distributed
n
environment
Multithreading
Technique in which a process, executing an
application, is divided into threads that can run
concurrently
Thread
• dispatchable unit of work
• includes a processor context and its own data area to
enable subroutine branching
• executes sequentially and is interruptible
Process
• a collection of one or more threads and associated system
resources
• programmer has greater control over the modularity of the
application and the timing of application related events
Symmetric
Multiprocessing
(SMP)
Term that refers to a computer hardware
architecture and also to the OS behavior that
exploits that architecture
Several processes can run in parallel
Multiple processors are transparent to the user
these processors share same main memory and
I/O facilities
all processors can perform the same functions