0% found this document useful (0 votes)
19 views119 pages

Osv Chapter 1 PDF

The document provides an overview of computer systems and operating systems, detailing their architecture, components, and functions. It covers the roles of the operating system as a resource manager and an intermediary between hardware and users, along with the evolution of operating systems through different generations. Key topics include system calls, types of operating systems, and the objectives of operating systems in managing resources efficiently.

Uploaded by

mdchaudhary37
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views119 pages

Osv Chapter 1 PDF

The document provides an overview of computer systems and operating systems, detailing their architecture, components, and functions. It covers the roles of the operating system as a resource manager and an intermediary between hardware and users, along with the evolution of operating systems through different generations. Key topics include system calls, types of operating systems, and the objectives of operating systems in managing resources efficiently.

Uploaded by

mdchaudhary37
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 119

3140702

Uni – 1 Introductiont

Prepared By:

Prof. Jahnavi T Patel ,Assistant Prof.


IT DEPT LDCE,AHMEDABAD
Topics to be covered
 Computer system overview
 Computer system architecture
 Definition of Operating System (OS)
 Objectives / Goals of Operating System (OS)
 Generations of Operating Systems (OS)
 Operating Systems (OS) services
 Types of Operating Systems (OS)
 System calls
 Operating Systems (OS) structure
 Multiprogramming v/s Multiprocessing v/s
Multitasking
 Time Sharing Operating System
 Parallel Processing Operating System
 Distributed Operating System
PROF J.T.PATEL
2
Basic elements of
computer

I/O
Process Module
or s

Main Syste
Memor m
y Bus

PROF J.T.PATEL
3
2 PROF J.T.PATEL
Processor

Referred
Referredtotoas
as
thethe Central
Central
Processing
Processing
Unit (CPU)
Unit (CPU)
Arithmetic & Logic Unit Control Unit
Unit Unit
Performs the Controls the
data
data operation of
processing
processing the computer
functions
functions
PROF J.T.PATEL
4
2 PROF J.T.PATEL
Main memory
Volatile
• Contents of the memory is lost
when the computer is shut down
Referred to as primary memory or RAM.

PROF J.T.PATEL
5
2 PROF J.T.PATEL
I/O modules
Input/output module is a device that acts as the
connective bridge between a computer system
at one end and an I/O or peripheral device at the
other, such as a printer, webcam or scanner.
storage (e.g.
Moves hard
drive)
between
data the
computer
and external communication
environment s
s such as: equipment
terminal
s
PROF J.T.PATEL
6
2 PROF J.T.PATEL
System bus
Provides communication
among processors, main
memory,
and I/O modules.

PROF J.T.PATEL
7
2 PROF J.T.PATEL
Computer system
architecture

PROF J.T.PATEL
8
2 PROF J.T.PATEL
Input unit
• It provides data and
instructions
to the computer system.
• Commonly used input devices
are keyboard, mouse,
magnetic tape etc.
• Input unit performs following
tasks:
– Accept the data and
instructions from the
outside environment.
– Convert it into
machine language.
– Supply the converted
data to computer system.

PROF J.T.PATEL
9
2 PROF J.T.PATEL
Output
unit
• It connects the internal
system of a computer to
the external environment.
• It provides the results of any
computation, or instructions
to the outside world.
• Some output devices are
printers, monitor etc.

PROF J.T.PATEL
PROF J.T.PATEL
Storage unit (Memory
unit)
• This unit holds the data
and instructions.
• It store the
intermediat
als s befor
these
e
o are sentresult
to the output
e
devices. s
• It also stores the data
for later use.
• Th storage unit of a
compute
e syste can
divided
r intomtwo b
categories: e
1. Primary Storage
2. Secondary Storage

PROF J.T.PATEL
11
1 PROF J.T.PATEL
1
Primary
Storage
• This memory is used to
store the data which is
being currently executed.
• It is used for temporary
storage of data.
• The data is lost, when the
computer is switched off.
• RAM is used as primary
storage memory.

PROF J.T.PATEL
12
1 PROF J.T.PATEL
1
Secondary
Storage
• The secondary memory is
slower and cheaper than
primary memory.
• It is used for permanent
storage of data.
• Commonly used secondary
memory devices are hard
disk, CD etc.

PROF J.T.PATEL
13
1 PROF J.T.PATEL
1
CPU (Central Processing
Unit)
• The Arithmetic Logical
Unit and Control Unit are
together known as CPU.
• CPU is the brain of
computer system. It
performs following tasks:
– performs all operations.
– takes all decisions.
– controls all the units
of computer.

PROF J.T.PATEL
14
1 PROF J.T.PATEL
1
ALU (Arithmetic Logical
Unit)
• All the calculations
performed in ALU of are
computer system. the
• The ALU can perform
basic operations such as
addition, subtraction,
division, multiplication
• etc.
Whenever calculations
required, the contr ar
transfers ol e
storage
the unit to ALU.
data uni
• When the operations aret
done, the result frois
transferred back to the m
storage unit.

PROF J.T.PATEL
15
1 PROF J.T.PATEL
1
CU (Control Unit)
• It controls all other units
of the computer.
• It controls the flow of data
and instructions to and
from the storage unit to
ALU.
• Thus it is also known as
central nervous system of
the computer.

PROF J.T.PATEL
16
1 PROF J.T.PATEL
1
What is Operating System
(OS)?
 A Computer System consists of various hardwares
such as

Process RA Keyboard &


or M Mouse

Hard Disk Monitor Printer

Who manages (controls) these hardwares???


17
1 PROF J.T.PATEL
Operating
PROF J.T.PATEL
1
System
Definition of Operating System
An Operating System (OS) is a collection of
software that
• manages hardware resources
• provides various service to the users

PROF J.T.PATEL
18
1 PROF J.T.PATEL
1
Examples of Operating
System

Exampl
es of
Operatin
g
System

PROF J.T.PATEL
19
1 PROF J.T.PATEL
1
Where OS lies? (Interaction of OS & Hardware)

Web E- Musi
browse mail c
r reade playe
r r

Softwar User
e Program
Operating
System
Hardwar
e
OS lies between hardware and user program.
It acts as an intermediary between the
user and the hardware.
PROF J.T.PATEL
2 PROF J.T.PATEL
0
Modes of operation of computer
1. Kernel Mode
• has complete access to
all the hardware Web E- Musi
• can execute any browse mail c
r reade playe
instruction that a machine r r
is capable of
Use
• executing
has high privileged User
Mod
r
(rights) S/ e
2. User W Program
Kern
Mode
• can execute only Operating
el
System
(few subset of Mode
)
instructions the H/W
machine
• has less privileged
(rights)

21
2 PROF J.T.PATEL
1
Why and How switch occur?

Web Turbo  User is writing program in


browse Music C C. Once finish writing will
r playe  execute
r it.
Use user-mode
Mod
r performs
programtrap
S/ User instruction
e  To execute this
W Program
Kern program
1. Load program into
Operating
el RAM
System
Mode
2. Program is executed
H/W
by processor

22
2 PROF J.T.PATEL
1
Roles of OS (OS can be viewed as)
1. The OS as an Extended/Virtual Machine
2. The OS as a Resource Manager

23
2 PROF J.T.PATEL
1
OS as Extended Machine
 The architecture of a computer is difficult to program
• Architecture (instruction set, memory organization, I/O, bus
structure) of most of computer at the machine level language
is primitive and awkward to program.
• Example: If user want to read from floppy or hard disk:

24
2 PROF J.T.PATEL
1
OS as Extended Machine
• Example: If user want to read from floppy or hard disk:
User has to write command and
address to the disk controller and
then initiate the I/O.
Disk Controller

25
2 PROF J.T.PATEL
1
OS as Extended Machine
• Example: If user want to read from floppy or hard
disk: disk controller will find the User has to check the
The
requested data in the disk and fetch it status of disk controller
from disk to disk controller buffer. operation where it has
finished or not.

26
2 PROF J.T.PATEL
1
OS as Extended Machine
• Example: If user want to read from floppy or hard
disk:
If success, the data from disk controller
buffer should be moved to main
memory (to the application buffer).

27
2 PROF J.T.PATEL
1
OS as Extended Machine
(Cont…)
 If all the users will have to do these messy details:
• The program will be very difficult to write and quite long.
• The program will be hardware dependent.
 User don’t want to be involved in programming of storage
devices.
 Therefore, an OS provides a set of basic commands or
instructions to perform various operations such as read,
write, modify, save or close.
 Dealing with these command is easier than directly dealing
with hardware.
 Operating system hides the complexity of hardware and
present a beautiful interface to the users.

28
2 PROF J.T.PATEL
1
OS as Resource Manager
 There are lots of resources in computer system
• CPU (Processor)
• Memory
• I/O devices such as hard disk, mouse, keyboard, printer,
scanner etc.
 If a computer system is used by multiple applications (or
users), then they will compete for these resources.

29
2 PROF J.T.PATEL
1
OS as Resource Manager
 It is the job of OS to allocate these resourcesto the
various applications so that:
• The resources are allocated fairly (equally)

P Wants to print 50
1 lines
After printing 10 lines of P1

P Wants to print 20
2 lines
After printing 20 lines of P1

P Wants to print 15
3 lines

P Wants to print 15
4 lines

PROF J.T.PATEL
3 PROF J.T.PATEL
0
OS as Resource
Manager
 It is the job of OS to allocate these resourcesto the
various applications so that:
• The resources are protected from cross-access

P Wants to print 50
1 lines
After printing 10 lines of P1

P Wants to print 20
2 lines
After printing 20 lines of P1

P Wants to print 15
3 lines

P Wants to print 15
4 lines

PROF J.T.PATEL
31
3 PROF J.T.PATEL
1
OS as Resource Manager
 It is the job of OS to allocate these resourcesto the
various applications so that:
• Access to the resources is
synchronized so that operations
are correct and consistent
• Example: If we write a program to calculate below in C
language

7 + 9 – 6 * 4 / 2 =24
P1 P2 P3 P4

3 4 1
2 0

PROF J.T.PATEL
32
3 PROF J.T.PATEL
1
OS as Resource Manager
 It is the job of OS to allocate these resourcesto the
various applications so that:
• Deadlock are detected, resolved and avoided.

PROF J.T.PATEL
33
3 PROF J.T.PATEL
1
OS as Resource Manager (Cont…)
 Resource manager – sharing resources in two different
ways:
1. In time sharing/multiplexing (i.e CPU)

PROF J.T.PATEL
34
3 PROF J.T.PATEL
1
OS as Resource Manager
(Cont…)
 Resource manager – sharing resources in two different
ways
2. In space sharing/multiplexing. (i.e Memory)

Proces Proces Proces Empt


s 1 s 2 s 3 ySpac
e
Main Memory

PROF J.T.PATEL
35
3 PROF J.T.PATEL
1
Objectives / Goals of Operating System
 Make the computer system convenient to use in
an efficient manner.
 Hide the details of the hardware resources from the users.
 Provide users a convenient interface to use the computer
system.
 Act as an intermediary between the
hardware and its users, making it easier for
the users to access and use other resources.
 Manage the resources of a computer system.
 Keep track of who is using which resource, granting
resource requests, and mediating conflicting requests from
different programs and users.
 Provide efficient and fair sharing of resources among
users and programs.

PROF J.T.PATEL
36
3 PROF J.T.PATEL
1
History of OS (First generation)
 First generation (1945-1955)
• Vacuum tubes and plug-boards are used in these
systems.

Vacuum
tubes Plug
board

PROF J.T.PATEL
PROF J.T.PATEL
History of OS (Second generation)
 Second generation (1955-1965)
• Transistors are used in these systems
• The machine that are produced are called
mainframes.
• Batch systems was used for processing.

Programmers 1b4ri0n1grceaarddssbtoat1Oc4hp0eo1rfajtoobrscoanrtioest7ai0np9pe4udtOotaeppseercaotomor7p0cua9tr4inriges outp1u4t0t1a


perintots1o4u0t1put

PROF J.T.PATEL
PROF J.T.PATEL
History of OS (Third
generation)
 Third generation (1965-1980)
• Integrated circuits (IC's) are used in place of transistors in
these computers.
• It provides multiprogramming (the ability to
have several programs in memory at once, each in its
own memory partition).

PROF J.T.PATEL
39
3 PROF J.T.PATEL
1
History of OS (Fourth
generation)
 Fourth generation (1980-present)
• Personal Computers
• LSI (Large Scale Integration) circuits, chips containing
thousands of transistors are used in these systems.

PROF J.T.PATEL
4 PROF J.T.PATEL
0
Services / Functions / Tasks of
OS

Definition of Operating
System
An Operating System (OS) is a collection of
software that
• manages hardware resources
• provides various service to the users

PROF J.T.PATEL
PROF J.T.PATEL
Services / Functions / Tasks of OS
1. Program development
• It provides editors and debuggers to assist (help) the
programmer in creating programs.

PROF J.T.PATEL 42 PROF J.T.PATEL


Services / Functions / Tasks of OS
2. Program execution
• Following tasks need to be perform to execute a
program:
Instructions and data must be loaded into main
memory.
I/O devices and files must be initialized.
• The OS handles all these duties for the user.

PROF J.T.PATEL
Services / Functions / Tasks of
OS
3. Access to I/O devices (Resource allocation)
• A running program may require I/O, which may involve file or
an I/O device.
• For efficiency and protection, users cannot control I/O
devices directly.
• Therefore, the OS controls these I/O devices
and provides to program as per requirement.

PROF J.T.PATEL 44
Services / Functions / Tasks of OS
4. Memory management
• OS manages memory hierarchy.
• OS keeps the track of which part of memory area in use in
use and free memory.
• It allocates memory to program when they need it.
• It de-allocate the memory when the program finish
execution.
P
1

P
2

PROF J.T.PATEL 45 PROF J.T.PATEL


Services / Functions / Tasks of
OS
5. Controlled access to file
• In case of file access, OS provides a directory hierarchy for
easy access and management of file.
• OS provides various file handling commands using which
user can easily read, write and modify file.

PROF J.T.PATEL 46 PROF J.T.PATEL


Services / Functions / Tasks of
OS
6. Communication
• In multitasking environment, the processes need to
communicate with each other and to exchange their
information.
• Operating system performs the
communication among various types of processes in
the form of shared memory.

PROF J.T.PATEL 47 PROF J.T.PATEL


Services / Functions / Tasks of
OS
7. Error detection and response
• An error may occur in CPU,in I/O devices or in the
memory hardware.
• Following are the major activities of an operating system with
respect to error handling −
The OS constantly checks for possible errors.
The OS takes an appropriateaction to ensure correct
and consistent computing.

PROF J.T.PATEL 48 PROF J.T.PATEL


Services / Functions / Tasks of
OS
8. Accounting
• Keeping a track of which users are using how much and
what kinds of computer resources can be used for
accounting or simply for accumulating usage statistics.
• Usage statistics is used to reconfigure the system to improve
computing services.

PROF J.T.PATEL 49 PROF J.T.PATEL


Services / Functions / Tasks of
OS
9. Protection & Security
• Protection involves ensuring that all accesses to system
resources is controlled.
• To make a system secure, the user needs to authenticate
himself or herself to the system.

PROF J.T.PATEL
PROF J.T.PATEL
Services / Functions / Tasks of OS
(Revision)
1. Program development
2. Program execution
3. Access to I/O devices
4. Memory management
5. Controlled access to file
6. Communication
7. Error detection and
response
8. Accounting
9. Protection & Security

PROF J.T.PATEL 51 PROF J.T.PATEL


A View of Operating System Services
User Operating System Interface - CLI

CLI or command interpreter allows direct command


entry
 Sometimes implemented in kernel, sometimes by
systems program
 Sometimes multiple flavors implemented – shells
 Primarily fetches a command from user and executes it
 Sometimes commands built-in, sometimes just names of
programs
 If the latter, adding new features doesn’t require shell modification
Bourne Shell Command Interpreter
User Operating System Interface - GUI

 User-friendly desktop metaphor interface


 Usually mouse, keyboard, and monitor
 Icons represent files, programs, actions, etc
 Various mouse buttons over objects in the interface cause
various actions (provide information, options, execute
function, open directory (known as a folder)
 Invented at Xerox PARC
 Many systems now include both CLI and GUI interfaces
 Microsoft Windows is GUI with CLI “command” shell
 Apple Mac OS X is “Aqua” GUI interface with UNIX kernel
underneath and shells available
 Unix and Linux have CLI with optional GUI interfaces (CDE,
KDE, GNOME)
Touchscreen Interfaces

Touchscreen devices require


new interfaces
 Mouse not possible or not desired
 Actions and selection based on gestures
 Virtual keyboard for text entry
 Voice commands.
The Mac OS X GUI
System Calls
 Programming interface to the services provided by the
OS
 Typically written in a high-level language (C or C++)
 Mostly accessed by programs via a high-level
Application Programming Interface (API) rather
than direct system call use
 Three most common APIs are Win32 API for Windows,
POSIX API for POSIX-based systems (including virtually
all versions of UNIX, Linux, and Mac OS X), and Java
API for the Java virtual machine (JVM)
Note that the system-call names used throughout this text are generic
Example of System Calls

 System call sequence to copy the contents of one file to


another file
Example of Standard API
System Call Implementation

 Typically, a number associated with each system call


 System-call interface maintains a table indexed according
to these numbers
 The system call interface invokes the intended system call
in OS kernel and returns status of the system call and any
return values
 The caller need know nothing about how the system call is
implemented
 Just needs to obey API and understand what OS will do as a
result call
 Most details of OS interface hidden from programmer by API
 Managed by run-time support library (set of functions built into libraries
included with compiler)
API – System Call – OS Relationship
System Call Parameter Passing
 Often, more information is required than simply identity of
desired system call
 Exact type and amount of information vary according to OS
and call
 Three general methods used to pass parameters to the OS
 Simplest: pass the parameters in registers
 In some cases, may be more parameters than registers
 Parameters stored in a block, or table, in memory, and address
of block passed as a parameter in a register
 This approach taken by Linux and Solaris
 Parameters placed, or pushed, onto the stack by the
program and popped off the stack by the operating system
 Block and stack methods do not limit the number or length of
parameters being passed
Parameter Passing via Table
Types of System Calls
 Process control
 create process, terminate process
 end, abort
 load, execute
 get process attributes, set process attributes
 wait for time
 wait event, signal event
 allocate and free memory
 Dump memory if error
 Debugger for determining bugs, single step execution
 Locks for managing access to shared data between processes
Types of System Calls

 File management
 create file, delete file
 open, close file
 read, write, reposition
 get and set file attributes
 Device management
 request device, release device
 read, write, reposition
 get device attributes, set device attributes
 logically attach or detach devices
Types of System Calls (Cont.)

 Information maintenance
 get time or date, set time or date
 get system data, set system data
 get and set process, file, or device attributes
 Communications
 create, delete communication connection
 send, receive messages if message passing model to host
name or process name
 From client to server
 Shared-memory model create and gain access to memory
regions
 transfer status information
 attach and detach remote devices
Types of System Calls (Cont.)

 Protection
 Control access to resources
 Get and set permissions
 Allow and deny user access
Examples of Windows and Unix System Calls
Standard C Library Example

 C program invoking printf() library call, which calls


write() system call
Example: MS-DOS

 Single-tasking
 Shell invoked when system
booted
 Simple method to run
program
 No process created
 Single memory space
 Loads program into
memory, overwriting all
but the kernel
 Program exit -> shell
reloaded At system startup running a program
Example: FreeBSD
 Unix variant
 Multitasking
 User login -> invoke user’s choice of
shell
 Shell executes fork() system call to
create process
 Executes exec() to load program into
process
 Shell waits for process to terminate or
continues with user commands
 Process exits with:
 code = 0 – no error
 code > 0 – error code
System Programs
 System programs provide a convenient environment for
program development and execution. They can be
divided into:
 File manipulation
 Status information sometimes stored in a File modification
 Programming language support
 Program loading and execution
 Communications
 Background services
 Application programs
 Most users’ view of the operation system is defined by
system programs, not the actual system calls
System Programs
 Provide a convenient environment for program development
and execution
 Some of them are simply user interfaces to system calls; others
are considerably more complex
 File management - Create, delete, copy, rename, print,
dump, list, and generally manipulate files and directories
 Status information
 Some ask the system for info - date, time, amount of available
memory, disk space, number of users
 Others provide detailed performance, logging, and debugging
information
 Typically, these programs format and print the output to the
terminal or other output devices
 Some systems implement a registry - used to store and
retrieve configuration information
System Programs (Cont.)
 File modification
 Text editors to create and modify files
 Special commands to search contents of files or perform
transformations of the text
 Programming-language support - Compilers,
assemblers, debuggers and interpreters sometimes
provided
 Program loading and execution- Absolute loaders,
relocatable loaders, linkage editors, and overlay-loaders,
debugging systems for higher-level and machine language
 Communications - Provide the mechanism for creating
virtual connections among processes, users, and computer
systems
 Allow users to send messages to one another’s screens,
browse web pages, send electronic-mail messages, log in
remotely, transfer files from one machine to another
System Programs (Cont.)
 Background Services
 Launch at boot time
 Some for system startup, then terminate
 Some from system boot to shutdown
 Provide facilities like disk checking, process scheduling, error
logging, printing
 Run in user context not kernel context
 Known as services, subsystems, daemons

 Application programs
 Don’t pertain to system
 Run by users
 Not typically considered part of OS
 Launched by command line, mouse click, finger poke
Operating System Design and Implementation

 Design and Implementation of OS not “solvable”, but some


approaches have proven successful
 Internal structure of different Operating Systems can vary
widely
 Start the design by defining goals and specifications

 Affected by choice of hardware, type of system

 User goals and System goals


 User goals – operating system should be convenient to use, easy
to learn, reliable, safe, and fast
 System goals – operating system should be easy to design,
implement, and maintain, as well as flexible, reliable, error-
free, and efficient
Operating System Design and Implementation (Cont.)

 Important principle to separate


Policy: What will be done?
Mechanism: How to do it?
 Mechanisms determine how to do something, policies
decide what will be done
 The separation of policy from mechanism is a very
important principle, it allows maximum flexibility if
policy decisions are to be changed later (example –
timer)
 Specifying and designing an OS is highly creative task
of software engineering
Implementation

 Much variation
 Early OSes in assembly language
 Then system programming languages like Algol, PL/1
 Now C, C++
 Actually usually a mix of languages
 Lowest levels in assembly
 Main body in C
 Systems programs in C, C++, scripting languages like PERL,
Python, shell scripts
 More high-level language easier to port to other hardware
 But slower
 Emulation can allow an OS to run on non-native hardware
Types of OS
1. Mainframe operating systems
• OS found in room sized computers which are still found in
major corporate data centres.
• They offer three kinds of services:
1) Batch OS – processes routine jobs without any interactive
user
presents i.e. claim processing in insurance
2) Transaction processing – handles large numbers of small
processes i.e. cheque processing at banks

3) Timesharing – allows multiple remote users to run their jobs


at once i.e. querying a database, airline booking system
• Examples: OS/390, OS/360.

PROF J.T.PATEL
1 PROF J.T.PATEL
Types of
OS
1. Mainframe operating systems
• OS found in room sized computers which are still found in
major corporate data centres.
• They offer three kinds of services:
1) Batch OS – processes routine jobs without any
interactive user presents i.e. claim processing in insurance
2) Transaction processing –
handles large numbers of small
processes i.e. cheque processing at banks
3) Timesharing – allows multiple remote users to run
their jobs at once i.e. querying a database, airline booking
system
• Examples: OS/390, OS/360.

PROF J.T.PATEL 53 PROF J.T.PATEL


Types of OS
(Cont…)
2. Server operating systems
• This OS runs on servers which are very large PC,
workstations or even mainframes.
• They serve multiple users at once over a network and
allow the users to share hardware & software resources.
• It provides print services, file service or web service.
• It handles the incoming requests from clients.
• Examples: Solaris, FreeBSD, and Linux and Windows Server
200x.

PROF J.T.PATEL 54 PROF J.T.PATEL


Types of OS (Cont…)
3. Multiprocessor operating systems
• A computer system consist two or more CPUs is called

•multiprocessor.
• It is also called parallel computers, multicomputer
or multiprocessor.
• They need special OS or some variations on server OS with
special features for communication, connectivity and
consistency.
• Examples: Windows and Linux.

PROF J.T.PATEL
555 PROF J.T.PATEL
1
Types of OS (Cont…)
4. Personal computer operating systems
• The operating systems installed on our personal computer
and laptops are personal OS.
• Job of this OS is to provide good support to single user.
• This OS is widely used for word processing,
spreadsheet and internet access.
• Examples: Linux, Windows vista and Macintosh.

PROF J.T.PATEL
5 PROF J.T.PATEL
1
Types of OS
(Cont…)
5. Handhelds computer operating systems
• A handheld computer or PDA (Personal Digital Assistant) is
small computer that fit in a Pocket and perform small
number of functions such as electronic address book,
memo pad.
• The OS runs on these devices are handheld OS.
• These OS also provides ability to handle telephony, digital
photography and other functions.
• Examples: Symbian OS, Palm OS.

PROF J.T.PATEL 57 PROF J.T.PATEL


Types of OS (Cont…)
6. Embedded operating systems
• This OS is installed in ATMs, printers, calculators
and washing machine.
• It runs on the computer that control devices.
• It neither allow to downloadnew software nor . accept
user installed software. So there is no need for
protection
• Examples: QNX, VxWorks.

PROF J.T.PATEL 58 PROF J.T.PATEL


Types of OS (Cont…)
7. Sensor node operating systems
• Network of tiny sensor nodes are being developed for
numerous purpose.
• Each nodes are tiny computers with a CPU, RAM, ROM
and one or more environmental sensors.
• The OS installed in these nodes are sensor node OS.
• They communicate with each other and with base station
using wireless communication.
• These sensor network are used to protect area of building,
detect fires in forest, measure temperature.
• Examples: TinyOS.

PROF J.T.PATEL 59 PROF J.T.PATEL


Types of OS
(Cont…)
8. Real time operating systems
• These systems having time as a key parameter.
• Real time OS has well defined fixed time constraints.
Processing must be done within defined time
• Two typeconstraints
of real time os:

1. Hard real time – missing an occasional deadline can


cause any permanent damage. Many of these are found
in industrial process control, car engine control
system.
2. Soft real time – missing an occasional deadline does
not cause any permanent damage. Used in digital
audio, multimedia system.
• Examples: e-Cos.

PROF J.T.PATEL
PROF J.T.PATEL
Types of OS (Cont…)
9. Smart card operating systems
• Smallest OS run on smart cards which are credit card sized
devices containing CPU chip.
• These OS are installed on electronic payments cards such
as debit card, credit card etc.
• They have limited processing power.
• Some smart cards are Java oriented. ROM on smart card
holds an interpreter for the JVM – small program.

PROF J.T.PATEL
PROF J.T.PATEL
Types of OS (Revision)
1. Mainframe operating systems
2. Server operating systems
3. Multiprocessor operating systems
4. Personal computer operating
systems
5. Handhelds computer operating
systems
6. Embedded operating systems
7. Sensor node operating systems
8. Real time operating systems
9. Smart card operating systems

PROF J.T.PATEL
62
6 PROF J.T.PATEL
1
Operating system
structures
1. Monolithic systems
2. Layered systems
3. Microkernel
4. Client-server model
5. Virtual machines
• VM/370
• Virtual machines
rediscovered
• The java virtual machine
6. Exokernels

PROF J.T.PATEL
PROF J.T.PATEL
Monolithic systems
 The entire OS runs as a single program in kernel mode.
 OS is written as a collection of procedures, linked together
into a single large executable binary program.
 Each procedure has well defined interface in terms of
parameter and results, and each one is free to call any
other one.
 A main program that invoke the Main
requested service procedure. Procedur
e
 A set of service procedures that carry Service
out the system calls. Procedure
 A set of utility procedures that s
Utility
help the service procedure. Procedur
e

PROF J.T.PATEL
PROF J.T.PATEL
Layered systems
 In this system, the OS is organized as a hierarchy of layers.
 The first system constructed in this way was THE system.
Grouping of Functions in a layer
 The functions related to a category are grouped together and
made a layer of that category.
 The top most layer provides the interface to applications of the
users.

PROF J.T.PATEL
 The lowest layer interacts with the underlying hardware.
• Each layer can communicate with only layers immediately below or
above it.
• Moreover, a layer uses the services of the layer below it.

• Debugging is easy.

• Protection among different modules of different layers


Problems with layered structure

 It may suffer from efficiency problems if number of layers is more.


 It may lead to again a complex architecture.
 It may be difficult sometimes to isolate functionality from one another.
Architecture of THE
system
Layer Function Description
5 The operator Operator was located.
4 User Programs User programs were found.
3 Input / Takes care of managing the I/O
Output devices. Buffering the information.
Management
2 Operator- Handles communication between each process
process and the operator console (i.e. user).
communication
1 Memory Did the memory management.
and drum Allocated space for process in main memory and
manageme on a 512K word drum used for holding parts of
nt processes for which there was no room in
memory.
0 Processor Provided the basic multiprogramming of the CPU.
allocation Dealt with allocation of the processor,
and multi- switching between processes when
programmin
PROF J.T.PATEL interrupts occurred or timers expired.
g
Microkernel
 In layered approach, the designer have choice where to
draw the kernel and user mode boundary.
 It is better to put as little as possible in kernel mode
because bugs in the kernel can bring down the system
instantly.
 The microkernel design provides high reliability by splitting
OS up into small well defined modules, only one module
run in kernel and rest of all run in user mode.
 As each device driver runs as a user process, a bug in audio
driver will cause the sound to be stop, but not crash the
computer.
 Examples: Integrity, K42, QNX, Symbian and MINIX 3.

PROF J.T.PATEL 71 PROF J.T.PATEL


Microkernel
(Cont…)

 Kernel contains only


• Sys (Kernel call handler)
• Clock (because scheduler interact
with it)

PROF J.T.PATEL 72 PROF J.T.PATEL


 Moves as much from the kernel into user space
 Mach example of microkernel
 Mac OS X kernel (Darwin) partly based on Mach
 Communication takes place between user modules using
message passing
 Benefits:
 Easier to extend a microkernel
 Easier to port the operating system to new architectures
 More reliable (less code is running in kernel mode)
 More secure
 Detriments:
 Performance overhead of user space to kernel space
communication
Client-Server
model
 Processes are divided into two categories
• Servers: provide services
• Clients: uses services
 Client and server run on different computers, connected
by LAN or WAN and communicate via message passing.
 To obtain a service, a client construct a message saying
what it wants and send it to server.
 The server then does the work and send back the answer.

PROF J.T.PATEL 73 PROF J.T.PATEL


Virtual machines
 The initial releases of OS/360 were strictly batch systems.
 But many users wanted to be able to work
interactively at a terminal, so OS designers
decided to write timesharing systems for it.
 Types of Virtual machines are:
• VM/370
• Virtual Machines Rediscovered
• The Java Virtual Machine

PROF J.T.PATEL 74 PROF J.T.PATEL


VM/37
0

 Virtual machine monitor run on the bare hardware and


does the multiprogramming.
 Each virtual machine is identical to the true hardware;
each one can run any OS (may be different) that will run
directly on the bare hardware.
 On VM/370, some run OS/360 while the others run single
user interactive system called CMS (Conversational Monitor
System) for interactive time sharing users.

PROF J.T.PATEL 75 PROF J.T.PATEL


VM/370
(Cont…)

 When CMS program executed a system call, a call was


trapped to the operating system in its own virtual machine,
not on VM/370.
 CMS then issued the normal hardware I/O instruction for
reading its virtual disk or whatever was needed to carry out
the call.
 These I/O instructions were trapped by VM/370 which
then performs them.

PROF J.T.PATEL 76 PROF J.T.PATEL


Virtual Machines
Rediscovered

 Companies can run their mail servers, web servers, FTP


servers and other servers on the same machine without
having a crash of one server bring down the rest.
 Web hosting company offers virtual machines for rent, where
a single physical machine can run many virtual machines;
each one appears to be a complete machine.
 Customers who rent a virtual machine can run any OS or
software.

PROF J.T.PATEL 77 PROF J.T.PATEL


Virtual Machines Rediscovered
(Cont…)

 Another use of virtualization is for end users who want to be


able to run two or more operating systems at the same
time, say Windows and Linux.
 Type 1 hypervisors runs on the bare hardware.
 Type 2 hypervisors run as application programs on top of
Windows, Linux, or some other operating system, known as
the host operating system.

PROF J.T.PATEL 78 PROF J.T.PATEL


Java Virtual Machine
• When Sun Microsystems
invented the Java
programming language, it
also invented a virtual
machine called the JVM (Java
Virtual Machine).
• The Java compiler produces
code for JVM, which then
typically is executed by a
software JVM interpreter.
• The advantage is that the
JVM code can be shipped
over the internet to any
computer that has a JVM
interpreter and run there.

PROF J.T.PATEL 79 PROF J.T.PATEL


Exokernels
 Rather than cloning (copying)the actual machine,
strategy is partitioning it (giving another a
each user resource). subset of
 For example one virtual machine might get disk the
blocks 0 to
1023, the next one might get block 1024 to 2047, and so on.
 Program running at the bottom layer (kernel mode) is
called the
exokernel.
 Its job is to allocate resources to virtual machines and then
continuously check to make sure no machine is trying to
use somebody else’s resources.
 The advantage of the exokernel scheme is that it saves a
layer of mapping.

PROF J.T.PATEL
8 PROF J.T.PATEL
0
Modules
 Many modern operating systems implement
loadable kernel modules
 Uses object-oriented approach
 Each core component is separate
 Each talks to the others over known interfaces
 Each is loadable as needed within the kernel
 Overall, similar to layers but with more flexible
 Linux, Solaris, etc
Solaris Modular Approach
Hybrid Systems

 Most modern operating systems are actually not one pure


model
 Hybrid combines multiple approaches to address
performance, security, usability needs
 Linux and Solaris kernels in kernel address space, so
monolithic, plus modular for dynamic loading of functionality
 Windows mostly monolithic, plus microkernel for different
subsystem personalities
 Apple Mac OS X hybrid, layered, Aqua UI plus Cocoa
programming environment
 Below is kernel consisting of Mach microkernel and BSD Unix
parts, plus I/O kit and dynamically loadable modules (called
kernel extensions)
Mac OS X Structure
graphical user interface
Aqua

application environments and services

Java Cocoa Quicktime BSD

kernel environment
BSD

Mach

I/O kit kernel extensions


iOS

 Apple mobile OS for iPhone, iPad


 Structured on Mac OS X, added functionality
 Does not run OS X applications natively
 Also runs on different CPU architecture (ARM vs.
Intel)
 Cocoa Touch Objective-C API for
developing apps
 Media services layer for graphics, audio,
video
 Core services provides cloud computing,
databases
 Core operating system, based on Mac OS X
kernel
Android
 Developed by Open Handset Alliance (mostly Google)
 Open Source
 Similar stack to IOS
 Based on Linux kernel but modified
 Provides process, memory, device-driver management
 Adds power management
 Runtime environment includes core set of libraries and
Dalvik virtual machine
 Apps developed in Java plus Android API
 Java class files compiled to Java bytecode then translated to executable than
runs in Dalvik VM
 Libraries include frameworks for web browser (webkit),
database (SQLite), multimedia, smaller libc
Android Architecture
Applications

Application Framework

Libraries Android runtime

SQLite openGL Core Libraries

surface media
Dalvik
manager framework
virtual machine
webkit libc

Linux kernel
Multiprogramming v/s Multiprocessing v/s
Multitasking

Multiprocessi Multitaskin
ng g

Multiprogrammi
ng

PROF J.T.PATEL 81 PROF J.T.PATEL


Multiprogramming v/s Multiprocessing v/s
Multitasking
Multiprogramming Multiprocessing Multitasking
The concurrent The availability of more The execution of more
residency of more than one processor per than one task
than one program in system, which can simultaneously is called
the main memory is execute several set of as multitasking.
called as instructions in parallel
multiprogramming. is called as
multiprocessing.
Number of processor: Number of Number of processor:
one processor: more one
than one
One process is More than one process One by one job is
executed at a time. can be executed at a being executed at a
time. time.

PROF J.T.PATEL 82 PROF J.T.PATEL


Time Sharing Operating System
• A time sharing operating system
allows many users to share the
computer resources
simultaneously.
• In other words, time sharing refers to
the allocation of computer
resources in time slots to several
programs simultaneously.
• For example a mainframe computer
that has many users logged on to it.
• Each user uses the resources of the
mainframe i.e. memory, CPU etc.

PROF J.T.PATEL 83 PROF J.T.PATEL


Parallel Processing Operating System
• Parallel Processing Operating Systems Multiprocessi
ng
are designed to speed up the
execution of programs by dividing
the program into multiple fragments
and processing these fragments
simultaneously.
• Such systems are multiprocessor
systems.
simultaneous use of multiple
• computer
Parallel systemsresources that can
deal with the
include a single computer with
multiple processors.

PROF J.T.PATEL 84 PROF J.T.PATEL


Distributed Operating System
• Distributed Operating System is a
model where distributed
applications are running on
multiple computers linked by
communications.

• A distributed operating system is


an extension of the network
operating system that supports
higher levels of communication
and integration of the machines
on the network.

PROF J.T.PATEL
885 PROF J.T.PATEL
1

You might also like