Professional Documents
Culture Documents
Greater Noida
Operating System
KCS401
Unit: 1
Operating System
Dr. C S Yadav
Prof and Head,
B Tech 4th Sem CSE
• Course Objective
• Course Outcome
• CO-PO matrix
• CO-PSO matrix
KCS401.1 3 3 2 2 1 2 - 2 3 2 2 3
KCS401.2 3 3 3 2 2 3 2 2 3 - 1 3
KCS401.3 3 3 2 2 2 2 2 2 2 3 1 3
KCS401.4 3 2 2 3 1 2 2 - 2 - 2 3
KCS401.5 3 1 2 2 2 2 - - 2 2 2 3
KCS401.1 2 1 2 2
KCS401.2 2 2 1 2
KCS401.3 2 3 3 2
KCS401.4 2 2 1 2
KCS401.5 2 2 2 2
Users
Shell
Kernel
Computer Hardware
Bare Machine Approach
➢Machine with no OS
➢Computer used to be programmed directly in
machine language, without any system
software approach
➢Program could be entered into RAM through
front-panel switches
➢Results of execution could be displayed on a
set of LEDs mounted on front cover itself
Serial Processing
➢The programs were executed strictly in a serial
manner, wherein program source code written
in assembly or high level language
Batch Processing
➢With the invention of hard disk drive, the
things were much better.
➢A memory-resident portion of the Batch OS,
called batch monitor. Batch monitor used to
read, interpret and execute these commands
automatically and group the pooled jobs into
separate batches placing similar jobs having
identical needs in the same batch, based on
pre-specified criteria
Multiprogramming
It refers to the concept, wherein more than
one programs used to be activated
concurrently; one of the active programs
being in ‘run-mode’ utilizing the CPU and
others utilizing the I/O devices at the same
time or being in a ‘wait state’ waiting for
resources to be available. This improved the
utilization of system resources, thus increasing
the system throughput.
Interactive Time Sharing System
➢Such systems, in addition to
multiprogramming, support some additional
features, like permitting user interaction with
the system, through OS commands.
➢Each interactive user is assigned a time-slice in
a round-robin fashion, during which it controls
the CPU. During the time-slice, the process
gets control of CPU and tries to complete its
computation.
Interactive Time Sharing System
If the computation is not completed during
the assigned time-slice, then the running
process is preempted; then it has to wait for
time-slice in the next cycle to resume
computation from where it was preempted.
The time slice cycle is so adjusted that each
user has a feel as if the CPU is assigned to it all
time.
Real Time OS
➢It refers to the environment of embedded
systems, with a very rigid requirement to
complete the processing of input data, in a pre-
specified time. The input data in such systems,
is invariably received from real-world sensors.
The outputs may be used to control some real-
world processes.
➢For example, an Air Defense System, receiving
information about aircraft movements from
radars and control weapons for the elimination
of hostile aircraft.
Hard Real Time OS
In Hard RTS, all critical tasks have to be
completed strictly within the specified time
limits. Not meeting the deadlines can be
catastrophic; like an embedded system
controlling the operation of a refinery. In such
systems, all code and data must be in
RAM/ROM.
Soft Real Time System
➢This is less restrictive type of the real time
system. If the input data is not processed
within specified time intervals, the results may
not be catastrophic, but the output may lose
its utility. The soft real time systems are not
suitable for industrial and defense use.
Distributed OS
➢A distributed OS provides easy sharing and
good utilization of resources located in all
computers in the system. To achieve this, it
permits a process to utilize the resources
located in a remote computer using the
networking component. It may also execute
processes of a program in different
computers.
Monolithic Kernel
➢ A monolithic kernel is a large single piece of
code, composed of several logically different
program pieces. It is one single large program
where all the functional components of the
operating system have access to all the data
and routines. (All those components reside in
the kernel space.) Such a program, with the
passage of time, grows more and more
complex, and becomes difficult to maintain
Monolithic Kernel
➢To avoid these problems, modern monolithic
kernels are structured in strictly functional
units. One unit cannot directly access data and
routines belonging to other units. The units
follow strict communication protocols to avail
services from one other. This is though purely
a programming paradigm, and whatever be
the internal structure, every part of the
operating system runs in the kernel mode on
behalf of the running process.
Microkernel
➢ A microkernel system is one that provides only the
bare minimum functionalities in the kernel, and
hence, is quite small and compact. The aim is a
kernel that provides the most basic functionalities
to construct the minimal operating system
services; a few inter-process communication and
synchronization primitives, a processor scheduler,
and an interrupt dispatcher. The remaining
functionalities are implemented through
autonomous processes called operating system
service processes or Servers.
Microkernel
➢The server programs reside outside
the kernel in different address space.
Thus, servers are not truly kernel
processes. They are just like any
other utility process. They run in the
user space, and not in kernel space.
Microkernel
➢ The user-level server processes provide services
that have been traditionally parts of monolithic
kernel executed by client processes when they
operate on the kernel space. They include services
such as memory manager, device driver, system
call handler, and others. The services offered by
the servers are called from the kernel via up calls.
➢ A client does not interact directly with a server.
Clients in fact are not aware of servers, and they
interact with the operating system via regular
system calls. This approach helps in making the
kernel smaller. It is easier to develop and test new
services or to modify existing services in such
systems.
Monolithic Vs Microkernel
➢The operating system development code base is
relatively easy to maintain for microkernel-
based systems. However, it leads to slower
execution of operating system services as there
are high overheads involved in frequent
communications among application processes
and service processes via the kernel space.
➢To obtain services from the operating system,
application processes communicate with the
kernel that channels the service requests to
appropriate service processes
Monolithic Vs Microkernel
➢ The replies to the service requests follow a similar
path in the reverse direction. This extra level of
indirect inter-process communications slows down
the speed of application execution considerably
whenever they need frequent operating system
services. Each service request leads to at least two
process switches: one from the client to the server
and the other from the server back to the client.
➢ Monolithic kernel is bulky, but ensures relatively
fast responses to service requests compared to
microkernel-based operating systems.
Monolithic Architecture
Applications
Monolithic Kernel
Hardware
Microkernel Architecture
Applications Server
Microkernel
Hardware
Reentrant Kernel
➢Several processes may be in kernel mode at
the same time. A reentrant kernel is able to
suspend the current running process even if
process is in the kernel mode
➢Unix kernels are reentrant kernel. This means
that several processes may be executing in
kernel mode at the same time.
Reentrant Kernel
➢A kernel that implements “reentrant routines”
are referred to as “Reentrant kernels”. When
two tasks can execute the function at the
same time without interfering with each
other, then the function is reentrant.
➢In non reentrant kernel mode, every single
process acts on its own set of memory
locations and thus cannot interfere with the
others
Reentrant Functions
➢Reentrant functions only modify local
variables but do not alter global data
structures. To provide reentrant kernel, the
kernel is implemented as a collection of
reentrant functions.
➢If a hardware interrupt occurs, a reentrant
kernel is able to suspend the current running
process even if that process is in kernel mode.
This capability is very important, because it
improves throughput of the device controllers
that issues interrupts.
Reentrant Kernel
➢Once a device has issued an
interrupt, it waits until the CPU
acknowledges it. If the kernel is able
to answer quickly, the device
controller will be able to perform
other tasks while the CPU handles
the interrupt.
System Call
➢System calls provide the interface between a
running program and the operating system.
Any single CPU computer can execute only
one instruction at a time. If process is running
a user program in user mode and needs a
system service, such as reading a data from a
file , it has to execute a trap instruction to
transfer control to the operating system.
System Call
➢Operating system provides services and system
call provides interface to these services. System
call is written in language C and C++ as
routines. System calls are performed in a series
of steps.
➢System call is a technique by which a program
executing in user mode can request the
kernel’s service.
Multiprocessor Operating Systems
➢ The Multiprocessor computer systems are
non-Von Neumann computer architectures.
They support more than one CPU, organized in
variety of configurations. The Operating
Systems designed for such systems are called
multiprocessor operating systems. Depending
upon the load, the os schedules the multiple
programs/tasks on different CPUs.
Multiprocessor Operating System
This activity of concurrent execution of
multiple programs on multiple CPUs is called
multiprocessing. Multiprocessing can be
divided into two types-
asymmetric multiprocessing and symmetric
multiprocessing
Asymmetric multiprocessing(ASMP)
➢In ASMP, the operating system sits on one CPU
or processor and other processors run user
programs/tasks.
➢Example OS/VS2 for IBM 370 was an
asymmetric multiprocessor operating system
Symmetric Multiprocessing
➢On the other hand, a symmetric
multiprocessing operating system runs on any
available processor or on all processors
simultaneously, along with user
programs/tasks
2 Process switching needs interaction with Thread switching does not need to interact
operating system. with operating system.
3 In multiple processing environments, each All threads can share same set of open files,
process executes the same code but has child processes.
its own memory and file resources.
4 Multiple processes without using threads Multiple threaded processes use fewer
use more resources. resources.
5 In multiple processes each process One thread can read, write or change
operates independently of the others. another thread's data.
Process
A Process is an instance of a program in
execution.
While a program is just a passive entity, a
process is an active entity performing the
intended functions of its related program.
Process Control Block(PCB)
The PCB refers to a data structure, created in the
system to maintain complete information about
a process. The PCB is kept constantly updated to
reflect the current status of the related process.
The intended contents of PCB vary from one OS
to another.
PCB
• Process id (unique)
• Process name
• Executable file name
• Saved registers (PC, SP, PSW)
• Memory Management Information
• Status of open files
• Accounting Information
• Pointer to previous PCB
• Pointer to next PCB
Simple Batch Systems (continued….)
Time-Sharing Systems
Dr C S Yadav KCS401 OS
3/4/2022 82
Unit Number:1