0% found this document useful (0 votes)
8 views

OS Module1 (1)

The document provides an overview of operating systems, detailing their types, objectives, functions, and processes. It covers various operating systems such as batch, time-sharing, distributed, network, and real-time systems, along with concepts of process management including states, control blocks, and interprocess communication. Additionally, it discusses process scheduling and the roles of different types of schedulers in managing system performance.

Uploaded by

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

OS Module1 (1)

The document provides an overview of operating systems, detailing their types, objectives, functions, and processes. It covers various operating systems such as batch, time-sharing, distributed, network, and real-time systems, along with concepts of process management including states, control blocks, and interprocess communication. Additionally, it discusses process scheduling and the roles of different types of schedulers in managing system performance.

Uploaded by

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

Operating System(1st module)

Operating system:types ,
objectives,functions, Process:States of
process,control block etc,Threads, Mutual
exclusion,Semaphore,Deadlock
Operating system
• An operating system (OS) is system software that
manages computer hardware, software resources, and
provides common services for computer programs.
• Or Os is an interface between user and computer.
Objectives of Operating System
• To make the computer system convenient to use in an
efficient manner.
• To hide the details of the hardware resources from the
users.
• To provide users a convenient interface to use the
computer system.
Abstract view of the components of a
computer system
Functions of OS
• Memory Management.
• Processor Management.
• Device Management.
• File Management.
• Security.
• Control over system performance.
• Job accounting.
• Error detecting aids.
Types of OS
• Batch Operating System
• Time-Sharing Operating Systems
• Distributed Operating System
• Network Operating System
• Real-Time Operating System
• Clustered Systems
• Multiprocessor System
• Desktop Systems
• Client –Server Systems.
Batch operating system

• Batch processing is a technique in which an Operating


System collects the programs and data together in a
batch before processing starts. An operating system
does the following activities related to batch processing
− The OS defines a job which has predefined sequence
of commands, programs and data as a single unit. This
type of operating system does not interact with the
computer directly. There is an operator which takes
similar jobs having same requirement and group them
into batches. It is the responsibility of operator to sort
the jobs with similar needs.
Time-Sharing Operating Systems
Each task is given some time to execute, so that
all the tasks work smoothly. Each user gets
time of CPU as they use single system. These
systems are also known as Multitasking
Systems. The task can be from single user or
from different users also. The time that each
task gets to execute is called quantum. After
this time interval is over OS switches over to
next task
Batch OS Time sharing OS
Distributed Operating System
These types of operating system is a recent advancement in the
world of computer technology and are being widely accepted all-
over the world and, that too, with a great pace. Various
autonomous interconnected computers communicate each other
using a shared communication network. Independent systems
possess their own memory unit and CPU. These are referred as
loosely coupled systems or distributed systems. These system’s
processors differ in size and function. The major benefit of
working with these types of operating system is that it is always
possible that one user can access the files or software which are
not actually present on his system but on some other system
connected within this network i.e., remote access is enabled
within the devices connected in that network.
Network Operating System

These systems run on a server and provide the capability to


manage data, users, groups, security, applications, and
other networking functions. These type of operating
systems allow shared access of files, printers, security,
applications, and other networking functions over a small
private network. One more important aspect of Network
Operating Systems is that all the users are well aware of the
underlying configuration, of all other users within the
network, their individual connections etc. and that’s why
these computers are popularly known as tightly coupled
systems.
Distributed OS & Network OS
Real time operating system
A real-time operating system (RTOS) is an operating
system (OS) intended to serve real-time
applications that process data as it comes in,
typically without buffer delays. Processing time
requirements (including any OS delay) are
measured in tenths of seconds or shorter
increments of time. They either are event-driven or
time-sharing. Event-driven systems switch between
tasks based on their priorities, while time-sharing
systems switch the task based on clock interrupts.
Types of real time system
• Real time system is defined as a system in which job has
deadline, job has to finished by the deadline (strictly finished). If
a result is delayed, huge loss may happen.
• 1. Hard Real Time System :
Hard real time is a system whose operation is incorrect whose
result is not produce according to time constraint.
Eg: Air Traffic Control, Medical System
• 2. Soft Real Time System
Soft real time system is a system whose operation is degrade if
results are not produce according to the specified timing
requirement.
Eg:
• 1. Multimedia Transmission and Reception 2. Computer Games
• Parallel operating systems are the interface between
parallel computers (or computer systems) and the
applications (parallel or not) that are executed on them.
They translate the hardware's capabilities into concepts
usable by programming languages.
• Clustered Operating Systems resembles parallel
operating systems as they possess multiple CPUs.
However, a cluster is created when two or more
computer systems are merged. Primarily, in a cluster,
computers share common storage, and the system
works together.
Processes
• A process is a program in execution. Process is
not as same as program code but a lot more
than it. A process is an 'active' entity as
opposed to program which is considered to be
a 'passive' entity. Attributes held by process
include hardware state, memory, CPU etc.
• Process memory is divided into four sections for efficient
working :
• The Text section is made up of the compiled program code,
read in from non-volatile storage when the program is
launched.
• The Data section is made up the global and static variables,
allocated and initialized prior to executing the main.
• The Heap is used for the dynamic memory allocation, and
is managed via calls to new, delete, malloc, free, etc.
• The Stack is used for local variables. Space on the stack is
reserved for local variables when they are declared.
Different Process States
• Processes in the operating system can be in any of the
following states:
• NEW- The process is being created.
• READY- The process is waiting to be assigned to a
processor.
• RUNNING- Instructions are being executed.
• WAITING- The process is waiting for some event to
occur(such as an I/O completion or reception of a
signal).
• TERMINATED- The process has finished execution.
PROCESS STATE DIAGRAM
Process control block(PCB)
• PCB contains many pieces of information associated with
a specific process.
• Process state:
• Program counter:
• CPU register:
• CPU-scheduling information:
• Memory management information:
• Accounting information:
• I/O status information:
Switching of CPU from process to process
Operations on process
• There are many operations that can be performed on processes. Some of these are
process creation, process preemption, process blocking, and process termination.
These are given in detail as follows −
• Process Creation
• Processes need to be created in the system for different operations. This can be done
by the following events −
• User request for process creation
• System initialization
• Execution of a process creation system call by a running process
• Batch job initialization
• A process may be created by another process using fork(). The creating process is called
the parent process and the created process is the child process. A child process can
have only one parent but a parent process may have many children. Both the parent
and child processes have the same memory image, open files, and environment strings.
However, they have distinct address spaces.
• A diagram that demonstrates process creation using fork() is as follows −
• Process Preemption
• An interrupt mechanism is used in preemption
that suspends the process executing currently
and the next process to execute is determined
by the short-term scheduler. Preemption
makes sure that all processes get some CPU
time for execution.
• A diagram that demonstrates process
preemption is as follows
• Process Blocking.
• The process is blocked if it is waiting for some
event to occur. This event may be I/O as the
I/O events are executed in the main memory
and don't require the processor. After the
event is complete, the process again goes to
the ready state.
• A diagram that demonstrates process blocking
is as follows.
• Process Termination
• After the process has completed the execution of its last
instruction, it is terminated. The resources held by a
process are released after it is terminated.
• A child process can be terminated by its parent process
if its task is no longer relevant. The child process sends
its status information to the parent process before it
terminates. Also, when a parent process is terminated,
its child processes are terminated as well as the child
processes cannot run if the parent processes are
terminated
Types of process
Processes that executing concurrently in the operating
system may be either independent processes or
cooperating processes
1.Independent process.
2.Cooperating process.
If a process cannot affect or be affected by the other
processes executing in the system then the process is said
to be independent. So any process that does not share any
data with any other process is independent
A process is said to be cooperating if it can affect or be
affected by the other processes executing in the system. So
it is clear that, any process which shares its data with other
processes is a cooperating process.
Cooperating processes
• There are many reasons for providing an environment that allows
process cooperation
• Information sharing - Since several users may be interested in the same
piece of information (for instance, a shared file), we must provide an
environment to allow concurrent access to such information.
• Computation speedup - If we want a particular task to run faster, we
must break it into subtasks, each of which will be executing in parallel
with the others.
• Modularity - We can construct the system in a modular fashion,
dividing the system functions into separate processes or threads.
• Convenience - Even an individual user can work on many tasks at the
same time like a user can be editing, listening to music, and compiling
in parallel.
Process communication.

• Interprocess communication is the mechanism


provided by the operating system that allows
processes to communicate with each other.
This communication could involve a process
letting another process know that some event
has occurred or transferring of data from one
process to another.
Interprocess communication
• Processes can then exchange their information
by reading and writing data to the shared
region. Cooperating processes need an inter-
process communication (IPC) mechanism that
will allow them to exchange data and
information. Two basic models of inter-
process communication are there:
1.Shared memory
2.Message passing.
Shared Memory Model
• Shared memory is the memory that can be simultaneously accessed
by multiple processes. This is done so that the processes can
communicate with each other. All POSIX systems, as well as
Windows operating systems use shared memory.
• Advantage of Shared Memory Model
• Memory communication is faster on the shared memory model as
compared to the message passing model on the same machine.
• Disadvantages of Shared Memory Model

• All the processes that use the shared memory model need to make
sure that they are not writing to the same memory location.
• Shared memory model may create problems such as synchronization
and memory protection that need to be addressed.
Message Passing Model
• Multiple processes can read and write data to the message
queue without being connected to each other. Messages
are stored on the queue until their recipient retrieves
them. Message queues are quite useful for interprocess
communication and are used by most operating systems.
• Advantage of Messaging Passing Model
• The message passing model is much easier to implement
than the shared memory model.
• Disadvantage of Messaging Passing Model
• The message passing model has slower communication
than the shared memory model because the connection
setup takes time.
Models of interprocess communication
Process scheduling
• The process scheduling is the activity of the process
manager that handles the removal of the running
process from the CPU and the selection of another
process on the basis of a particular strategy.
• Process scheduling is an essential part of a
Multiprogramming operating systems. Such
operating systems allow more than one process to
be loaded into the executable memory at a time
and the loaded process shares the CPU using time
multiplexing.
• Process Scheduling Queues
• The OS maintains all PCBs in Process Scheduling
Queues. The OS maintains a separate queue for
each of the process states and PCBs of all processes
in the same execution state are placed in the same
queue. When the state of a process is changed, its
PCB is unlinked from its current queue and moved
to its new state queue.
• The Operating System maintains three types
scheduling queues
1.Job queue − This queue keeps all the processes in the
system.
2.Ready queue − This queue keeps a set of all processes
residing in main memory, ready and waiting to execute. A
new process is always put in this queue.
3.Device queues − The processes which are blocked due to
unavailability of an I/O device constitute this queue.
• Schedulers are special system software which handle
process scheduling in various ways. Their main task is to
select the jobs to be submitted into the system and to
decide which process to run.
• Long Term Scheduler
• It is also called a job scheduler. A long-term scheduler
determines which programs are admitted to the system for
processing. It selects processes from the queue and loads them
into memory for execution. Process loads into the memory for
CPU scheduling.
• Short Term Scheduler
• It is also called as CPU scheduler. Its main objective is to
increase system performance in accordance with the chosen set
of criteria. It is the change of ready state to running state of the
process. CPU scheduler selects a process among the processes
that are ready to execute and allocates CPU to one of them.
• Medium Term Scheduler
• Medium-term scheduling is a part of
swapping. It removes the processes from the
memory. It reduces the degree of
multiprogramming. The medium-term
scheduler is in-charge of handling the
swapped out-processes.

You might also like