Unit - I: Introduc On To Opera NG System
Unit - I: Introduc On To Opera NG System
An opera ng system acts as an intermediary between the user of a computer and computer
hardware. Hence, An opera ng system is a system so ware that acts as an interface
between computer hardware and computer user. It also provides a basis for applica on
program. Examples : WINDOWS , LINUX , UNIX , ANDROID etc.
An opera ng system is so ware that manages computer hardware and so ware. The
hardware must provide appropriate mechanisms to ensure the correct opera on of
the computer system and to prevent user programs from interfering with the proper
opera on of the system.
The opera ng system (OS) is a program that runs at all mes on a computer. All other
programs, including applica on programs, run on top of the opera ng system.
It does assignment of resources like memory, processors and input / output devices
to different processes that need the resources. The assignment of resources has to
be fair and secure.
Resource Management: When mul ple processes run on the system and need
different resources like memory, input/output devices, the OS works as Resource
Manager, Its responsibility is to provide hardware to the user. It decreases the load in
the system.
Storage Management: The file system mechanism used for the management of the
secondary storage like Hard Disk. NIFS, CIFS, CFS, NFS, etc. are some file systems that
are used by opera ng systems to manage the storage. All the data is stored in various
tracks of Hard disks that are all managed by the storage manager.
Primary Goals
The primary goals of an opera ng system (OS) are to provide a easy to use and convenient
environment for execu ng user programs.
2. Program Execu on: It facilitates the execu on of user programs, providing the
necessary environment and services for them to run.
4. Security: The OS protects the system and user data from unauthorized access,
ensuring the confiden ality, integrity, and availability of informa on.
o The first opera ng system was introduced in 1956. It was a batch processing
system GM-NAA I/O (1956) that automated job handling.
o Timesharing systems, like CTSS (1961) and Mul cs (1969), allowed mul ple
users to interact with a single system.
o Graphical User Interfaces (GUIs) gained popularity with systems like Apple
Macintosh (1984) and Microso Windows (1985).
o Windows and Mac OS refined GUIs and gained widespread adop on.
o Cloud-based and virtualiza on technologies reshape compu ng, with OSs like
Windows Server and Linux driving innova on.
AI Integra on - (Ongoing)
With the growth of me, Ar ficial intelligence came into picture. Opera ng system
integrates features of AI technology like Siri, Google Assistant, and Alexa and became
more powerful and efficient in many way. These AI features with opera ng system
create a en re new feature like voice commands, predic ve text, and personalized
recommenda ons
Types of Opera ng system – Refer To Notebook (Advantages and Disadvantages are here)
Advantages Disadvantages
1. Be er CPU u liza on through job batching 1. No direct user interac on during execu on
4. Simple and organized job management 4. Not efficient for small tasks
Advantages Disadvantages
1. Keeps CPU busy with mul ple jobs 1. Memory management is complex
Advantages Disadvantages
2. Supports mul ple users simultaneously 2. System slows down with heavy load
Advantages Disadvantages
4. Used in automa on and control systems 4. Not suitable for general-purpose use
Advantages Disadvantages
1. Shares resources across mul ple systems 1. Communica on between systems is complex
Advantages Disadvantages
Advantages Disadvantages
3. Consumes very li le memory and power 3. Cannot be reused for other tasks
The OS coordinates the use of the hardware and applica on programs for various users. It
provides a pla orm for other applica on programs to work. The opera ng system is a set of
special programs that run on a computer system that allows it to work properly. It controls
input-output devices, execu on of programs, managing files, etc
1. Program Execu on
It is the Opera ng System that manages how a program is going to be executed. It loads
the program into the memory a er which it is executed. The order in which they are
executed depends on the CPU Scheduling Algorithms. A few are FCFS, SJF, etc. When the
program is in execu on, the Opera ng System also handles deadlock i.e. no two processes
come for execu on at the same me. The Opera ng System is responsible for the smooth
execu on of both user and system programs. The Opera ng System u lizes various
resources available for the efficient running of all types of func onali es.
Opera ng System manages the input-output opera ons and establishes communica on
between the user and device drivers. Device drivers are so ware that is associated with
hardware that is being managed by the OS so that the sync between the devices works
properly. It also provides access to input-output devices to a program when needed.
4. File Management
The opera ng system helps in managing files also. If a program needs access to a file, it is
the opera ng system that grants access. These permissions include read-only, read-write,
etc. It also provides a pla orm for the user to create and delete files. The Opera ng
System is responsible for making decisions regarding the storage of all types of data or
files, i.e, floppy disk/hard disk/pen drive, etc. The Opera ng System decides how the data
should be manipulated and stored.
5. Memory Management
Let's understand memory management by OS in simple way. Imagine a cricket team with
limited number of player . The team manager (OS) decide whether the upcoming player
will be in playing 11 ,playing 15 or will not be included in team , based on his performance
. In the same way, OS first check whether the upcoming program fulfil all requirement to
get memory space or not ,if all things good, it checks how much memory space will be
sufficient for program and then load the program into memory at certain loca on. And
thus , it prevents program from using unnecessary memory.
6. Process Management
Let's understand the process management in unique way. Imagine, our kitchen stove as
the (CPU) where all cooking(execu on) is really happen and chef as the (OS) who uses
kitchen-stove(CPU) to cook different dishes(program). The chef(OS) has to cook different
dishes(programs) so he ensure that any par cular dish(program) does not take long
me(unnecessary me) and all dishes(programs) gets a chance to cooked(execu on) . The
chef(OS) basically scheduled me for all dishes(programs) to run kitchen(all the system)
smoothly and thus cooked(execute) all the different dishes(programs) efficiently.
Security : OS keep our computer safe from an unauthorized user by adding security
layer to it. Basically, Security is nothing but just a layer of protec on which protect
computer from bad guys like viruses and hackers. OS provide us defenses
like firewalls and an -virus so ware and ensure good safety of computer and
personal informa on.
Privacy : OS give us facility to keep our essen al informa on hidden like having a
lock on our door, where only you can enter and other are not allowed . Basically , it
respect our secrets and provide us facility to keep it safe.
8. Resource Management
System resources are shared between various processes. It is the Opera ng system that
manages resource sharing. It also manages the CPU me among processes using CPU
Scheduling Algorithms. It also helps in the memory management of the system. It also
controls input-output devices. The OS also ensures the proper use of all the resources
available by deciding which resource to be used by whom.
9. User Interface
User interface is essen al and all opera ng systems provide it. Users either interacts with
the opera ng system through the command-line interface or graphical user interface or
GUI. The command interpreter executes the next user-specified command.
A GUI offers the user a mouse-based window and menu system as an interface.
10. Networking
The Opera ng System also handles the error occurring in the CPU, in Input-Output devices,
etc. It also ensures that an error does not occur frequently and fixes the errors. It also
prevents the process from coming to a deadlock. It also looks for any type of error or bugs
that can occur while any task. The well-secured OS some mes also acts as a
countermeasure for preven ng any sort of breach of the Computer System from any
external source and probably handling them.
Imagine traffic light as (OS), which indicates all the cars(programs) whether it should be
stop(red)=>(simple queue), start(yellow)=>(ready queue),move(green)=>(under execu on)
and this light (control) changes a er a certain interval of me at each side of the
road(computer system) so that the cars(program) from all side of road move smoothly
without traffic.
System Call
A system call is a programma c way in which a computer program requests a service from
the kernel of the opera ng system on which it is executed. A system call is a way for
programs to interact with the opera ng system. A computer program makes a system call
when it requests the opera ng system's kernel. System call provides the services of the
opera ng system to the user programs via the Applica on Program Interface(API). System
calls are the only entry points into the kernel system and are executed in kernel mode.
Interface: System calls provide a well-defined interface between user programs and
the opera ng system. Programs make requests by calling specific func ons and the
opera ng system responds by execu ng the requested service and returning a result.
Protec on: System calls are used to access privileged opera ons that are not
available to normal user programs. The opera ng system uses this privilege to
protect the system from malicious or unauthorized access.
Kernel Mode: When a system call is made, the program is temporarily switched from
user mode to kernel mode. In kernel mode, the program has access to all system
resources, including hardware, memory and other processes.
Context Switching: A system call requires a context switch, which involves saving the
state of the current process and switching to the kernel mode to execute the
requested service. This can introduce overhead, which can impact system
performance.
Error Handling: System calls can return error codes to indicate problems with the
requested service. Programs must check for these errors and handle them
appropriately.
Synchroniza on: System calls can be used to synchronize access to shared resources,
such as files or network connec ons. The opera ng system provides synchroniza on
mechanisms, such as locks or semaphores, to ensure that mul ple programs can
access these resources safely.
Users need special resources: Some mes programs need to do some special things
that can't be done without the permission of the OS like reading from a file, wri ng
to a file, ge ng any informa on from the hardware or reques ng a space in memory.
The program makes a system call request: There are special predefined instruc ons
to make a request to the opera ng system. These instruc ons are nothing but just a
"system call". The program uses these system calls in its code when needed.
Opera ng system sees the system call: When the OS sees the system call then it
recognizes that the program needs help at this me so it temporarily stops the
program execu on and gives all the control to a special part of itself called 'Kernel'.
Now 'Kernel' solves the need of the program.
The opera ng system performs the opera ons: Now the opera ng system performs
the opera on that is requested by the program. Example: reading content from a file
etc.
Opera ng system give control back to the program : A er performing the special
opera on, OS give control back to the program for further execu on of program.
Process Control: end, abort, create, terminate, allocate and free memory.
Device Management
2. Enable user programs to perform opera ons like file and device handling.
U lity Programs
They are a type of system so ware that are designed to help users manage, maintain, and
op mize their computer systems. U lity so ware includes a wide range of tools and
applica ons that perform specific tasks to improve the performance, security, and
func onality of a computer system. Applica on programs are large in comparison to u lity
programs hence they are smaller in size than u lity programs.
Here are the some Examples of U lity Programs are given below -
1. An virus So ware
It is used to protect a computer from the virus. It detects a virus and no fy the user and take
ac on to secure the computer. The virus are kept in different loca on called vault where it
has different file system due to which virus effect it. User can itself instruct an virus to
delete malicious program, put it in vault or even ignore it. These days most come in GUI
form. The first an virus program appeared in 1987 with the introduc on of an an virus
program from G Data So ware for the Atari ST. Later in the same year, VirusScan was
introduced by John McAfee, which later became the McAfee an virus program.
Some examples of An virus So wares are:
Windows Defender
AVG
AVAST
MCAFEE
The so ware is used to manage files stored in a file system. It can be used to create, group
file. Like windows file explorer is a file management tool.
File system (like FAT32, NTFS) should not be confused with File management tool former is a
data structure used to store file in an OS while later is used to perform task on file stored in
the file system.
macOS Finder.
Directory Opus.
Dolphin in KDE.
3. Compression Tool
These tool are used to reduce the size of a file based on the
selected algorithm. Most opera ng systems include tools for compressing and
uncompressing files. Linux has tools for both .tar.gz and .zip. Other compressed files, like .7z
and .rar, require a third-party compression u lity to be installed.
WinAce
WinZip
WinRAR
7-Zip
PKZIP
Piriform CCleaner
Razer Cortex
6. Disk Defragmenter
MyDefrag
Perfect disk
Defraggler
1. System maintenance: U lity so ware provides a range of tools and applica ons that
help users manage and maintain their computer systems. By regularly using these
tools, users can op mize their system performance, remove unnecessary files and
programs, and keep their system running smoothly.
2. Security: U lity so ware includes tools such as an virus and encryp on so ware
that help users protect their computer systems from security threats such as viruses,
malware, and unauthorized access.
3. Efficiency: U lity so ware can help users op mize their system performance and
reduce the me and effort required to perform rou ne tasks such as disk cleanup,
file compression, and data backup.
4. Data recovery: U lity so ware includes backup and recovery tools that can help
users recover lost or deleted data in the event of a system failure or data loss.
5. User experience: U lity so ware can help users customize their system se ngs and
preferences to enhance their overall user experience.
Advantages
Disadvantages
UNIT – II
File : A computer file is defined as a medium used for saving and managing data in the
computer system. The data stored in the computer system is completely in digital format,
although there can be various types of files that help us to store the data.
FAT (File Alloca on Table): An older file system used by older versions of Windows
and other opera ng systems.
NTFS (New Technology File System): A modern file system used by Windows. It
supports features such as file and folder permissions, compression, and encryp on.
ext (Extended File System): A file system commonly used on Linux and Unix-based
opera ng systems.
APFS (Apple File System): A new file system introduced by Apple for their Macs and
iOS devices.
The name of the file is divided into two parts as shown below:
Name
The collec on of files is a file directory. The directory contains informa on about the files,
including a ributes, loca on, and ownership. Much of this informa on, especially that is
concerned with storage, is managed by the opera ng system. The directory is itself a file,
accessible by various file management rou nes.
Below are informa on contained in a device directory.
Name Type
Address Current length
Maximum length Date last accessed
Date last updated Owner id Protec on informa on
Create a file
Delete a file
List a directory
Rename a file
Defini on:
From the user's perspec ve, the file system is a logical and user-friendly interface that
allows easy access, crea on, manipula on, and organiza on of data without worrying about
how data is stored or retrieved physically.
Main Features:
Feature Descrip on
Naming and Users iden fy files using file names, extensions, and directories (e.g.,
Access mydoc.txt in C:\Documents).
Users perform ac ons like create, open, read, write, edit, copy, delete,
File Opera ons
move, etc.
Access Control Files have permissions (read, write, execute) to ensure data security.
Abstrac on Users are unaware of physical storage details such as blocks or sectors.
Access control defines who can do what with a file (owner, group, others).
No concern about internal storage structures like file alloca on tables or inode
tables.
Defini on:
From the system programmer’s (or OS designer’s) view, the file system is a complex system
of data structures, algorithms, and access protocols that manages how files are stored,
indexed, and retrieved on physical storage devices.
Main Components:
Component Descrip on
File Control Block A data structure used by OS to store metadata (permissions, size,
(FCB) mestamps, pointers).
Directory Structure Organizes FCBs in a way that supports hierarchical folder systems.
File Alloca on Methods like con guous, linked, indexed alloca on used to manage
Methods space.
Free Space
Tracks unallocated blocks using bitmaps, linked lists, or tables.
Management
I/O Control Handles read/write requests, buffering, caching, and error handling.
Inodes (Unix/Linux) A data structure that holds metadata and pointers to file blocks.
Handles file descriptors, access control lists (ACLs), and device drivers.
Ensures efficient space alloca on using file alloca on tables (FAT), inodes, or extent-
based systems.
Deals with disk layout and interacts directly with storage hardware via low-level
instruc ons.
There are several types of file alloca on methods. These are men oned below.
Indexed Alloca on
A single con nuous set of blocks is allocated to a file at the me of file crea on. Thus, this is
a pre-alloca on strategy, using variable size por ons. The file alloca on table needs just a
single entry for each file, showing the star ng block and the length of the file. This method is
best from the point of view of the individual sequen al file. Mul ple blocks can be read in at
a me to improve I/O performance for sequen al processing. It is also easy to retrieve a
single block. For example, if a file starts at block b, and the ith block of the file is wanted, its
loca on on secondary storage is simply b+i-1.
Alloca on is on an individual block basis. Each block contains a pointer to the next block in
the chain. Again the file table needs just a single entry for each file, showing the star ng
block and the length of the file. Although pre-alloca on is possible, it is more common
simply to allocate blocks as needed. Any free block can be added to the chain. The blocks
need not be con nuous. An increase in file size is always possible if a free disk block is
available. There is no external fragmenta on because only one block at a me is needed but
there can be internal fragmenta on but it exists only in the last disk block of the file.
Indexed Alloca on
It addresses many of the problems of con guous and chained alloca on. In this case, the file
alloca on table contains a separate one-level index for each file: The index has one entry for
each block allocated to the file. The alloca on may be on the basis of fixed-size blocks or
variable-sized blocks. Alloca on by blocks eliminates external fragmenta on, whereas
alloca on by variable-size blocks improves locality. This alloca on technique supports both
sequen al and direct access to the file and thus is the most popular form of file alloca on.
File Protec on
File protec on in an opera ng system is the process of securing files from unauthorized
access, altera on, or dele on. It is cri cal for data security and ensures that sensi ve
informa on remains confiden al and secure. Opera ng systems provide various
mechanisms and techniques such as file permissions, encryp on, access control lists,
audi ng, and physical file security to protect files. Proper file protec on involves user
authen ca on, authoriza on, access control, encryp on, and audi ng. Ongoing updates and
patches are also necessary to prevent security breaches. File protec on in an opera ng
system is essen al to maintain data security and minimize the risk of data breaches and
other security incidents.
File protec on is an essen al component of modern opera ng systems, ensuring that files
are secured from unauthorized access, altera on, or dele on. In this context, there are
several types of file protec on mechanisms used in opera ng systems to provide robust data
security.
File Permissions ? File permissions are a basic form of file protec on that controls
access to files by se ng permissions for users and groups. File permissions allow the
system administrator to assign specific access rights to users and groups, which can
include read, write, and execute privileges. These access rights can be assigned at the
file or directory level, allowing users and groups to access specific files or directories
as needed. File permissions can be modified by the system administrator at any me
to adjust access privileges, which helps to prevent unauthorized access.
Access Control Lists (ACLs) ? Access control lists (ACLs) are lists of permissions
a ached to files and directories that define which users or groups have access to
them and what ac ons they can perform on them. ACLs can be more granular than
file permissions, allowing the system administrator to specify exactly which users or
groups can access specific files or directories. ACLs can also be used to grant or deny
specific permissions, such as read, write, or execute privileges, to individual users or
groups.
Audi ng and Logging ? Audi ng and logging are mechanisms used to track and
monitor file access, changes, and dele ons. It involves crea ng a record of all file
access and changes, including who accessed the file, what ac ons were performed,
and when they were performed. Audi ng and logging can help to detect and prevent
unauthorized access and can also provide an audit trail for compliance purposes.
Physical File Security ? Physical file security involves protec ng files from physical
damage or the . It includes measures such as file storage and access control, backup
and recovery, and physical security best prac ces. Physical file security is essen al for
ensuring the integrity and availability of cri cal data, as well as compliance with
regulatory requirements.
Advantages Disadvantages
Enables controlled sharing among users Users may need technical knowledge
(e.g., read-only access) to set proper permissions
Helps in audi ng and accountability (via Can lead to reduced performance due
logs and permissions) to added security layers
Disk scheduling algorithms are crucial in managing how data is read from and wri en to a
computer's hard disk. These algorithms help determine the order in which disk read and
write requests are processed, significantly impac ng the speed and efficiency of data access.
Maximize Throughput
Minimize Latency
Fairness
Advantages of FCFS
No indefinite postponement
Disadvantages of FCFS
In SSTF (Shortest Seek Time First), requests having the shortest seek me are executed first.
So, the seek me of every request is calculated in advance in the queue and then they are
scheduled according to their calculated seek me. As a result, the request near the disk arm
will get executed first. SSTF is certainly an improvement over FCFS as it decreases the
average response me and increases the throughput of the system.
Throughput increases
In the SCAN algorithm the disk arm moves in a par cular direc on and services the requests
coming in its path and a er reaching the end of the disk, it reverses its direc on and again
services the request arriving in its path. So, this algorithm works as an elevator and is hence
also known as an elevator algorithm. As a result, the requests at the midrange are serviced
more and those arriving behind the disk arm will have to wait.
This algorithm is not fair because it causes a long wai ng me for the cylinders just
visited by the head.
It causes the head to move ll the end of the disk in this way the requests arriving
ahead of the arm posi on would get immediate service but some other requests that
arrive behind the arm posi on will have to wait for the request to complete.
C-SCAN
In the SCAN algorithm, the disk arm again scans the path that has been scanned, a er
reversing its direc on. So, it may be possible that too many requests are wai ng at the other
end or there may be zero or few requests pending at the scanned area.
These situa ons are avoided in the CSCAN algorithm in which the disk arm instead of
reversing its direc on goes to the other end of the disk and starts servicing the requests
from there. So, the disk arm moves in a circular fashion and this algorithm is also similar to
the SCAN algorithm hence it is known as C-SCAN (Circular SCAN).
LOOK
LOOK Algorithm is similar to the SCAN disk scheduling algorithm except for the difference
that the disk arm in spite of going to the end of the disk goes only to the last request to be
serviced in front of the head and then reverses its direc on from there only. Thus it prevents
the extra delay which occurred due to unnecessary traversal to the end of the disk.
C-LOOK
As LOOK is similar to the SCAN algorithm, in a similar way, C-LOOK is similar to the CSCAN
disk scheduling algorithm. In CLOOK, the disk arm in spite of going to the end goes only to
the last request to be serviced in front of the head and then from there goes to the other
end’s last request. Thus, it also prevents the extra delay which occurred due to unnecessary
traversal to the end of the disk.
More efficient than SCAN in head Can cause delay to newly arrived requests
movement. near start.
Algorithm Advantages Disadvantages
System Calls for File Management, Disk Organiza on, Tape Organiza on – Refer to
notebook
UNIT – III
Process in Opera ng System
A process is a program in execu on. For example, when we write a program in C or C++ and
compile it, the compiler creates binary code. The original code and binary code are both
programs. When we actually run the binary code, it becomes a process.
A single program can create many processes when run mul ple mes; for example,
when we open a .exe or binary file mul ple mes, mul ple instances begin (mul ple
processes are created). .
A process in memory is divided into several dis nct sec ons, each serving a different
purpose. Here's how a process typically looks in memory.
Text Sec on: A text or code segment contains executable instruc ons. It is typically a
read only sec on
Stack: The stack contains temporary data, such as func on parameters, returns
addresses, and local variables.
Heap Sec on: Dynamically memory allocated to process during its run me.
A ributes of a Process
A process has several important a ributes that help the opera ng system manage and
control it. These a ributes are stored in a structure called the Process Control Block
(PCB) (some mes called a task control block). The PCB keeps all the key informa on about
the process, including:
1. Process ID (PID): A unique number assigned to each process so the opera ng system
can iden fy it.
2. Process State: This shows the current status of the process, like whether it is running,
wai ng, or ready to execute.
3. Priority and other CPU Scheduling Informa on: Data that helps the opera ng
system decide which process should run next, like priority levels and pointers to
scheduling queues.
4. I/O Informa on: Informa on about input/output devices the process is using.
5. File Descriptors: Informa on about open files files and network connec ons.
6. Accoun ng Informa on: Tracks how long the process has run, the amount of CPU
me used, and other resource usage data.
7. Memory Management Informa on: Details about the memory space allocated to
the process, including where it is loaded in memory and the structure of its memory
layout (stack, heap, etc.).
Scheduling Concepts
CPU scheduling is a process used by the opera ng system to decide which task or process
gets to use the CPU at a par cular me. This is important because a CPU can only handle
one task at a me, but there are usually many tasks that need to be processed. The
following are different purposes of a CPU scheduling me.
In Mul programming, if the long-term scheduler selects mul ple I/O binding processes then
most of the me, the CPU remains idle. The func on of an effec ve program is to improve
resource u liza on.
Arrival Time: The me at which the process arrives in the ready queue.
Comple on Time: The me at which the process completes its execu on.
Turn Around Time: Time Difference between comple on me and arrival me.
Wai ng Time(W.T): Time Difference between turn around me and burst me.
Different CPU Scheduling algorithms have different structures and the choice of a
par cular algorithm depends on a variety of factors.
CPU U liza on: The main purpose of any CPU algorithm is to keep the CPU as busy as
possible. Theore cally, CPU usage can range from 0 to 100 but in a real- me system,
it varies from 40 to 90 percent depending on the system load.
Turn Round Time: For a par cular process, the important condi ons are how long it
takes to perform that process. The me elapsed from the me of process delivery to
the me of comple on is known as the conversion me. Conversion me is the
amount of me spent wai ng for memory access, wai ng in line, using CPU and
wai ng for I/O.
Wai ng Time: The Scheduling algorithm does not affect the me required to
complete the process once it has started performing. It only affects the wai ng me
of the process i.e. the me spent in the wai ng process in the ready queue.
Response Time: In a collabora ve system, turn around me is not the best op on.
The process may produce something early and con nue to compu ng the new
results while the previous results are released to the user. Therefore another method
is the me taken in the submission of the applica on process un l the first response
is issued. This measure is called response me.
Process scheduling is the ac vity of the process manager that handles the removal of the
running process from the CPU and the selec on of another process based on a par cular
strategy. Throughout its life me, a process moves between various scheduling queues, such
as the ready queue, wai ng queue or devices queue.
Long Term Scheduler loads a process from disk to main memory for execu on. The new
process to the 'Ready State'.
It controls the Degree of Mul -programming, i.e., the number of processes present
in a ready state or in main memory at any point in me.
It is important that the long-term scheduler make a careful selec on of both I/O and
CPU-bound processes. I/O-bound tasks are which use much of their me in input and
output opera ons while CPU-bound processes are which spend their me on the
CPU. The job scheduler increases efficiency by maintaining a balance between the
two.
In some systems, the long-term scheduler might not even exist. For example, in me-
sharing systems like Microso Windows, there is usually no long-term scheduler.
Instead, every new process is directly added to memory for the short-term scheduler
to handle.
CPU Scheduler is responsible for selec ng one process from the ready state for running (or
assigning CPU to it).
STS (Short Term Scheduler) must select a new process for the CPU frequently to
avoid starva on.
The CPU scheduler uses different scheduling algorithms to balance the alloca on of
CPU me.
The dispatcher is responsible for loading the process selected by the Short-term scheduler on
the CPU (Ready to Running State). Context switching is done by the dispatcher only. A
dispatcher does the following work:
Saving context (process control block) of previously running process if not finished.
3. Medium-Term Scheduler
Medium Term Scheduler (MTS) is responsible for moving a process from memory to disk (or
swapping).
When needed, it brings process back into memory and pick up right where it le off.
A thread is a single sequence stream within a process. Threads are also called lightweight
processes as they possess some of the proper es of processes. Each thread belongs to
exactly one process.
In an opera ng system that supports mul threading, the process can consist of many
threads. But threads can be effec ve only if the CPU is more than 1 otherwise two
threads have to context switch for that single CPU.
All threads belonging to the same process share - code sec on, data sec on, and OS
resources (e.g. open files and signals)
But each thread has its own (thread control block) - thread ID, program counter,
register set, and a stack
Any opera ng system process can execute a thread. we can say that single process
can have mul ple threads.
Threads run in concurrent manner that improves the applica on performance. Each
such thread has its own CPU state and stack, but they share the address space of the
process and the environment. For example, when we work on Microso
Word or Google Docs, we no ce that while we are typing, mul ple things happen
together (forma ng is applied, page is changed and auto save happens).
Threads can share common data so they do not need to use inter-process
communica on. Like the processes, threads also have states like ready, execu ng,
blocked, etc.
Priority can be assigned to the threads just like the process, and the highest priority
thread is scheduled first.
Each thread has its own Thread Control Block (TCB). Like the process, a context
switch occurs for the thread, and register contents are saved in (TCB). As threads
share the same address space and resources, synchroniza on is also required for the
various ac vi es of the thread.
Components of Threads
Stack Space: Stores local variables, func on calls, and return addresses specific to
the thread.
Register Set: Hold temporary data and intermediate results for the thread's
execu on.
Program Counter: Tracks the current instruc on being executed by the thread.
User Level Thread is a type of thread that is not created using system calls. The kernel has no
work in the management of user-level threads. User-level threads can be easily
implemented by the user. In case when user-level threads are single-handed processes,
kernel-level thread manages them. Let's look at the advantages and disadvantages of User-
Level Thread.
Because of the presence of only Program Counter, Register Set, and Stack Space, it
has a simple representa on.
If a user-level thread makes a blocking system call, the en re process (and all its
threads) is blocked, reducing efficiency.
User-level thread scheduling is managed by the applica on, which can become
complex and may not be as op mized as kernel-level scheduling.
A kernel Level Thread is a type of thread that can recognize the Opera ng system easily.
Kernel Level Threads has its own thread table where it keeps track of the system. The
opera ng System Kernel helps in managing threads. Kernel Threads have somehow longer
context switching me. Kernel helps in the management of threads.
Kernel-level threads can run on mul ple processors or cores simultaneously, enabling
be er u liza on of mul core systems.
The kernel is aware of all threads, allowing it to manage and schedule them
effec vely across available resources.
Applica ons that block frequency are to be handled by the Kernel-Level Threads.
The kernel can distribute threads across CPUs, ensuring op mal load balancing and
system performance.
Managing kernel-level threads involves frequent system calls and kernel interac ons,
leading to increased CPU overhead.
A large number of threads may overload the kernel scheduler, leading to poten al
performance degrada on in systems with many threads.
A process has its own Thread has Parents' PCB, its own Thread
Process Control Block, Stack, Control Block, and Stack and common
and Address Space. Address space.
In a Distributed Opera ng System, mul ple CPUs are u lized, but for end-users, it appears as
a typical centralized opera ng system. It enables the sharing of various resources such as
CPUs, disks, network interfaces, nodes, and computers across different sites, thereby
expanding the available data within the en re system.
Effec ve communica on channels like high-speed buses and telephone lines connect all
processors, each equipped with its own local memory and other neighboring processors.
Due to its characteris cs, a distributed opera ng system is classified as a loosely coupled
system. It encompasses mul ple computers, nodes, and sites, all interconnected
through LAN/WAN lines. The ability of a Distributed OS to share processing resources
and I/O files while providing users with a virtual machine abstrac on is an important feature.
There are many types of Distributed Opera ng System, some of them are as follows:
1. Client-Server Systems
This model allows for scalable resource u liza on, efficient sharing, modular
development, centralized control, and fault tolerance.
2. Peer-to-Peer(P2P) Systems
They support efficient collabora on, scalability, and resilience to failures without
relying on central servers.
This model facilitates distributed data sharing, content distribu on, and compu ng
tasks, making it suitable for applica ons like file sharing, content delivery, and
blockchain networks.
3. Middleware
4. Three-Tier
In a distributed opera ng system, the three- er architecture divides tasks into presenta on,
logic, and data layers. The presenta on er, comprising client machines or devices, handles
user interac on. The logic er, distributed across mul ple nodes or servers, executes
processing logic and coordinates system func ons.
The data er manages storage and retrieval opera ons, o en employing distributed
databases or file systems across mul ple nodes.
This modular approach enables scalability, fault tolerance, and efficient resource
u liza on, making it ideal for distributed compu ng environments.
5. N-Tier
In an N- er architecture, applica ons are structured into mul ple ers or layers beyond the
tradi onal three- er model. Each er performs specific func ons, such as presenta on,
logic, data processing, and storage, with the flexibility to add more ers as needed. In a
distributed opera ng system, this architecture enables complex applica ons to be divided
into modular components distributed across mul ple nodes or servers.
Each er can scale independently, promo ng efficient resource u liza on, fault
tolerance, and maintainability.
This approach is commonly used in large-scale enterprise systems, web applica ons,
and distributed systems requiring high availability and scalability.
o These opera ng systems manage communica on, coordina on, and data
processing tasks across distributed IoT devices, enabling applica ons such as
smart home automa on, industrial monitoring, and environmental sensing.
Distributed Databases:
o These opera ng systems manage distributed caching, content replica on, and
request rou ng across a network of edge servers, reducing latency and
improving performance for users accessing web content from diverse
geographic loca ons.
o These systems support scien fic simula ons, computa onal modeling, and
data-intensive computa ons by distribu ng workloads and managing
communica on between nodes efficiently.
o These file systems enable distributed storage and retrieval of large-scale data
sets across clusters of machines, suppor ng applica ons such as big data
analy cs, data processing, and content storage.
Solaris: The SUN mul processor worksta ons are the intended use for it.
OSF/1: The Open Founda on So ware Company designed it, and it works with Unix.
Micros: All nodes in the system are assigned work by the MICROS opera ng system,
which also guarantees a balanced data load.
Locus: It can be viewed simultaneously from both local and distant files without any
loca on restric ons.
Protec on and security are crucial aspects of a Distributed Opera ng System, especially in
organiza onal se ngs. Measures are employed to safeguard the system from poten al
damage or loss caused by external sources. Various security measures can be implemented,
including authen ca on methods such as username/password and user key. One Time
Password (OTP) is also commonly u lized in distributed OS security applica ons.
It can increase data availability throughout the system by sharing all resources (CPU,
disk, network interface, nodes, computers, and so on) between sites.
Because all data is replicated across all sites, it reduces the probability of data
corrup on because users can access data from another opera ng site in the event
that one site fails.
Since it may be accessible from both local and remote sites, it is an open system.
The majority of distributed systems are composed of mul ple nodes that work
together to provide fault tolerance. Even if one machine malfunc ons, the system
s ll func ons.
Which tasks need to be completed, when they need to be completed, and where
they need to be completed must be determined by the system. The restric ons of a
scheduler might result in unpredictable run mes and unused hardware.
Since the nodes and connec ons in DOS need to be secured, it is challenging to
establish sufficient security.
Compared to other systems, the underlying so ware is incredibly sophis cated and
poorly understood.
Compiling, analyzing, displaying, and keeping track of hardware u liza on metrics for
large clusters may be quite challenging.
The basic defini on of an opera ng system is that the opera ng system is the interface
between the computer hardware and the user. In daily life, we use the opera ng system on
our devices which provides a good GUI, and many more features. Similarly, a network
opera ng system(NOS) is so ware that connects mul ple devices and computers on the
network and allows them to share resources on the network. Let's see what are the
func ons of the network opera ng system.
There are mainly two types of networks, one is peer-to-peer and another is client/server.
Now let's see each type one by one.
Peer to Peer: Peer-to-peer network opera ng systems allow the sharing of resources
and files with small-sized networks and having fewer resources. In general, peer-to-
peer network opera ng systems are used on LAN.
Let's see what are the func ons of the network opera ng system.
Provide good security by using func onality like user authen ca on and access
control.
Inter-networking.
Now let's see what are the examples of network opera ng systems.
UNIX/Linux
Ar so ’s LANtas c
Banyan’s VINES
A mul processing opera ng system is defined as a type of opera ng system that makes use
of more than one CPU to improve performance. Mul ple processors work parallelly in mul -
processing opera ng systems to perform the given task. All the available processors are
connected to peripheral devices, computer buses, physical memory, and clocks. The main
aim of the mul -processing opera ng system is to increase the speed of execu on of the
system. The use of a mul processing opera ng system improves the overall performance of
the system. For example, UNIX, LINUX, and Solaris are the most widely used mul -
processing opera ng system.
Mul -processing opera ng system consists of mul ple CPUs. Each CPU is connected
to the main memory.
For faster execu on and improved performance, each processor is assigned a specific
task.
Once all the tasks of each processor are completed they are compiled together in
order to produce a single output.
The alloca on of resources for each processor is handled by the opera ng system.
This process results in be er u liza on of the available resources and improved
performance.
The below diagram describes the working of mul -processing opera ng systems.
Working of Mul processing Opera ng System
Mul -processing opera ng systems are classified into two types. They are:
In a Symmetrical mul processing opera ng system, each processor executes the same copy
of opera ng system every me. Each process makes its own decisions and works according
to all other process to make sure that system works efficiently. With the help of CPU
scheduling algorithms, the task is assigned to the CPU that has least burden. Symmetrical
mul processing opera ng system is also known as "Shared Everything System" because all
the processors share memory and input-output bus. Below image describes about
symmetrical mul processing opera ng system.
Advantages
Failure of one processor does not affect the func oning of other processors.
In Asymmetrical mul processing opera ng system one processor acts as a master whereas
remaining all processors act a slaves. Slave processors are assigned with ready to execute
processes by the master processor. A ready queue is being maintained by master processor
to provides with processes for slaves. In mul processing opera ng system a schedular is
created by master process that assigns processes to be executed to slave processors. Below
diagram describes about the asymmetrical mul processing opera ng system.
Advantages
Disadvantages