You are on page 1of 47

UNIT 1

BASICS OF OPERATING
SYSTEM
BOSS(2CSE204)

Prof. Anil Prajapati


1
Layers of Computer System

2
What is OS?
A system software which Provides an interface
between applications and hardware
A program that controls the execution of
application programs
Operating systems control and support the
usage of computer systems
A Resource manager

3
The Operating System as a
User/Computer Interface

4
Objectives of OS
Convenience: An OS makes a computer more
convenient to use.
Efficiency: An OS allows the computer system
resources to be used in an efficient manner
Ability to evolve: An OS should be
constructed in such a way as to permit the
effective development of new system
functions without interfering with service

5
OS control and support the usage
of computer systems
Usage
Programs - use memory, CPU time, I/O devices
Programmers-use program development tools
such as debuggers, editors end users - use
application programs, e.g. Internet explorer
Computer system - hardware + software
Control- controls the usage of the computer
resources. resources managed by the OS:
Processors, Main memory, Secondary
Memory, Peripheral devices ,Information
6
Functions of OS
Program development OS assist the programmer in creating
programs by program development tools
Program execution OS handles memory, resources and
scheduling of user programs
Access to I/O devices
Controlled access to files- Protection of file access
Access control-provide protection of resources and data from
unauthorized users
Error detection and response
Accounting-usage statistics for various resources and monitor
performance parameters such as response time
7
Evolution of OS
Hardware upgrades
New types of hardware
New services
Bug Fixes

8
Evolution of OS(Cont..)

9
Types of OS
Simple Batch Systems
Multiprogramming
Multiprocessing
Multitasking
Multithreading
Time Sharing
Real Time
Network
Distributed
10
Simple Batch Systems

11
Simple Batch Systems(Cont..)
First batch OS was developed in the mid-
1950s by General Motors for use on an IBM
701.Subsequently developed in 1960
Idea behind the simple batch-processing
scheme is the use of a piece of software
known as the monitor
The user no longer has direct access to the
system

12
Simple Batch Systems(Cont..)
The user submits the job on cards or tape to a
computer operator, who batches the jobs
together sequentially and places the entire
batch on an input device, for use by the
monitor.
Each program is constructed to branch back to
the monitor when it completes processing

13
Simple Batch Systems(Cont..)
The problems with Batch:
Lack of interaction between the user and job
CPU is often idle, because the speed of the
mechanical I/O devices is slower than CPU
Difficult to provide the desired priority

14
Classification of OS(today)

15
Multiprogramming OS

16
Multiprogramming OS(Cont..)
Single program or Uniprogramming:
Underutilization of CPU and main memory

17
Multiprogramming OS(Cont..)
Multiple jobs available to the CPU (placed in
main memory) and a portion of one is executed
then a segment of another and so on
Multiple jobs are ready to run, the processor
must decide which one to run; this decision
requires an algorithm for scheduling
Extra CPU time to process on scheduling

18
Multiprogramming OS(Cont..)

19
Multiprogramming OS(Cont..)
Sample program execution attributes

20
Multitasking OS
Allowing a user to perform more than one computer
task (such as the operation of an application program)
at a time.
The operating system is able to keep track of where
you are in these tasks and go from one to the other
without losing information.
Microsoft Windows 2000 / 7 / 8 and Linux etc. are
examples of operating systems that can do multitasking
(almost all of today's operating systems can).
Ex: When you open your Web browser and then open
Word at the same time.

21
Multitasking OS
Multiple tasks share a common processing
resource (CPU and Memory). At any point in
time the CPU is executing one task only while
other tasks waiting their turn.
The illusion of parallelism is achieved when
the CPU is reassigned to another task (context
switch).

22
Multitasking Vs Multiprogramming
A task in a multitasking operating system is not a
whole application program(programs in modern
operating systems are divided into logical pages).
Task can also refer to a thread of execution when
one process is divided into sub tasks
Multitasking and multiprogramming refer to a
similar concept (sharing CPU time) where one is
used in modern operating systems while the
other is used in older operating systems.
Multitasking always refers to multiprogramming
but vice versa is not true.
23
Multiprocessing OS
More then one Processors(CPU) shared by
more then one tasks
System support more than one processor at
the same time
Each CPU sharing main memory and
peripherals, in order to simultaneously process
programs.

24
Multiprocessing OS(Cont..)

25
Multithreading OS
Thread is light weight process. Process divided
into more then one threads
Each thread belongs to exactly one process
and no thread can exist outside a process
Multiple methods of same
program(application) can be used at a time.
Ex: Microsoft word, WinAmp

26
Multithreading OS

27
Time Sharing OS
Processor(CPU) time is shared among multiple users.
In a time-sharing system, multiple users simultaneously
access the system through terminals, with the OS
interleaving the execution of each user program in a
short time or quantum of computation.
Thus, if there are n users actively requesting service at
one time, each user will only see on the average 1/ n of
the effective computer capacity.
However, given the relatively slow human reaction
time, the response time on a properly designed system
should be similar to that on a dedicated computer.
Better response time

28
Real Time OS
Quick and predictable response to events.
They either have an event-driven design or a time-
sharing one.
An event-driven system switches between tasks based
of their priorities while time-sharing operating systems
switch tasks based on clock interrupts.
Especially important in measurement and automation
systems.
Specialized scheduling algorithms are required.
Type: Hard real time , Soft real time

29
Network OS
An operating system oriented
to computer networking
OS allow shared file and printer
access among multiple computers in a
network, to enable the sharing of data,
users, groups, security, applications, and
other networking functions.
Examples: Novell NetWare, Windows
Server

30
Distributed OS
Distributed Operating System is a model
where distributed applications are running
on multiple computers linked by
communications.
These systems are referred as loosely
coupled systems where each processor has
its own local memory and processors
Advantage: Sharing of resources, Reliability,
Communication, Computation speedup

31
System call
The System call provides an interface to
the OS service
Types of system call:
1. Process control
2. File management
3. Device management
4. Information maintenance
5. Communications

32
System call-Example
C program invoking printf() library call, which calls write() system call

33
Shell
Shell is a program that provide user
interface with OS
Sometime called command line
interface(CLI)
In Linux: Bash(Bourne Shell)

34
Kernel
A kernel is core component of operating
system
Act as an interface between user
applications and the hardware
It loads first and its remain in main
memory
It manage all services of operating system
When process makes request of the
kernel, the request is called system call
35
Kernel(Cont..)

36
Architecture of OS
Kernel Mode
In Kernel mode, the executing code has complete and unrestricted
access to the underlying hardware.
It can execute any CPU instruction and reference any memory
address. Kernel mode is generally reserved for the lowest-level,
most trusted functions of the operating system.
Crashes in kernel mode; they will halt the entire PC
User Mode
In User mode, the executing code has no ability to directly access
hardware or reference memory.
Code running in user mode must delegate to system APIs to access
hardware or memory.
Crashes in user mode are always recoverable. Most of the code
running on your computer will execute in user mode.

37
38
Monolithic kernel
Commonly used kernel
All operating system services run along the
kernel
Providing powerful and rich hardware access
Example: Linux, Unix

39
Micro kernel
Basic services run in user space , this reduces
kernel code size
Increase security and stability of OS
Kernel only deal with critical activities, such as
controlling CPU and memory
Easy to extend , easier to port OS to new
architecture
Easy maintenance, more reliable
Example: minix

40
Layered operating system
The operating system is divided into a number
of layers (levels), each built on top of lower
layers. The bottom layer (layer 0), is the
hardware; the highest (layer N) is the user
interface.
The layers are selected such that each uses
functions (operations) and services of only
lower-level layers

41
Layered operating system(Cont..)

42
Exo kernel
Exo kernels are much smaller than a monolithic kernel. They give
more direct access to the hardware, thus removing most
abstractions

43
Virtual machine
A virtual machine (VM) is a software implementation
of a machine (a computer) that executes programs like
a physical machine
A virtual machine (VM) is a software program or
operating system that behave like a separate
computer, also capable of performing tasks such as
running applications and programs like a separate
computer
A virtual machine, usually known as a guest is created
within another computing environment referred as a
"host." Multiple virtual machines can exist within a
single host at one time

44
Virtual machine(Cont..)
Virtual machines can be divided into two categories:
System Virtual Machines:
A system platform that supports the sharing of the host
computer's physical resources between multiple virtual
machines, each running with its own copy of the operating
system.
The virtualization technique is provided by a software layer
known as a hypervisor, which can run either on bare hardware
or on top of an operating system.
Process Virtual Machine:
Designed to provide a platform-independent programming
environment that masks the information of the underlying
hardware or operating system and allows program execution
to take place in the same way on any given platform.
45
Virtual machine(Cont..)
Advantages
Allows multiple operating system environments on a
single physical computer without any intervention
Virtual machines are widely available and are easy to
manage and maintain.
Drawbacks
They are not as efficient as a physical computer
because the hardware resources are distributed in an
indirect way.
Multiple VMs running on a single physical machine can
deliver unstable performance
46
Virtual machine architecture

47

You might also like