21AD201-OPERATING
SYSTEM PRINCIPLES
1
Operating System
• A program that controls the execution of
application programs
• An interface between applications and
hardware
2
Operating System Objectives
• Convenience
– Makes the computer more convenient to use
• Efficiency
– Allows computer system resources to be
used in an efficient manner
• Ability to evolve
– Permit effective development, testing, and
introduction of new system functions
without interfering with service
3
UNIT-1
INTRODUCTION
4
Layers of Computer System
5
Objectives
• Program development
– Editors and debuggers
• Program execution
• Access to I/O devices
• Controlled access to files
• System access
6
Objectives
• Error detection and response
– Internal and external hardware errors
• Memory error
• Device failure
– Software errors
• Arithmetic overflow
• Access forbidden memory locations
– Operating system cannot grant request of
application
7
Functions
• Responsible for managing resources
• Functions same way as ordinary
computer software
– It is program that is executed
• Operating system relinquishes control of
the processor
8
Components of Operating
System
9
Evolution of an Operating
System
• Hardware upgrades plus new types of
hardware
• New services
• Fixes
10
Evolution of Operating
Systems
• Serial Processing
– No operating system
– Machines run from a console with display
lights, toggle switches, input device, and
printer
– Schedule time
– Setup included loading the compiler, source
program, saving compiled program, and
loading and linking
11
Evolution of Operating
Systems
• Simple Batch Systems
– Monitors
• Software that controls the sequence of events
• Batch jobs together
• Program branches back to monitor when
finished
12
Key Elements of
Operating System
13
Operating-System Structure
• Multiprogramming
– It allows to run multiple processes by switching
between them.
• Time Sharing
– It allows multiple processes/users to use the same
resources in their respective timeslots.
– Response time is usually less than 1 second which
gives the idea of parallel processing.
– To ensure the reasonable time response swapping
is perform which allows process to move in and
out from memory.
– Space where these processes are moved is called14
virtual memory.
Operating-System Services
• User Interface
• Program Execution
• I/O Operations
• File-System Manipulation
• Communications
• Error Detection
• Resource Allocation
• Logging
• Protection & Security
15
User and Operating-System
Interface
• There are three fundamental approaches to use OS by
user:
– Command Interpreter (windows powershell, linux
terminal)
– Graphical User Interface (Keyboard/mouse)
– Touch-Screen Interface (Gestures by hand)
16
System Calls
• System Calls are the ways to provide essential
services to applications/users.
• These services include:
– Input/Output (I/O) Operations
– Process Creation and Management
– Memory Allocation and Management
– File Management
• If program is in user mode then it request the kernel to
provide response for which it sends core information
about the request.
17
Cont.
• Most common System Calls are:
– read(): Reads data/device
– write(): Writes data/device
– open(): Opens a file/device
– close(): Closes a file/device
– fork(): Creates a new process that is a copy of the
calling process.
– exec(): Replaces the current process image with a
new process image.
– getpid(): Returns the process ID of the calling
process.
– exit(): Terminates the calling process and returns
control to the operating system.
18
Operating-System Structure
There are six designs in Operating Systems:
• Monolithic systems (OS Runs as a single program in
kernel mode) i.e. win98/DOS
•Layered systems (OS is divided into multiple
independent layers working together) i.e. Win XP
•Microkernels (OS is divided into smaller chunks and
only one portion runs in kernel) i.e. Hurd
•Client-server systems i.e. Windows Server
•Virtual machines (Clones OS for each user) i.e. Oracle
Virtualbox
– Hypervisor (Type I runs directly on Hardware,
Type II runs on Host OS)
•Exokernels (Rather Cloning the OS, divide it based on
user requirement) i.e. Nemesis 19