UNIt-1 OS
UNIt-1 OS
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.
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.
Memory management
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 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.
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
Operating system is responsible for I/O device management needed by various processes.
Network management
Batch
operating
system
Realtime Multiprogram
operating med operating
system system
Interactive Mutitasking
operating operating
system system
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
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
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.
Advantages
Disadvantages
Advantages
Multiprogramming supports multiple users.
In multiprogramming, more than one program resides in main memory thus memory is
optimally utilized.
. Disadvantages
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-
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
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.
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.
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.
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.
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.
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.
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.
Process Threads
Types of threads-
Resource sharing
Economy
Scalability
Responsiveness