0% found this document useful (0 votes)
6 views13 pages

UNIt-1 OS

The document provides a comprehensive overview of operating systems, detailing their functions, goals, and classifications. It covers key topics such as resource management, process management, memory management, file system management, and security features. Additionally, it discusses various types of operating systems, including batch, multitasking, real-time, and distributed systems, along with their advantages and disadvantages.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views13 pages

UNIt-1 OS

The document provides a comprehensive overview of operating systems, detailing their functions, goals, and classifications. It covers key topics such as resource management, process management, memory management, file system management, and security features. Additionally, it discusses various types of operating systems, including batch, multitasking, real-time, and distributed systems, along with their advantages and disadvantages.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

Ms.

Anuksha Srivastava Subject code- KCS401


Assistant professor(CSE Department) Subject-Operating System

UNIT-1
Introduction
Operating System
Operating system is a system program that acts as an interface between hardware and user.
Operating system acts as a communication bridge (interface) between the user and computer
hardware. Operating system provide a platform on which a user can execute programs in a
convenient and efficient manner.

Goals of operating system


 Convenient
 Efficient

Function of operating system


Operating system is responsible for following activities.

Resource management
Operating system acts as the manager of these resources and allocates them to specific program
and user as necessary for their tasks. Therefore we can say an operating system is a resource
allocator. When parallel accessing happens in the Os means when multiple user are accessing the
system the Os works as resource manager its responsibility is to provide hardware to the user It
decreases the load in the system.

 Program execution
 I/O Operation
 File system manipulation
 Communication
 Error detection
 Resource allocation
 Protection
 Resource utilization

Process management

The process is a program under the execution the operating system manage all the processes so
that each process get the CPU for a specific time to execute itself and there will be less waiting
time for each process. It involves managing the creation, execution and termination of processes.

Shambhunath Institute of Engineering & Technology


Ms.Anuksha Srivastava Subject code- KCS401
Assistant professor(CSE Department) Subject-Operating System

 Providing mechanism for process communication


 Suspending and Resuming processes.
 Creating and deleting both user and system processes.
 Providing mechanism for process synchronization.
 Scheduling processes and threads on the CPU.

Memory management

Memory management is another critical functionality of an operating system it involves


managing the allocation and de -allocation of memory to processes. Memory management also
includes techniques such as paging, swapping and fragmentation management to optimize
memory usage and prevent crashes due to insufficient memory.

 Deciding which processes and data to move into and out of memory.
 Allocating and de-allocating memory space is needed.
 Keeping track of which parts of memory are currently being used by whom.

File system management

File system are responsible for organizing and storing data on disk drives.The OS provide a fule
system interface that allows application to read,write and manipulate file and directories.

 Creating and deleting files.


 Mapping files onto secondary storage.
 Supporting primitives for manipulating files and directories.
 Creating and deleting directories to organize files.
 Backing up files on stable storage.

Security and protection

The OS must protect against unauthorized access, viruses and other threats. OS used advanced
security features such as authentication , access control, encryption and firewall to ensure the
confidentiality integrity and availability of data and resources. Privacy is also provided by the
operating system by means of password so that unauthorized application can’t access program or
data.

Disk Management

 Storage allocation in disk


 Disk scheduling
 Free space management in disk.

I/O device management

Operating system is responsible for I/O device management needed by various processes.

Shambhunath Institute of Engineering & Technology


Ms.Anuksha Srivastava Subject code- KCS401
Assistant professor(CSE Department) Subject-Operating System

Network management

Operating System is responsible for network management.

Classification of Operating system-

Batch
operating
system

Realtime Multiprogram
operating med operating
system system

Interactive Mutitasking
operating operating
system system

Batch operating System


Batch operating system is a type of operating system which does not communicate or interact
with the computer directly. It is helpful when computer processes are very lengthy and time-
consuming. It speeds up the process by combining together similar types of jobs and runs them
as a group.

There is an operator in this kind of operating system which is used to club similar jobs having the
same requirement and is responsible to sort jobs with similar needs. Eg: BankSystem, Payroll
System, etc

 Batch means set of jobs with similar need.


 In Batch operating system Operator makes batch of jobs and loads it into punch card.
 Similar types of jobs batch together and execute at a time.

Shambhunath Institute of Engineering & Technology


Ms.Anuksha Srivastava Subject code- KCS401
Assistant professor(CSE Department) Subject-Operating System

Fig: Batch Operating system

Advantages
 Easy to estimate the time to complete a given job
 Easy to manage large repeated work
 Idle time is less
 Sharing by multiple users is possible
 Save time from Activities like loading compiler.
 No manual intervention by user is needed.

Disadvantages

 Limited memory
 Costly
 Difficult to debug

Multitasking and time sharing operating system


This type of operating system enables people who are in two different shells to use the computer
system at the same time. The processing time is termed time sharing as it is shared among
multiple users.

Each task is allotted some time (known as Quantum) to execute its work. After the allotted time
interval is over the operating system switches over to the next task.

 It is extension of multiprogramming system.


 In this system CPU switches between processes so quickly that it gives an illusion that all
executing at same time.
 This system can be used to handle multiple interactive tasks.

Shambhunath Institute of Engineering & Technology


Ms.Anuksha Srivastava Subject code- KCS401
Assistant professor(CSE Department) Subject-Operating System

Fig 2 Time sharing operating system

Advantages

 High CPU utilization


 Less waiting time, response time etc.
 Useful in current scenario when load is high.

Disadvantages

 Process scheduling is difficult.


 Main memory management is required
 Problem like memory fragmentation may occur.

Multiprogramming operating system


 Main objective of multiprogramming is to maximize CPU utilization.
 More than one process can reside in main memory which are ready to execute i.e more
than one process is in ready state.
 In this operating system is any running process perform I/O or other event which does not
require CPU, then instead of sitting idle, CPU perform context switching and picks
another process for execution.

Advantages
 Multiprogramming supports multiple users.
 In multiprogramming, more than one program resides in main memory thus memory is
optimally utilized.

Shambhunath Institute of Engineering & Technology


Ms.Anuksha Srivastava Subject code- KCS401
Assistant professor(CSE Department) Subject-Operating System

 In multiprogramming multiple programs are actively competing for resources resulting in


higher degree of resource utilization.
 Multiprogramming improve CPU utilization as it organizes a number of jobs where CPU
always has one to execute.

. Disadvantages

 It is difficult to program a system because of complicated schedule handling.


 Tracking all tasks/processes is sometimes difficult to handle.
 Due to high load of tasks, long time jobs have to wait long.

Real time OS
 A real time system has well defined ,fixed time constraints .Processing must be done with
in the defined constraints or the system will fail.
 A real time system functions correctly only if it returns the correct result with in its time
constraints.
 This system is used when we require response against input.
 In this system ,task is completed with specified time.
 It is classified into following two types-

Hard real time system


 In hard real time system task will be fail if response time against input is more than
specified time.
 Example – Flight Control Systems, Missile Guidance Systems ,Air traffic control
systems, Medical system.

Soft real time system


 In soft real time system inaccurate result will be found if response time against input is
more than specified time.
 Example - Mobile communication, Set-top boxes, DVD Players

Advantages
 Memory allocation is best managed in these types of systems.
 These types of systems are error-free.
 Focus on running applications and less importance to applications that are in the queue.
 Maximum utilization of devices and systems. Thus more output from all the resources .

Disadvantages

Shambhunath Institute of Engineering & Technology


Ms.Anuksha Srivastava Subject code- KCS401
Assistant professor(CSE Department) Subject-Operating System

 Very few tasks run simultaneously, and their concentration is very less on few
applications to avoid errors.

 The algorithms are very complex and difficult for the designer to write on.
 It needs specific device drivers and interrupts signals to respond earliest to interrupts.
 It is not good to set thread priority as these systems are very less prone to switching
tasks.

Interactive Operating system


Time sharing requires an interactive computer system, which provides direct communication
between the user and the system. The user gives instruction to the operating system or to a
program directly, using an input device such as a keyboard or a mouse and wait for immediate
results on an output device. Response time in interactive system should be short.

Distributed operating system


In a distributed system we have various system and all these system have their own memory,
CPU, secondary memory resource these system are connected to each other using a shared
communication network each system can perform its task individually.

Distributed operating system

Multiprocessing system-
 A system have multiple processor working in parallel that share the computer memory,
bus etc.
 A system is called multiprocessing system if two or more CPU with in a single computer
communicate with each other and share system bus memory and I/O devices.
 It provides true parallel execution of processes.

Type of Multiprocessing system

Asymmetric multiprocessing system


 In this system each processor is assigned a specific task .A master processor controls the
system. The other processors called slaves processors either look to master for instruction
of have predefined tasks i.e master slave relationship hold in this type of system.

Shambhunath Institute of Engineering & Technology


Ms.Anuksha Srivastava Subject code- KCS401
Assistant professor(CSE Department) Subject-Operating System

Symmetric multiprocessing system


 In this system each processor performs all tasks with in the operating system i.e all
processor are peers no slave relationship exists between processors.

Advantages
 Increased reliability
 Increased throughput

Disadvantages
 It is complex system.
 Process scheduling is difficult in this system.
 It required large size of main memory.
 Overhead reduces throughput.

Multiuser operating system


 Multiuser OS is a computer operating system that allows multiple users on different
computer or terminals to access a single system with one OS on it. These programs are
often quite complicated and must be able to properly manage the necessary tasks required
by the different users connected on it. The users will typically be at terminals or
computers that give them access to the system through a network, as well as other
machines on the system such as printers. Ex-Unix etc.

Operating system structure

Layered kernel
 In layered approach the Operating system consist of several layers where each layer has a
well defined functionality and each layer is designed,coded and tested independently.
 Lowest layer interacts and deal with underlying hardware and top most layer provides an
interface to the application programs and to the user processes.
 Each layer relies on the service of the layer below it.Communication take place between
adjacent layers.
 Each layers knows what services are provided by the layer above it but the details about
how the services are provided are hidden.
 Different layers can be file management layer, process management layer, memory
management layer etc.

Shambhunath Institute of Engineering & Technology


Ms.Anuksha Srivastava Subject code- KCS401
Assistant professor(CSE Department) Subject-Operating System

Layered operating system

Advantages
 Easier to add new feature or make change in one layer without affecting the other layer.
 Easy to add new layer when required.
 A particular layer can be debugged correctly or designed without affecting the other
layers.

Disadvantages
 If functionality of layers are not properly divided it may cause low system performance.
 Overhead incurred to maintain is more,if number of layers is more.

Re entrant kernel
 A re-entrant kernel is one that consists of executable code stored in memory such that
several processes can use this code at same time without hindering the working of other
processes. Thus in re-entrant kernel several processes may be executed in kernel mode at
same time.
 Since multiple concurrent process execute in kernel mode therefore they also share data
that may affect the functionality of other processes .Hence to avoid this condition re-
entrant function and locking mechanism is used.
 Re-entrant functions are one which allow processes to modify only the local variables
and do not affect global data variable.
 In locking mechanism several processes can execute re-entrant functions concurrently but
only one process at a time can execute non re-entrant functions, this will ensure that
global data is modified by only one process at a time and thus each process has same
copy of global data that is being shared among them.Ex-Unix

Monolithic kernel
 Monolithic means all in one piece.
 Entire Os placed in kernel space.
 All code runs in privileged mode.

Shambhunath Institute of Engineering & Technology


Ms.Anuksha Srivastava Subject code- KCS401
Assistant professor(CSE Department) Subject-Operating System

 Higher performance but higher risk of the system.


 In monolithic kernel user services and kernel services are implemented under same
address space, it increase size of the kernel thus increase size of operating system.

Advantage
 Execution is faster.

Disadvantage
 Size is larger.
 Hard to extend.
 Hard to port.
 More prone to error and bugs.

Micro kernel
 In this type of kernel user service and kernel services are implemented in different
address space, therefore it also reduces the size of kernel as well as the size of operating
system.
 In this architecture, only the most important services are present inside kernel and rest of
the operating system services are present inside system application program.
 Communication between client process and services running in user address space is
established through message passing thus reduce the speed of execution. Ex-Mac OS

Advantage
 Size is smaller.
 Easy to extend.
 Easy to port.
 Less prone o errors and bugs.

Disadvantage
 Execution is slower.

Shambhunath Institute of Engineering & Technology


Ms.Anuksha Srivastava Subject code- KCS401
Assistant professor(CSE Department) Subject-Operating System

Difference between Monolithic and micro kernel

Monolithic kernel Microkernel

1 In a monolithic kernel user services and In a microkernel user services and


kernel kernel Services are kept in
Services are kept in the same address separate address space.
space.
2 Large in size. Smaller in size
3 Execution speed is faster Execution speed is slower.

Hard to extend. Easily extensible.

4 The whole system will crash if one If one component fails, it does not
component affect
Fails. the working of the microkernel.

5 Fewer lines of code need to be written for More lines of code need to be written
a for a
monolithic kernel. Microkernel.

6 Debugging and management are complex Debugging and management are easy.

Multithreading
 Multithreading is a process of executing multiple threads simultaneously.
 A light weight process is called thread.
 A thread is a lightweight sub-process, the smallest unit of processing.
 Multiprocessing and multithreading, both are used to achieve multitasking.
 Multithreading is mostly used in games, animation, etc.

Difference between process and threads

Process Threads

Shambhunath Institute of Engineering & Technology


Ms.Anuksha Srivastava Subject code- KCS401
Assistant professor(CSE Department) Subject-Operating System

1 Process means any program is in Threads means a segment of a process.


execution.
2 The process takes more time to The threads take less time to terminate.
terminate.
3 It takes more time for creation. It takes less time for creation.
4 It also take more time for context It takes less time for context switching.
switching.
5 The process is isolated. Thread shared memory.
6 Process does not share data with each Thread share data with each other.
other.
7 Heavy weight process Light weight process
8 Process own their separate code Thread can share code segment, data
segment, data section file descriptor, section file descriptor, address space heap
address space, heap etc etc

Types of threads-

 User level threads


 Kernel level threads

Difference between user level and kernel level threads

User level threads Kernel level threads

1 Implementation is easy Implementation is difficult.


2 Operating system don’t require user Kernel level thread is recognized by OS
level thread
3 Context switch is fast because it require Context switch is slow because it
no hardware support and less requires hardware support and more
information to be stored during context information to be stored during context
switching. switching.
4 If one user level thread performs It one level thread perform blocking
blocking operation then entire process operation then another thread can
will be blocked. continue execution.

Benefits of multithreading programming

 Resource sharing
 Economy
 Scalability

Shambhunath Institute of Engineering & Technology


Ms.Anuksha Srivastava Subject code- KCS401
Assistant professor(CSE Department) Subject-Operating System

 Responsiveness

Shambhunath Institute of Engineering & Technology

You might also like