OS Module1 (1)
OS Module1 (1)
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
• 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.