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

Computer Software1

The document provides an introduction to different types of computer software, including system software and application software. It discusses system software in more detail, explaining that it includes programs that direct the internal operations of the computer like managing storage and I/O devices. Some examples of system software include operating systems, device drivers, and system utilities. The document also compares system software and application software, noting that system software provides basic computer functions while application software is used by users to perform specific tasks.

Uploaded by

Abishek Neupane
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views

Computer Software1

The document provides an introduction to different types of computer software, including system software and application software. It discusses system software in more detail, explaining that it includes programs that direct the internal operations of the computer like managing storage and I/O devices. Some examples of system software include operating systems, device drivers, and system utilities. The document also compares system software and application software, noting that system software provides basic computer functions while application software is used by users to perform specific tasks.

Uploaded by

Abishek Neupane
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 67

http://edusastra.

com

Introduction to software
➢ Software refers to a set of computer programs that are required to enable the hardware to
work and perform operations i.e. reading and processing data, storing results and providing
output effectively.

➢ A computer software(program) is basically a set of logical instructions written in a computer


programming language that tells the computer how to accomplish a task.

➢ Different sets of software can be loaded on the same hardware to perform different kinds of
tasks.

➢ Software broadly classified in 2 categories:

1. System software

2. Application Software

1.System Software:

➢ System sw is a group of programs that direct the internal operations of computer system
such as controlling I/O devices, managing the storage area within the computer etc.

➢ Functions of system software are:

o To provide basic functionality to computer,


http://edusastra.com

o To control computer hardware, and

o To act as an interface between user, application sw and computer hardware.

➢ System sw also provides the services(tools) for the development and execution of
application software.

System software Vs Application Software:

➢ System sw provides the basic function of the computer while application sw is used by the
users to perform specific tasks.

➢ The system sw interacts with hardware at one end and with application sw at the other end.

➢ The application sw interacts with the system sw and the users of the computer.
http://edusastra.com
http://edusastra.com

Types of computer Software:

System Software

➢ System software consists of several programs, which are directly responsible for controlling,
integrating and managing the individual hardware components of a computer system.

➢ It also provides the interface between the user and component of the computer.

➢ The purpose of system software is to insulate the applications programmer as much as


possible from the detail of the particular complex computer being used.

➢ It provides services required for the development and execution of application software.

➢ Depending on the functionality, the system software can be further divided into two major
categories;

1.System management program and

2.Developing software.

1. System Management Program:

It includes an integrated system of programs, which manages the operations of the processor,
controls input/output, manages storage resources and provides various support services. Some
common examples of system management programs are operating system, device driver and system
utilities.
http://edusastra.com

Operating System:
Introduction:

➢ It consists of programs , which controls, coordinates and supervises the activities of the
various components of a computer system.

➢ OS controls and coordinates the use of hardware among the different application software
and the users.

➢ OS provides an interface that is convenient for the user to use, and facilitates efficient
operations of the computer system resources.

➢ It performs all internal management functions (disk access, memory management, task
scheduling and user interfacing) and ensures systematic functioning of a computer system.

➢ It provides an environment to run the programs. e.g. Microsoft Disk Operating System (MS-
DOS), Windows7, Windows XP, Linux, UNIX, and Mac OS ….

The operating system performs the following functions.

1. It recognises input from keyboard, sends output to the display screen.

2. It makes sure that programs running at the same time do not interface with each other.

3. It is also responsible for security, ensuring that unauthorized users do not access the
system.

4. Booting Up: The Basic Input / Output system (BIOS) is commonly known as System Bios. The
BIOS controls various electronic components within the main computer system The initial
function of the BIOS is to initialize system devices such as the RAM, hard disk, CD/DVD drive,
video display card and other hardwares. The BIOS sets the machine hardware into a known
http://edusastra.com

state that helps the operating system to configure the hardware components. This process is
known as Booting Up.

Objectives of Operating System

The objectives of the operating system are −

• 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.

• To act as an intermediary between the hardware and its users, making it easier for the users
to access and use other resources.

• To manage the resources of a computer system.

• To keep track of who is using which resource, granting resource requests, and mediating
conflicting requests from different programs and users.

• To provide efficient and fair sharing of resources among users and programs.

Types of Operating Systems (OS)


An operating system is a well-organized collection of programs that manages the computer
hardware. It is a type of system software that is responsible for the smooth functioning of
the computer system.

Batch Operating System


http://edusastra.com

In the 1970s, Batch processing was very popular. In this technique, similar types of jobs
were batched together and executed in time. People were used to having a single computer
which was called a mainframe.
In Batch operating system, access is given to more than one person; they submit their
respective jobs to the system for the execution.
The system put all of the jobs in a queue on the basis of first come first serve and then
executes the jobs one by one. The users collect their respective output when all the jobs get
executed.

The purpose of this operating system was mainly to transfer control from one job to another
as soon as the job was completed. It contained a small set of programs called the resident
monitor that always resided in one part of the main memory. The remaining part is used for
servicing jobs.
http://edusastra.com

Advantages of Batch OS
o The use of a resident monitor improves computer efficiency as it eliminates CPU
time between two jobs.
Disadvantages of Batch OS
1. Starvation
Batch processing suffers from starvation.
For Example:
http://edusastra.com

There are five jobs J1, J2, J3, J4, and J5, present in the batch. If the execution time of J1 is
very high, then the other four jobs will never be executed, or they will have to wait for a
very long time. Hence the other processes get starved.
2. Not Interactive
Batch Processing is not suitable for jobs that are dependent on the user's input. If a job
requires the input of two numbers from the console, then it will never get it in the batch
processing scenario since the user is not present at the time of execution.
Examples of Batch OS: payroll system, bank statements, data entry, etc.
Multiprogramming Operating System
Multiprogramming is an extension to batch processing where the CPU is always kept busy.
Each process needs two types of system time: CPU time and IO time.
In a multiprogramming environment, when a process does its I/O, The CPU can start the
execution of other processes. Therefore, multiprogramming improves the efficiency of the
system.
http://edusastra.com

Advantages of Multiprogramming OS
o Throughout the system, it increased as the CPU always had one program to execute.
o Response time can also be reduced.
Disadvantages of Multiprogramming OS
o Multiprogramming systems provide an environment in which various systems
resources are used efficiently, but they do not provide any user interaction with the
computer system.
Multiprocessing Operating System
In Multiprocessing, Parallel computing is achieved. There are more than one processors
present in the system which can execute more than one process at the same time. This will
increase the throughput of the system.

In Multiprocessing, Parallel computing is achieved. More than one processor present in the
system can execute more than one process simultaneously, which will increase the
throughput of the system.
http://edusastra.com

Advantages of Multiprocessing operating system:


o Increased reliability: Due to the multiprocessing system, processing tasks can be
distributed among several processors. This increases reliability as if one processor
fails, the task can be given to another processor for completion.
o Increased throughout: As several processors increase, more work can be done in
less.
Disadvantages of Multiprocessing operating System
o Multiprocessing operating system is more complex and sophisticated as it takes care
of multiple CPUs simultaneously.
Multitasking Operating System
http://edusastra.com

The multitasking operating system is a logical extension of a multiprogramming system that


enables multiple programs simultaneously. It allows a user to perform more than one
computer task at the same time.

Advantages of Multitasking operating system


o This operating system is more suited to supporting multiple users simultaneously.
o The multitasking operating systems have well-defined memory management.
Disadvantages of Multitasking operating system
o The multiple processors are busier at the same time to complete any task in a
multitasking environment, so the CPU generates more heat.
o Examples of Multitasking OS: UNIX, etc.

Network Operating System


http://edusastra.com

An Operating system, which includes software and associated protocols to communicate


with other computers via a network conveniently and cost-effectively, is called Network
Operating System.

Advantages of Network Operating System


o In this type of operating system, network traffic reduces due to the division between
clients and the server.
o This type of system is less expensive to set up and maintain.
Disadvantages of Network Operating System
http://edusastra.com

o In this type of operating system, the failure of any node in a system affects the whole
system.
o Security and performance are important issues. So trained network administrators
are required for network administration.
Examples of Network OS: Microsoft Windows server 2008, LINUX, etc.
Real Time Operating System
In Real-Time Systems, each job carries a certain deadline within which the job is supposed to
be completed, otherwise, the huge loss will be there, or even if the result is produced, it will
be completely useless.

The Application of a Real-Time system exists in the case of military applications, if you want
to drop a missile, then the missile is supposed to be dropped with a certain precision.
http://edusastra.com

Advantages of Real-time operating system:


o Easy to layout, develop and execute real-time applications under the real-time
operating system.
o In a Real-time operating system, the maximum utilization of devices and systems.
Disadvantages of Real-time operating system:
o Real-time operating systems are very costly to develop.
o Real-time operating systems are very complex and can consume critical CPU cycles.
Examples of Real-Time OS: Medical imaging systems, robots, etc.
Time-Sharing Operating System
In the Time Sharing operating system, computer resources are allocated in a time-
dependent fashion to several programs simultaneously. Thus it helps to provide a large
number of user's direct access to the main computer. It is a logical extension of
multiprogramming. In time-sharing, the CPU is switched among multiple programs given by
different users on a scheduled basis.
http://edusastra.com

A time-sharing operating system allows many users to be served simultaneously, so


sophisticated CPU scheduling schemes and Input/output management are required.
Time-sharing operating systems are very difficult and expensive to build.
Advantages of Time Sharing Operating System
o The time-sharing operating system provides effective utilization and sharing of
resources.
o This system reduces CPU idle and response time.
Disadvantages of Time Sharing Operating System
o Data transmission rates are very high in comparison to other methods.
o Security and integrity of user programs loaded in memory and data need to be
maintained as many users access the system at the same time.

Distributed Operating System


The Distributed Operating system is not installed on a single machine, it is divided into parts,
and these parts are loaded on different machines. A part of the distributed Operating
system is installed on each machine to make their communication possible. Distributed
Operating systems are much more complex, large, and sophisticated than Network
operating systems because they also have to take care of varying networking protocols.
http://edusastra.com

Advantages of Distributed Operating System


o The distributed operating system provides sharing of resources.
o This type of system is fault-tolerant.
Disadvantages of Distributed Operating System
o Protocol overhead can dominate computation cost.
Examples of Distributed OS: LOCUS, Solaris, Ubuntu ,Linux. etc.

Mobile OS
A mobile OS is an operating system for smartphones, tablets, and PDA’s. It is a platform on
which other applications can run on mobile devices.
Advantages of Mobile OS
• It provides ease to users.
Disadvantages of Mobile OS
• Some of mobile operating systems give poor battery quality to users.
• Some of the mobile operating systems are not user-friendly.
Examples of Mobile OS: Android OS, ios, Symbian OS, and Windows mobile OS.
http://edusastra.com

Functions of Operating System

➢ Processor Management: The process management activities handled by the OS are


1) Control access to shared resources like file, memory, I/O and CPU,
2) Control execution of applications
3) Create, execute and delete a process (system process or user process),
4) Cancel or resume a process
5) Schedule a process, and
6) Synchronization, communication and deadlock handling for processes.

➢ Memory Management: The activities of memory management handled by OS are


1) allocate memory,
2) free memory,
3) re-allocate memory to a program when a used block is freed, and
http://edusastra.com

4) keep track of memory usage.

➢ Device Management: The device management tasks handled by OS are


1) open, close and write device drivers, and
2) communicate, control and monitor the device driver
➢ File Management: file management tasks include
1) create and delete both files and directories,
2) provide access to files,
3) allocate space for files,
4) 4) keep back-up of files, and
5) 5) secure files.
➢ Protection and Security: The operating system provides various techniques which
assure the integrity and confidentiality of user data. Following security measures are
used to protect user data:
o Protection against unauthorized access through login.
o Protection against intrusion by keeping Firefall active.
o Protecting the system memory against malicious access.
o Displaying messages related to system vulnerabilities.
http://edusastra.com

➢ Error Detection: From time to time, the operating system checks the system for any
external threat or malicious software activity. It also checks the hardware for any
type of damage. This process displays several alerts to the user so that the
appropriate action can be taken against any damage caused to the system.
➢ User Interface or Command Interpreter: Operating system provides an interface
between the computer user and the computer hardware. The user interface is a set
of commands or a graphical user interface via which the user interacts with the
applications and the hardware.
➢ Job Scheduling: In a multitasking OS where multiple programs run simultaneously,
the operating system determines which applications should run in which order and
how time should be allocated to each application.

Process Management
1.Process Vs Program
2. CPS Scheduling
3. Process Synchronization
4. Deadlock

1. Process Vs Program
Main differences b
The main differences between the process and program. Some of the main differences are
as follows:
1. The process and program are both related terms to each other, and the lifespan of
the program is longer compared to the process. A batch operating system is referred
to as sequential executing instructions/jobs, whereas in a real-time operating
system, it is referred to as a program.
2. A program is a collection of sequential and ordered operations that should be
executed. In contrast, a process is an example of a program being executed.
3. In the process, the resources need is much higher. It may require processing,
memory, input/output resources for the successful execution. In contrast, a
program only needs storage memory.
4. A program is passive in nature because it does nothing until it is executed, while a
process is dynamic or active because it is an instance of executing a program and
performing a specific action.
5. The process uses both internal and external resources like memory, registers,
input/output resources to complete and manage the task. A program's execution
http://edusastra.com

consumes CPU or I/O resources, which is the difference between a program and a
process.
6. The process is referred to as a program in execution, and it realizes/implements the
task for which the instructions are written into a program. A program may be related
to several processes. The operating system manages these project processes via a
PCB (Process Control Block).
7. The process has various resources such as disk, printer, memory address, whereas
the program requires memory space on the disk to store all instructions.
Head-to-head difference between Process and Program
Here, you will learn the head-to-head difference between the process and program. Some
of the differences are as follows:

Features Process Program

Definition A program has a collection of instructions A process is an example of an execution


designed to accomplish a certain task. program.

Nature It is an active entity. It is a passive entity.

Lifespan It has a limited lifespan. It has a much higher lifespan.

Resources It has a high resources requirement, and it It doesn't have any resources
requires including CPU, memory address, disk, requirements; it only needs memory
Input/output during its lifetime. space to store the instructions.

Creation The new process needs duplication of the parent No much duplication is needed.
process.

Computation The process takes a long time to access and It has no computation time and cost.
Time compute a single fact.

Required It holds resources including CPU, disk, memory The program is stored on a disk in a file
Process address, Input/Output etc. and doesn't need any additional
resources.

Overhead It has considerable overhead. It has no significant overhead cost.


http://edusastra.com

Cache Data It may use the cache to store the retrieve the data It has the instruction to use cache for its
as it uses OS paging scheme and cache data.
replacement policy like FCFS, LRU, RR, LIFO.

Process States
State Diagram

The process, from its creation to completion, passes through various states. The minimum
number of states is five.
1. New
A program which is going to be picked up by the OS into the main memory is called a new
process.

2. Ready
Whenever a process is created, it directly enters in the ready state, in which, it waits for the
CPU to be assigned. The OS picks the new processes from the secondary memory and put all
of them in the main memory.
http://edusastra.com

The processes which are ready for the execution and reside in the main memory are called
ready state processes. There can be many processes present in the ready state.
3. Running
One of the processes from the ready state will be chosen by the OS depending upon the
scheduling algorithm. Hence, if we have only one CPU in our system, the number of running
processes for a particular time will always be one. If we have n processors in the system then
we can have n processes running simultaneously.
4. Block or wait
From the Running state, a process can make the transition to the block or wait state
depending upon the scheduling algorithm or the intrinsic behavior of the process.
When a process waits for a certain resource to be assigned or for the input from the user then
the OS move this process to the block or wait state and assigns the CPU to the other processes.
5. Completion or termination
When a process finishes its execution, it comes in the termination state. All the context of the
process (Process Control Block) will also be deleted the process will be terminated by the
Operating system.
6. Suspend ready
A process in the ready state, which is moved to secondary memory from the main memory
due to lack of the resources (mainly primary memory) is called in the suspend ready state.
If the main memory is full and a higher priority process comes for the execution then the OS
have to make the room for the process in the main memory by throwing the lower priority
process out into the secondary memory. The suspend ready processes remain in the
secondary memory until the main memory gets available.
7. Suspend wait
Instead of removing the process from the ready queue, it's better to remove the blocked
process which is waiting for some resources in the main memory. Since it is already waiting
for some resource to get available hence it is better if it waits in the secondary memory and
make room for the higher priority process. These processes complete their execution once
the main memory gets available and their wait is finished.
2. CPU Scheduling
In the uniprogrammming systems like MS DOS, when a process waits for any I/O operation
to be done, the CPU remains idol. This is an overhead since it wastes the time and causes the
problem of starvation. However, In Multiprogramming systems, the CPU doesn't remain idle
during the waiting time of the Process and it starts executing other processes. Operating
System has to define which process the CPU will be given.
http://edusastra.com

In Multiprogramming systems, the Operating system schedules the processes on the CPU to
have the maximum utilization of it and this procedure is called CPU scheduling. The Operating
System uses various scheduling algorithm to schedule the processes.
This is a task of the short term scheduler to schedule the CPU for the number of processes
present in the Job Pool. Whenever the running process requests some IO operation then the
short term scheduler saves the current context of the process (also called PCB) and changes
its state from running to waiting. During the time, process is in waiting state; the Short term
scheduler picks another process from the ready queue and assigns the CPU to this process.
This procedure is called context switching.
What is saved in the Process Control Block?
The Operating system maintains a process control block during the lifetime of the process.
The Process control block is deleted when the process is terminated or killed. There is the
following information which is saved in the process control block and is changing with the
state of the process.

Why do we need Scheduling?


In Multiprogramming, if the long term scheduler picks more I/O bound processes then most
of the time, the CPU remains idol. The task of Operating system is to optimize the utilization
of resources.
If most of the running processes change their state from running to waiting then there may
always be a possibility of deadlock in the system. Hence to reduce this overhead, the OS
http://edusastra.com

needs to schedule the jobs to get the optimal utilization of CPU and to avoid the possibility
to deadlock.
Scheduling can be of two types:
1. Non-pre-emptive scheduling
2. Pre-emptive scheduling
1.Non-preemptive scheduling: The processor executes a process till termination without
any interruption. Hence the system resources are not used efficiently.
2. Pre-emptive scheduling: A running process may be interrupted by another process that
needs to execute. Preemption allows the operating system to interrupt the executing task
and handle any important task that requires immediate action. In pre-emptive scheduling,
the system resources are used efficiently.

Scheduling Algorithms in OS (Operating System)


There are various algorithms which are used by the Operating System to schedule the
processes on the processor in an efficient way.
The Purpose of a Scheduling algorithm
1. Maximum CPU utilization
2. Fare allocation of CPU
3. Maximum throughput
4. Minimum turnaround time
5. Minimum waiting time
6. Minimum response time
There are the following algorithms which can be used to schedule the jobs.
1. First Come First Serve
This is the most basic algorithm in Operating System, as the name suggests, first come first
serve (FCFS) the process which enters the system first gets the CPU time first.
Consider the following scenario –
Lets say you’re waiting at a railway station’s ticket counter at the front of the queue the
person who arrived first will be given chance to buy the ticket, and you will have to wait for
your turn until all the people in front of you in the queue or those who have arrived earlier
have bought tickets.
http://edusastra.com

These are the traits of FCFS algorithm –


• It is parallel to how FIFO in stack is
• Process which arrives firsts gets CPU time first
• It is a non preemptive type of algorithm
Let us try to understand FCFS Scheduling with the help of an example –
Note – If order and arrival time is not given then consider the order as is and arrival time to
be 0 for all the processes.

Process Burst Time Arrival Order Arrival Time

P1 12 1 0

P2 7 2 0

P3 2 3 0

P4 5 4 0

1. Turn Around Time = Completion Time – Arrival Time


2. Waiting Time = Turnaround time – Burst Time
Lets make a gantt Chart for this first.

Waiting time –
1. P1 waiting time – 0ms
2. P2 waiting time – 12ms
3. P3 waiting time – 19ms
http://edusastra.com

4. P4 waiting time – 21ms


Thus, average waiting time – (0 + 12 + 19 + 21)/4 = 13ms
Turn around time – Time when process entered the system and when its out of the system
1. P1 turn around time – (12 – 0) ms
2. P2 turn around time – (19 – 0) ms
3. P3 turn around time – (21 – 0) ms
4. P4 turn around time – (26 – 0) ms
Average turn around time (12 + 19 + 21 + 26)/4 = 19.5 ms
Disadvantages of FCFS Algorithm
• Since, its a non preemptive algorithm thus, there is no intelligence applied and no
priority can be given to processes.
• If critical system process arrives it may have to wait for a process like calculator.
• Waiting time may get too high, along with the turn around time.
• Causes convoy effect
2. Round Robin
In Round robin Scheduling Algorithm, each process is given a fixed time called quantum for
execution. After the Quantum of time passes, the current running process is preempted and
the next process gets executed for next quantum of time.
CPU Scheduler goes around the ready queue and allocates CPU to each process for the
interval upto 1 time quantum. Ready Queue is like a First In First Out Structure, where new
processes are at last of the ready queue.
Now, while a process is in that quantum executing, one of the two things will happen
1. If the process has a CPU burst of less than quantum time, then as the process gets
finished , CPU resources are released voluntarily. the next process in the ready
queue occupies the CPU.
2. If the CPU burst is larger than the quantum, the timer will go off and the process is
preempted, its state is saved by context switching and process is put at last of ready
queue. After this, the next process in the ready queue comes in CPU quantum.
Round Robin Example
Let’s understand round Robin Scheduling with the help of an example .
http://edusastra.com

Process Burst Time

P1 10

P2 2

P3 5

P4 6

The order in which the CPU processes the process are (Gantt Chart) –

Here, we have taken quantum as 3ms. So,each process is assigned 3ms before switching to
next process.
• P1 is executed for 3ms. The, P2 is executed. As, P2 is only 2ms long, So after 2 ms ,
next process occupies the CPU.
• P3 then is executed for 3ms. So, P3 remaining = 2ms. Then , P4 is executed for 3ms.
P4 remaining time = 3ms
• P1 is again executed for 3ms. P1 remaining time = 4ms
• P3 is executed for 2ms. Then, P4 is executed for 3ms.
• Now remaining process is P1 only . It executed for 3 ms. After that, Since P2,P3 and
P4 are already finished, P1 is executed again for remaining time (1ms).
Let’s calculate Average Waiting time for each process –
http://edusastra.com

• Average waiting time for P1 = 19- (3+3) = 13ms


• Average Waiting time for P2 = 3ms
• Average Waiting time for P3 = 14-3 = 11ms
• Average Waiting time for P4 = 16-3 = 13ms
Total average waiting time = (13 +3 +11+13)/4 = 10ms
Advantages –
• It does not cause starvation as all process get equal time of CPU.
Disadvantages –
• There is an overhead of context switching as mentioned earlier, too small of
quantum time causes overhead and slower execution of process. So, time quantum
must be large with respect to Context Switch time.
3. Shortest Job First
1. Shortest Job First Scheduling (Non Preemptive Algorithm) in Operating System
• Shortest Job First (SJF) is a Scheduling Algorithm where the process are executed in
ascending order of their burst time, that is, the process having the shortest burst
time is executed first and so on.
• The processor knows burst time of each process in advance.
• It can be thought of as shortest-next-cpu-burst algorithm, as Scheduling depends on
length of the next CPU burst of a process. ( The duration for which a process gets
control of the CPU, is the Burst time for a process.)
• SJF can be Pre-emptive or Non- preemptive. Under Non-preemptive Scheduling ,
once a process has been allocated to CPU, the process keeps the CPU until the
process has finished its execution.
Read more – SJF Preemptive Scheduling here
SJF Non Preemptive Example
Note – This example is given wrong on Geeks4Geeks. So make sure that you only study it on
PrepInsta.
Let us try to understand SJF Non-Preemptive Scheduling with an example –
Here, processes are assumed to be arrived at the same time.
See the below Example –
http://edusastra.com

SJF Process Burst Time ( in ms) Arrival Time

P1 2 0

P2 8 0

P3 1 0

P4 4 0

The order in which the CPU processes the process are(Gantt Chart) –

Steps –
1. Since Burst time for P3 (Burst = 1 sec) is lowest it is executed first.
2. Then Burst time for P1 is lowest in order thus it gets executed the 2nd time.
3. Similarly P4 and then P2
Waiting time –
http://edusastra.com

1. P1 waiting time = 1
2. P2 waiting time = 7
3. P3 waiting time = 0
4. P4 waiting time = 3
The average waiting time is = ( 1+ 7 + 0 + 3 )/ 4 = 2.75
Features of SJF
• SJF is a greedy Algorithm
• It has Minimum average waiting time among all scheduling algorithms.
• Difficulty of SJF is knowing the length of next CPU request.
• It’s used frequently in Long-term scheduling in Batch System as in this, the time limit
is provided by the user specifying the process. We presume that user provides
accurate time limit as lower accurate value means faster response.
• SJF can’t be implemented in Short-term scheduling as one can’t know the exact
length of next CPU burst. It can be Approximated by doing an exponential average of
already measured length of previous CPU burst.
Drawback
• in SJF Scheduling, a process with high burst time may suffer starvation. Starvation is
the process in which a process with higer burst time is kept on waiting and waiting ,
but is not allocated to the CPU. It’s prevented by aging.
• Total execution time must be known beforehand of a process.
What is aging?
• Aging is a technique which is used to reduce starvation of the processes.
• Aging takes into account the waiting time of the process in the ready queue and
gradually increases the priority of the process.
• Hence, as the priority of a process gets increased this ensures that all process get
completed eventually.
4. Shortest remaining time first
Shortest Job First Preemptive Scheduling is also known as Shortest remaining Time(SRT) or
Shortest Next Time(SNT).
1. The choice of preemptive and non preemptive arises when a new process arrives at
the ready queue and a previous process is not finished and is being executed. If the
next CPU burst of new process is shorter than current executing process, then in
http://edusastra.com

preemptive version , it will stop that process and will start executing the newly
arrived process.
2. While, in non preemptive version of SJF, even if the arriving process is shorter than
currently executing process, current process is not stopped . After the current
process finishes , then the new process gets in the queue. This is the key difference
between preemptive and preemptive version of SJF.
3. The current state of the process is saved by the context switch and the CPU is given
to another process.
Note – If 2 processes have same execution time, then jobs are based on First Come First
Serve Basis.
Shortest Job First – Preemptive Scheduling with Example (SJF)
Let’s understand SJF Scheduling with the help of an example.

Process Arrival time Burst Time

P1 0 6

P2 1 4

P3 2 2

P4 3 3

The order in which the CPU processes the process are (Gantt Chart) –

1. At ( t =0ms ), P1 arrives. It’s the only process so CPU starts executing it.
http://edusastra.com

2. At ( t = 1ms ), P2 has arrived . At this time, P1 (remaining time ) = 5 ms . P2 has 4ms


, so as P2 is shorter, P1 is preempted and P2 process starts executing.
3. At ( t = 2ms ), P3 process has arrived. At this time, P1(remaining time) = 5ms,
P2(remaining time ) = 3 ms , P3 = 2ms. Since P3 is having least burst time, P3 is
executed .
4. At ( t = 3ms ), P4 comes , At this time, P1 = 5ms, P2 = 3ms, P3 = 1ms, P4 = 3ms. Since
P4 does not have short burst time, so P3 continues to execute.
5. At ( t= 4ms ),P3 is finished . Now, remaining tasks are P1 = 5ms, P2 = 3ms, P4 = 3ms.
As ,P2 and P4 have same time, so the task which came first will be executed first. So,
P2 gets executed first.
6. At ( t = 7ms ),P4 gets executed for 3ms.
7. At ( t = 10ms ), P1 gets executed till it finishes.
Waiting time = Completion time – Burst Time – Arrival Time
1. P1 waiting time = (15-6-0) = 9ms
2. P2 waiting time = (7-4-1) = 2ms
3. P3 waiting time = (4-2-2 )=0ms
4. P4 waiting time = (10-3-3)= 4ms
The average waiting time is ( 9 +2 + 0 + 4)/4 = 15/4 = 3.75
Disadvantages
It has the same disadvantages as non-preemptive version of SJF. Here also process with
larger burst time may experience process starvation, which could be prevented with aging.
5. Priority based scheduling
In some systems, lower priority number means that higher priority (Example P1 with priority
1 and P2 with priority 4, in this case P1 will have higher priority). However, in some system
its opposite, higher priority number means higher priority.
Students may get confused with this. Thus, Gate now specifically mentions which one is the
highest and which one is the lowest. However, if this information is not given in exams like
placement tests etc. Then lower priority number means higher priority.
This information is given incorrectly in Geeks4Geeks thus, most students solve the questions
incorrectly.
• If 2 processes have equal priorities the those process are scheduled in First Come
First Serve order.
http://edusastra.com

• Priority can be defined internally or externally.


• It can be either preemptive or non preemptive algorithm.

• Let’s try to understand Priority Scheduling with the help of an example (For
Ease of understanding, for first example arrival time for all is 0) –
• In our example consider the lowest value as the highest Priority and note we
are considering non preemptive algorithm in nature thus no dynamic priority
change will be there.

Process Execution Time Priority Arrival Time


P1 3 1 (Highest) 0
P2 4 3 0
P3 2 2 0
P4 1 1 (Highest) 0
P5 3 4 (Lowest) 0
• We suggest solving it on your own and not looking the solution and
explanation below –

• Both P1 and P4 have the highest Priority(1). Thus we will use FCFS to settle
clash and P1 will execute first.
http://edusastra.com

• P4 will execute once P1 is finished executing

• P3 has priority 2 thus it will execute next.


• Then finally P2 and P5 Average Waiting Time for processes are –Average
Waiting Time = Completion Time – Burst Time – Arrival TIme

• Average Waiting Time for P1 = 3-3-0 = 0ms

• Average Waiting Time for P2 = 10-4-0 = 6ms


• Average Waiting Time for P3 = 6-2-0 = 4ms

• Average Waiting Time for P4 = 4-1-0 = 3ms

• Average Waiting Time for P5 = 13-3-0 = 10ms


Average waiting Time for all processes = (0 + 6 + 4 + 3 +10)/5 = 4.6ms

Disadvantages

Like FCFS and SJF , a process having lower priority can be indefinite blocked or
starved. To prevent this, we do aging where the priority of the process is increased as
it waits in the queue. So, a process which has been in a queue for a long time will
reach high priority, hence it won’t be starved.
6. Highest Response Ratio Next
HRRN(Highest Response Ratio Next )Scheduling is a non-preemptive scheduling algorithm in
the operating system. It is one of the optimal algorithms used for scheduling.
As HRRN is a non-preemptive scheduling algorithm so in case if there is any process that is
currently in execution with the CPU and during its execution, if any new process arrives in
the memory with burst time smaller than the currently running process then at that time
the currently running process will not be put in the ready queue & complete its execution
without any interruption.
HRRN is basically the modification of Shortest Job Next(SJN) in order to reduce the problem
of starvation.
In the HRRN scheduling algorithm, the CPU is assigned to the next process that has
the highest response ratio and not to the process having less burst time.
Now, let us first take a look at how to calculate the Response ratio.
Response Ratio = (W+S)/
Where, W=It indicates the Waiting Time.
S=It indicates the Service time that is Burst Time.
http://edusastra.com

3.Process Synchronization in OS (Operating System)


Process Synchronization is the coordination of execution of multiple processes in a multi-
process system to ensure that they access shared resources in a controlled and predictable
manner. It aims to resolve the problem of race conditions and other synchronization issues
in a concurrent system.
The main objective of process synchronization is to ensure that multiple processes access
shared resources without interfering with each other, and to prevent the possibility of
inconsistent data due to concurrent access. To achieve this, various synchronization
techniques such as semaphores, monitors, and critical sections are used.
In a multi-process system, synchronization is necessary to ensure data consistency and
integrity, and to avoid the risk of deadlocks and other synchronization problems. Process
synchronization is an important aspect of modern operating systems, and it plays a crucial
role in ensuring the correct and efficient functioning of multi-process systems.
1.Race Condition:
➢ When more than one process is executing the same code or accessing the same
memory or any shared variable in that condition there is a possibility that the output
or the value of the shared variable is wrong so for that all the processes doing the
race to say that my output is correct this condition known as a race condition.
➢ A race condition is a situation that may occur inside a critical section. This happens
when the result of multiple thread execution in the critical section differs according
to the order in which the threads execute.
➢ Race conditions in critical sections can be avoided if the critical section is treated as
an atomic instruction. Also, proper thread synchronization using locks or atomic
variables can prevent race conditions.
2.Critical Section Problem:
➢ A critical section is a code segment that can be accessed by only one process at a
time. The critical section contains shared variables that need to be synchronized to
maintain the consistency of data variables.
➢ The critical section problem means designing a way for cooperative processes to
access shared resources without creating data inconsistencies.
4.Deadlock
It is a situation where a set of processes are blocked because each process is holding a
resource and waiting for another resource acquired by some other process.
Consider an example when two trains are coming toward each other on the same track and
there is only one track, none of the trains can move once they are in front of each other. A
http://edusastra.com

similar situation occurs in operating systems when there are two or more processes that
hold some resources and wait for resources held by other(s). For example, in the below
diagram, Process 1 is holding Resource 1 and waiting for resource 2 which is acquired by
process 2, and process 2 is waiting for resource 1.

Examples Of Deadlock
1. System has 2 tape drives. P1 and P2 each hold one tape drive and each needs
another one.
2. Semaphores A and B, initialize to 1, P0 and P1 are in deadlock as follows:
• P0 executes wait(A) and preempts.
• P1 executes wait(B).
• Now P0 and P1 enters in deadlock.

P0 P1

wait(A); wait(B)

wait(B); wait(A)
http://edusastra.com

3. Assume the space is available for allocation of 200K bytes, and the following
sequence of events occur.

P0 P1

Request 80KB; Request 70KB;

Request 60KB; Request 80KB;

Deadlock occurs if both processes progress to their second request.


Deadlock can arise if the following four conditions hold simultaneously (Necessary
Conditions)
Mutual Exclusion: Two or more resources are non-shareable (Only one process can use at a
time)
Hold and Wait: A process is holding at least one resource and waiting for resources.
No Preemption: A resource cannot be taken from a process unless the process releases the
resource.
Circular Wait: A set of processes are waiting for each other in circular form.
Methods for handling deadlock
There are three ways to handle deadlock
1) Deadlock prevention or avoidance:
Prevention:
The idea is to not let the system into a deadlock state. This system will make sure that above
mentioned four conditions will not arise. These techniques are very costly so we use this in
cases where our priority is making a system deadlock-free.
One can zoom into each category individually, Prevention is done by negating one of above
mentioned necessary conditions for deadlock. Prevention can be done in four different
ways:
1. Eliminate mutual exclusion 3. Allow preemption
2. Solve hold and Wait 4. Circular wait Solution
Avoidance:
Avoidance is kind of futuristic. By using the strategy of “Avoidance”, we have to make an
assumption. We need to ensure that all information about resources that the process will
http://edusastra.com

need is known to us before the execution of the process. We use Banker’s algorithm (Which
is in turn a gift from Dijkstra) to avoid deadlock.
In prevention and avoidance, we get correctness of data but performance decreases.
2) Deadlock detection and recovery: If Deadlock prevention or avoidance is not applied to
the software then we can handle this by deadlock detection and recovery. which consist of
two phases:
1. In the first phase, we examine the state of the process and check whether there is a
deadlock or not in the system.
2. If found deadlock in the first phase then we apply the algorithm for recovery of the
deadlock.
In Deadlock detection and recovery, we get the correctness of data but performance
decreases.
3) Deadlock ignorance: If a deadlock is very rare, then let it happen and reboot the system.
This is the approach that both Windows and UNIX take. we use the ostrich algorithm for
deadlock ignorance.

Memory Management in Operating System (OS)


Memory is the important part of the computer that is used to store the data. Its management
is critical to the computer system because the amount of main memory available in a
computer system is very limited. At any time, many processes are competing for it. Moreover,
to increase performance, several processes are executed simultaneously. For this, we must
keep several processes in the main memory, so it is even more important to manage them
effectively.

Role of Memory management


Following are the important roles of memory management in a computer system:
o Memory manager is used to keep track of the status of memory locations, whether it
is free or allocated. It addresses primary memory by providing abstractions so that
software perceives a large memory is allocated to it.
o Memory manager permits computers with a small amount of main memory to
execute programs larger than the size or amount of available memory. It does this by
moving information back and forth between primary memory and secondary
memory by using the concept of swapping.
http://edusastra.com

o The memory manager is responsible for protecting the memory allocated to each
process from being corrupted by another process. If this is not ensured, then the
system may exhibit unpredictable behaviour.
o Memory managers should enable sharing of memory space between processes.
Thus, two programs can reside at the same memory location although at different
times.
Memory Management Techniques:
The memory management techniques can be classified into following main categories:
o Contiguous memory management schemes
o Non-Contiguous memory management schemes

Contiguous memory management schemes:


In a Contiguous memory management scheme, each program occupies a single contiguous
block of storage locations, i.e., a set of memory locations with consecutive addresses.
Single contiguous memory management schemes:
The Single contiguous memory management scheme is the simplest memory management
scheme used in the earliest generation of computer systems. In this scheme, the main
memory is divided into two contiguous areas or partitions. The operating systems reside
permanently in one partition, generally at the lower memory, and the user process is loaded
into the other partition.
Multiple Partitioning:
1.Fixed Partitions Memory Management:
http://edusastra.com

The operating system occupies the low memory and the rest of the main memory is available
for user space. The user space divides into fixed partitions. The partition sizes are depending
on the operating system.
The user space of the main memory is divided into several partitions. But the partition sizes
are different lengths. The operating system keeps a table indicating which partitions of
memory are available and which are occupied.
2.Dynamic Partitions Memory Management:

To eliminate some of the problems with fixed partitions, an approach known as Dynamic
Partitions. In this method, partitions are created dynamically. So that each process loads
into a partition of the same size as that process.
a.First fit:
Allocate the partition that is big enough, searching can start either from low memory or high
memory. We can stop searching as soon as we find a free partition that is large enough.
b.Best fit:
Allocate the smallest partition that is big enough (or) select a partition which had the least
internal fragmentation.
c.Worst fit:
Search the entire partitions and select a partition which is the largest of all. Select a
partition that had the maximum internal fragmentation.
d.Next fit:
Next fit is similar to the first fit. But it’ll search for the first sufficient partition from the last
allocation point.
Non-Contiguous memory management schemes:
In a Non-Contiguous memory management scheme, the program is divided into different
blocks and loaded at different portions of the memory that need not necessarily be adjacent
to one another. This scheme can be classified depending upon the size of blocks and
whether the blocks reside in the main memory or not.
1.Paging:
In Operating Systems, Paging is a storage mechanism used to retrieve processes from the
secondary storage into the main memory in the form of pages.
The main idea behind the paging is to divide each process in the form of pages. The main
memory will also be divided in the form of frames.
http://edusastra.com

One page of the process is to be stored in one of the frames of the memory. The pages can
be stored at the different locations of the memory but the priority is always to find the
contiguous frames or holes.
Pages of the process are brought into the main memory only when they are required
otherwise they reside in the secondary storage.
Different operating system defines different frame sizes. The sizes of each frame must be
equal. Considering the fact that the pages are mapped to the frames in Paging, page size
needs to be as same as frame size.

Example
Let us consider the main memory size 16 Kb and Frame size is 1 KB therefore the main
memory will be divided into the collection of 16 frames of 1 KB each.
There are 4 processes in the system that is P1, P2, P3 and P4 of 4 KB each. Each process is
divided into pages of 1 KB each so that one page can be stored in one frame.
http://edusastra.com

Initially, all the frames are empty therefore pages of the processes will get stored in the
contiguous way.
Frames, pages and the mapping between the two is shown in the image below.

Let us consider that, P2 and P4 are moved to waiting state after some time. Now, 8 frames
become empty and therefore other pages can be loaded in that empty place. The process P5
of size 8 KB (8 pages) is waiting inside the ready queue.
Given the fact that, we have 8 non contiguous frames available in the memory and paging
provides the flexibility of storing the process at the different places. Therefore, we can load
the pages of process P5 in the place of P2 and P4.
http://edusastra.com

2.Segmentation/Memory Management Unit


In Operating Systems, Segmentation is a memory management technique in which the
memory is divided into the variable size parts. Each part is known as a segment which can
be allocated to a process.
The details about each segment are stored in a table called a segment table. Segment table
is stored in one (or many) of the segments.
Segment table contains mainly two information about segment:
1. Base: It is the base address of the segment
2. Limit: It is the length of the segment.
Why Segmentation is required?
http://edusastra.com

Till now, we were using Paging as our main memory management technique. Paging is more
close to the Operating system rather than the User. It divides all the processes into the form
of pages regardless of the fact that a process can have some relative parts of functions
which need to be loaded in the same page.

Operating system doesn't care about the User's view of the process. It may divide the same
function into different pages and those pages may or may not be loaded at the same time
into the memory. It decreases the efficiency of the system.
It is better to have segmentation which divides the process into the segments. Each
segment contains the same type of functions such as the main function can be included in
one segment and the library functions can be included in the other segment.

Translation of Logical address into physical address by segment table


CPU generates a logical address which contains two parts:
1. Segment Number
2. Offset
For Example:
Suppose a 16 bit address is used with 4 bits for the segment number and 12 bits for the
segment offset so the maximum segment size is 4096 and the maximum number of
segments that can be refereed is 16.
http://edusastra.com

When a program is loaded into memory, the segmentation system tries to locate space that
is large enough to hold the first segment of the process, space information is obtained from
the free list maintained by memory manager. Then it tries to locate space for other
segments. Once adequate space is located for all the segments, it loads them into their
respective areas.
The operating system also generates a segment map table for each program.

With the help of segment map tables and hardware assistance, the operating system can
easily translate a logical address into physical address on execution of a program.
The Segment number is mapped to the segment table. The limit of the respective segment
is compared with the offset. If the offset is less than the limit then the address is valid
otherwise it throws an error as the address is invalid.
In the case of valid addresses, the base address of the segment is added to the offset to get
the physical address of the actual word in the main memory.
The above figure shows how address translation is done in case of segmentation.
http://edusastra.com

File Management:
File management is one of the basic and important features of operating system. Operating
system is used to manage files of computer system. All the files with different extensions
are managed by operating system.
A file is collection of specific information stored in the memory of computer system. File
management is defined as the process of manipulating files in computer system, it
management includes the process of creating, modifying and deleting the files.
The following are some of the tasks performed by file management of operating system of
any computer system:
1. It helps to create new files in computer system and placing them at the specific
locations.
2. It helps in easily and quickly locating these files in computer system.
3. It makes the process of sharing of the files among different users very easy and user
friendly.
4. It helps to stores the files in separate folders known as directories. These directories
help users to search file quickly or to manage the files according to their types or
uses.
5. It helps the user to modify the data of files or to modify the name of the file in the
directories.
http://edusastra.com

Device Management:
Device management is the process of managing the implementation, operation and
maintenance of a physical and/or virtual device. It is a broad term that includes various
administrative tools and processes for the maintenance and upkeep of a computing,
network, mobile and/or virtual device.

Device management generally performs the following:


• Installing device and component-level drivers and related software
• Configuring a device so it performs as expected using the bundled operating system,
business/workflow software and/or with other hardware devices.
• Implementing security measures and processes.
• In addition to managing the peripheral devices, OS also provides various services
related to I/O like I/O scheduling, buffering, spooling, and error handling.
I/O scheduling: Input/output (I/O) scheduling is the method that computer operating
systems use to decide in which order I/O operations will be submitted to storage volumes.
I/O scheduling is sometimes called disk scheduling.
➢ I/O scheduling usually has to work with hard disk drives that have long access
times for requests placed far away from the current position of the disk head (this
operation is called a seek).
http://edusastra.com

➢ To minimize the effect this has on system performance, most I/O schedulers
implement a variant of the elevator algorithm that reorders the incoming
randomly ordered requests so the associated data would be accessed with
minimal arm/head movement.

Buffering: Buffering is a technique which is used to enhance the performance of I/O


operations of the system. Basically, buffering in operating system is a method of storing
data in a buffer or cache temporarily, this buffered data then can be accessed more
quickly as compared to the original source of the data.
➢ In a computer system, data is stored on several devices like hard discs, magnetic
tapes, optical discs and network devices. In the case, when a process requires to
read or write data from one of these storage devices, it has to wait while the device
retrieves or stores the data. This waiting time could be very high, especially for
those devices which are slow or have a high latency.
➢ This problem can be addressed by buffering. Buffering provides a temporary
storage area, called buffer. Buffer can store data before it is sent to or retrieved
from the storage device. When the buffer is fully occupied, then data is sent to the
storage device in a batch, this will reduce the number of access operations
required and hence improves the performance of the system.

Spooling (Simultaneous Peripheral Operation On-Line): Spooling is a process in which


data is temporarily held to be used and executed by a device, program, or system. Data is
sent to and stored in memory or other volatile storage until the program or computer
requests it for execution.
➢ SPOOL is an acronym for simultaneous peripheral operations online. Generally,
the spool is maintained on the computer's physical memory, buffers, or the I/O
device-specific interrupts. The spool is processed in ascending order, working
based on a FIFO (first-in, first-out) algorithm.
➢ Spooling refers to putting data of various I/O jobs in a buffer. This buffer is a special
area in memory or hard disk which is accessible to I/O devices.

Error handling: Error handling is the process of responding to and recovering from error
conditions in your program. Swift provides first-class support for throwing, catching,
propagating, and manipulating recoverable errors at runtime.
➢ Error handling refers to the response and recovery procedures from error
conditions present in a software application.
http://edusastra.com

➢ It is the process comprised of anticipation, detection and resolution of


application errors, programming errors or communication errors.
➢ Error handling helps in maintaining the normal flow of program execution.
Types of Devices
Operating System (OS) has three types of peripheral devices, i. e., Dedicated, Shared, and
Virtual.
1. Dedicated Device:
Dedicated devices are devices of device management that allocate a single task at a time.
Plotters, tape drivers, and other devices need such allocation as it is inconvenient to share
with multiple users simultaneously. The main disadvantage of such a device is that it is less
efficient than others as the device can use one user for the whole duration of the task.
2. Shared Device
As the name suggests, shared devices can assign for multiple processes. Moreover, the device
manager needs to handle the process and policies carefully.
3. Virtual Device
The virtual device is a combination of dedicated and shared devices. Virtual devices are
dedicated devices that are transformed into a shared ones. We can take the example of a
printer as we can not directly send a print job to the printer. It is routed to the disk until the
whole process of formatting and sequencing is prepared. Further, the printer works as a
shareable device by using a particular spooling program. On the other hand, spooling program
helps the printer to redirect all the requests to the disk.
Features of Device Management:
Various features of Device Management is as follows:
1. The OS interacts with the device controllers via the device drivers while allocating
the device to the multiple processes executing on the system.
2. Device drivers can also be thought of as system software programs that bridge
processes and device controllers.
3. The device management function's other key job is to implement the API.
4. Device drivers are software programs that allow an operating system to control the
operation of numerous devices effectively.
5. The device controller used in device management operations mainly contains three
registers: command, status, and data.
Device Management Functions:
http://edusastra.com

The drivers are an essential part of the operating system as they help communicate with the
devices. There are multiple functions of device management in OS. Some of them are as
follow:
1. It keeps track of data, status, location, uses, etc. The file system is a term used to
define a group of facilities.
2. Enforces the pre-determined policies and decides which process receives the device
when and for how long.
3. improves the performance of specific devices.
4. It monitors the status of every device, including printers, storage drivers, and other
devices.
5. It allocates and effectively deallocates the device. De-allocating differentiates the
devices at two levels: first, when an I/O command is issued and temporarily freed.
Second, when the job is completed, and the device is permanently release
Protection and Security:
Security mechanism prevents unauthorized access to the computer. Security concerns
include - security of software, security of data stored in the computer, and security of
physical resources of the computer.
Protection mechanism
(1) user accounts—individual accounts for each user,
(2) user authentication— using password protection,
(3) access rights—define rights for access of different kind of information for
different people,
(4) data encryption (BitLocker Drive Encryption in windows10)—store data in
computer in encrypted form, and
(5) data backup—storing data on a peripheral device other than the hard disk.
In a networked environment, only trusted computers should be able to share data. Some of
the common security threats occur due to hacking, viruses etc.
User Interface or Command Interpreter:
Operating system provides an interface between the computer user and the computer
hardware. The user interface is a set of commands or a graphical user interface via which the
user interacts with the applications and the hardware.
http://edusastra.com

The primary goal of operating system is to make the computer convenient for use by its user.
It should allow users to easily access and communicate with the applications and the
hardware.
The users can interact with the computer by using mainly two kinds of interfaces
(1) Command Line Interface (CLI), and
(2) Graphical User Interface (GUI).
Command Line Interface (CLI):
CLI requires the user to interact with operating system in the form of text keyed in from the
keyboard. In this, the user has to learn and remember the different commands required for
copying, deleting, opening a file or folder etc. MS-DOS and Linux shell are examples of
command line mode of interfaces.
Graphical User Interface (GUI)
It is a system of interactive visual components for computer software. A GUI displays objects
that convey information, and represent actions that can be taken by the user. The objects
change color, size, or visibility when the user interacts with them.
Example:

• Microsoft Windows, macOS, Ubuntu Unity, and GNOME Shell for desktop
environments and

• Android, Apple's iOS, BlackBerry OS, Windows 10 Mobile, Palm OS-WebOS, and
Firefox OS for smartphones.

Examples of Operating System


Following are some examples of Operating Systems:
1. Microsoft Windows
It is a series of graphical operating systems developed, marketed, and sold by
Microsoft. The first version of Windows was released in 1985 as a GUI add-on to MS-
DOS. The first version of Windows sold as a standalone operating system was
Windows 95.
MD-DOS (Microsoft Disk Operating System) [1981]
Windows 1.0 - 2.0 [1985 - 1992]
Windows 3.0 - 3.1 [1990 - 1994]
Windows 95 [1995]
Windows 98 [1998]
http://edusastra.com

Windows ME (Millennial Edition) [2000]


Windows NT 31. - 4.0 [1993 - 1996]
Windows 2000 [2000]
2. macOS
It is a series of graphical operating systems developed by Apple Inc. It is the successor to
Mac OS X, and it is the operating system that powers Apple’s Mac family of computers.

3. Linux:
Linux is built around the Linux kernel and is a free and open-source software OS. It is one of
the most popular operating systems for servers and embedded devices. It is also used by
millions of desktop users around the world.

4. Android:
It is a mobile OS developed by Google. It is based on the Linux kernel and designed primarily
for touchscreen mobile devices such as smartphones and tablets.
5. iOS:
http://edusastra.com

Another example of a mobile OS developed by Apple Inc. iOs is the successor to iPhone OS.
It is an operating system that powers the iPhone, iPad, and iPod Touch products.
Advantages of Operating System
There are several advantages of operating systems. We have listed some of them below:
1. Ensuring correct and efficient use of the computer’s hardware.
2. Allowing different applications to run concurrently.
3. Managing files and folders.
4. Providing a user interface.
5. Managing security.
6. Managing resources.
7. Managing printing.
8. Providing a platform for software development.
Disadvantages of Operating System
There are several disadvantages of operating systems. We have listed some of them below:
• They can be complex and difficult to use.
• They can be expensive to purchase and maintain.
• They can be vulnerable to attacks from malicious users.
Real-Time Operating System
What is RTOS?
An operating system that can execute multi-threaded programmes and adhere to real-time
deadlines is known as a “RTOS.” The majority of RTOSes incorporate device drivers, resource
management, and schedulers. Remember that we don’t always mean “quick” when we talk
about “deadlines.” Instead, this means that we can foresee when specific jobs will run
before runtime.
If you’re writing intricate embedded applications, an RTOS can be a great tool. They support
task isolation and enable concurrent operation.
Applications of Real-Time Operating System
• Defence application systems like RADAR.
• Airlines reservation system.
• Systems that provide immediate updating.
http://edusastra.com

• Networked Multimedia Systems.


• Air traffic control system.
• Command Control Systems.
Device Drivers:

➢ A software, which is written with the objective of making a device functional when it
is connected to the computer is called device driver.

➢ It is a system software that acts like an interface between the device and the user.

➢ A device driver acts as a translator between the hardware and the software that uses the
devices

➢ Every device, whether it is a printer, monitor, mouse or keyboard has a driver program
associated with it for its proper functioning.

➢ For example, when we give a command to read data from the hard disk, the command is
sent to the hard disk driver and is translated to a form that the hard disk can understand.

➢ Operating system comes preloaded with some commonly used device drivers i.e. for mouse,
webcam, and keyboard and the operating system can automatically detect the device when
it is connected to the computer. Such devices are called plug and play devices.

➢ Device drivers can be character or block device drivers. Character device drivers are for
character based devices like keyboard, which transfer data character by character.

➢ Block device driver are for devices that transfer data as a block, like in hard disk.
http://edusastra.com

How to install device driver

System Utilities:
http://edusastra.com

These programs perform tasks related to the maintenance of the computer system. These are the
packages which are loaded into computer during time of installation of operating system. They are
used to support, enhance, expand and secure existing programs and data in the computer system.

System utility mainly consists of the following functions

1. Disk Compression It increases the amount of information that can be stored on a hard disk
by compressing all information stored on a hard disk. This utility works automatically and the
user does not need to be aware of its existence.

2. Disk Fragments It detects computer files whose contents are broken across several
locations on the hard disk and moves the fragments to one location to increase efficiency. It
can be used to rearrange files and unused space on your hard disk.

3. Backup Utilities It can make a copy of all information stored on a disk and restore either the
entire disk or selected files.

4. Disk Cleaners It is used to find files that have not been used for a long time. This utility also
serves to increase the speed of a slow computer.

5. Anti-Virus It is the utility which is used to scan computer for viruses and prevent the
computer system files from being corrupt.

6. System Profiling Utility provides detailed information about the software installed on the
computer and the hardware attached to it.

7. Network Managers to check the computer network and to log events.


http://edusastra.com

8. Cryptographic utility to encrypt and decrypt files.

2. Developing Software

It is a software which provides service required for the development and execution of application
software. The programming languages, language translator, loader, linker is required for the
application software development.

Programming Languages

A program is a set of instructions that help computer to perform tasks. This set of instructions is also
called as scripts. Programs are executed by processor whereas scripts are interpreted. The languages
that are used to write a program or set of instructions are called "Programming languages".
Programming languages are broadly categorized into three types −

1. Machine level language

2. Assembly level language

3. High-level language

1.Machine Level Language

Machine language is lowest level of programming language. It handles binary data i.e., 0’s and 1’s. It
directly interacts with system. Machine language is difficult for human beings to understand as it
comprises combination of 0’s and 1’s. There is software which translate programs into machine level
language. Examples include operating systems like Linux, UNIX, Windows, etc. In this language, there
is no need of compilers and interpreters for conversion and hence the time consumption is less.
However, it is not portable and non-readable to humans.

2.Assembly Level Language


http://edusastra.com

Assembly language is a middle-level language. It consists of a set of instructions in a specific format


called commands. It uses symbols to represent field of instructions. It is very close to machine level
language. The computer should have assembler to translate assembly level program to machine
level program. Examples include ADA, PASCAL, etc. It is in human-readable format and takes lesser
time to write a program and debug it. However, it is a machine dependent language.

Assembly Language Machine Code

SUB AX, BX 0010101110000011

MOV CX, AX 100010111001000

MOV DX, 0 10111010000000000000000

3.High-level Language

High-level language uses format or language that is most familiar to users. The instructions in this
language are called codes or scripts. The computer needs a compiler and interpreter to convert
high-level language program to machine level language. Examples include C++, Python, Java, etc. It is
easy to write a program using high level language and is less time-consuming. Debugging is also easy
and is a human-readable language. Main disadvantages of this are that it takes lot of time for
execution and occupies more space when compared to Assembly- or Machine-level languages.
Following is a simple example for a high-level language −

if age < 18 {

printf("You are not eligible to vote");

} else{

printf("You are eligible to vote");

Language Year Developer Application Area Nature

BASIC (Beginner’s All John G. Kemeny and Thomas Programming for


purpose Symbolic E. Kurtz at Dartmouth college educational
Instruction Code) 1964 in New Hampshire purposes Interpreted

Dennis Ritchie at Bell System


C 1972 Telephone Labs programming Compiled

System Object
C++ 1983 Bjarne Stroustrup at Bell Labs programming Compiled
http://edusastra.com

Business
COBOL(Common Business management,
Oriented Language) 1959 Grace Hopper string oriented Compiled

FORTRAN (Formula A team of programmers at


Translation) 1957 IBM Calculation Compiled

James Gosling at Sun Internet Oriented Compiled and


Java 1995 Microsystems Programming Interpreted

John Mccarthy at the


Massachusetts Institute of Artificial Compiled and
LISP (List Processing) 1958 Technology (MIT) intelligence Interpreted

Pascal 1970 Niklaus Wirth Education Compiled

A committee of European and


ALGOL (Algorithmic American computer scientists
Language) 1958 Jointly Scientific Purpose Compiled

Language Translator:

A language translator helps in converting programming languages to machine language. The


translated program is called the object code. There are three different kinds of language translator

1. Assembler It is used to convert the assembly language into machine language (i.e.,0 or 1),
This language consists of mnemonic codes which are difficult to learn and is machine
dependent.

2. Compiler It is used to convert the source code (written in high level language) into
machine language. Compiler reads whole source code at a time and trap the errors and
inform to programmer. For each high level language, the machine requires a separate
compiler.

3. Interpreter This language processor converts a high level language program into machine
language by converting it line-by-line. If there is any error in any line during execution, it will
report it at the same time and cannot resume until the error is rectified.
http://edusastra.com

Linker

A linker is a system program that links together several object modules and libraries to form a single
and coherent program (executable). The main purpose of linker is to resolve references among files.
Linker is used to determine the memory locations that code from each module will occupy and
relates its instruction by adjusting absolute references.

Loader

Loader is a kind of system software, which is responsible for loading and relocation of the executable
program in the main memory. It is a part of operating system that brings an executable file residing
on disk into memory and starts its execution process.

Application Software

Application software is a computer software designed to help the user to perform singular or
multiple tasks. It is a set of instructions or program designed for specific uses or applications, that
enable the user to interact with a computer . Application software are also called the end-user
programs. These programs do the real work for users.

There are two types of application software.

1. General Purpose Software

General purpose software’s are designed to perform general tasks.

I. Word Processing Software

A word processor is a software program capable of creating, storing and printing of documents.
Word processors have the ability to create a document and make changes anywhere in the
document. This document can also be saved for modification later on or be opened on any other
computer using the same word processor.

Today, the word processor is one of the most frequently used programs or online services used on a
computer system. E.g., Microsoft Word , WordPerfect (Windows only), Apple works (Mac only),
Open Office. Org etc.

II. Presentation software

Presentation is the practice of showing and explaining the contents of a topic to an audience or
learner visually. People , in a variety of settings and situations, use presentation software to make
http://edusastra.com

their presentations more interesting and professional. e.g., marketing managers use presentation
graphics to present new marketing strategies to their superiors Sales people use this software to
demonstrate products and encourage customers to make purchases. Students use it to create high
quality class presentations. e.g., Microsoft PowerPoint, Corel presentations, Lotus Freelance
Graphics etc.

III. Electronic Spreadsheets

Spreadsheet applications (sometimes referred to simply as spreadsheets) are the computer


programs that accepts data in a tabular form and allow you to create and manipulate spreadsheets
electronically. In Spreadsheet Applications, each value exists in a cell. You can define what type of
data is in each cell and how different cells depend on one another. The relationships between cells
are called Formulas and the names of the cells are called Labels. E.g., Microsoft Excel, Corel Quattro
Pro, Lotus 1-2-3 etc.

IV. Database Management System (DBMS)

A DBMS (Database Management System) refers to the software that is responsible for sorting,
maintaining and utilizing a database. It enables a user to define, create and maintain the database
and provide controlled access on it. A database is a collection of integrated data stored together to
serve multiple applications.

Database management system provide several additional features as,

(a) Remove data redundancy

(b) Elimination of data inconsistency

(c) Data sharing

(d) Data integration

(e) Data security

e.g., Microsoft Access, Corel Paradox, Lotus Approach etc.

V. Desktop Publishing Software

Desktop publishing software is a tool for graphic designers and non-designers to create visual
communications for professional or desktop printing as well as for online or on screen electronic
publishing.

Complete Desktop Publishing (DTP) involves the combination of type setting (choosing font and the
text layout), graphic design, Page layout (how it all fits on the page) and printing the document. e.g.,
Quark Express, Adobe Page Maker, 3B2, Corel Draw, Corel Ventura Illustrator etc.

VI. Graphics Software

Graphics Software or image editing software is an application program or collection of programs that
enables a person to manipulate visual images on a computer system. Most graphics software have
the ability to import and export one or more graphics file formats. Typical graphics software enables
data to be plotted as line chart, bar chart and pie chart. e.g., Adobe Photoshop, Pizza, Microsoft
Publishes etc.
http://edusastra.com

VII. Multimedia Software

Multimedia includes a combination of text, audio, still images, animation, video or interactivity
content forms. The term is used in contrast to media which uses only rudimentary computer display
such as text only or traditional forms of printed or hand produced material.

2. Specific Purpose Software

Specific purpose software are designed to perform specific tasks. This type of application software
generally has one purpose to execute.

Some of the specific purpose application software’s are described below.

I. Inventory Management System and Purchasing System.

It is an attempt to balance inventory needs and requirement to minimize total cost, resulting from
obtaining and holding an inventory. Inventory is a list of goods and materials available in a stock.
Inventory management system is generally used in departmental stores or in an organisation to
keep the records of the stock of all the physical resources.

Modern inventory management systems must have the ability to track sales and available inventory,
communicate with suppliers in near real-time, receive and incorporate other data, such as sessional
demand.

II. Payroll Management System.

Payroll management system is used by all modern organisations to encompass every employee of
the organisation who receives a regular wage or other compensation. All different payment methods
are calculated by the payroll software and the appropriate Pay checks are issued.

III. Hotel Management System

Hotel management system refers to the management techniques used in the hotel sector. These can
include hotel administration, accounts, billing, marketing, housekeeping, front office or front desk.

IV. Reservation System

A reservation system or central reservation system (CRS) is a computerized system used to store and
retrieve information and conduct transactions related to air travel, hotels, car rental, or other
activities. It is an application software which is commonly seen at railway reservation offices, this
software helps the concerned department to automatically check the availability of the seats or
berths of any train and any particular data with incomparable speed.

V. Report Card Generator

It is an application software which is commonly used in schools by the examination department to


prepare and generate the report cards of the students. It performs all possible mathematical
calculations and checks whether a student can be promoted to the next class or not. It can also be
used to calculate the class wise ranking of a student.

VI. Accounting software


http://edusastra.com

Accounting software is an application software that records and processes accounting transactions
within functional modules such as accounts payable, accounts receivable, payroll and trial balance. It
works as an accounting information system.

There are several types of accounting software’s as follows

(a) Accounts payable Software.

(b) Bank Reconciliation Software.

(c) Budget Management Software, etc.

VII. HR Management System

It refers to the systems and processes at the intersection between human resource management
(HRM) and information technology. The function of HR department is generally administrative and
common to all organisations. e.g., Effective Staff, Cezanne HR etc.

VIII. Attendance System

Attendance system is an application software designed to track and optimize the presence of a
person/ student in an organisation or school. Now-a-days, attendance system can be integrated with
customer’s existing time/attendance recording devices like Biometrics/ Access cards. Attendance
management can be done in two ways

(a) Biometric Integration

(b) Manually Attendance Integration

IX. Billing System

It refers to the software that is used to perform the billing process. It handles the tracking of ladled
products and services delivered to a customer or set of customers. e.g., Billing Tracker, Killing etc.

Tit-Bits:

▪ Visual Basic is an interpreted language.

▪ Firmware It is a combination of software and hardware. e.g., ROMs, PROMs and EPROMS.

▪ Freeware It is commonly used for copyrighted software that is given away for free by its
owner.

▪ Pseudo code It is not a programming language. But simply an informal way of describing a
program it does not follow any syntax strictly. In other words. We can say that pseudocode
is an outline of a program. Written in a form that can easily be converted into real
programming statements.

▪ Control Structures It is a statement or block of statements in a programming language that


determines the control flow or sequence of execution of other instructions or statements.

▪ Looping is a control structure which is used in a program to execute a particular set of


statements repeatedly.
http://edusastra.com

Software Licencing:
➢ A software license is a document that provides legally binding guidelines for the use
and distribution of software.
➢ Software licenses typically provide end users with the right to one or more copies of
the software without violating copyrights. The license also defines the responsibilities
of the parties entering into the license agreement and may impose restrictions on how
the software can be used.
➢ Software licensing terms and conditions usually include fair use of the software, the
limitations of liability, warranties and disclaimers. They also specify protections if the
software or its use infringes on the intellectual property rights of others.
➢ Software licenses typically are proprietary, free or open source. The distinguishing
feature is the terms under which users may redistribute or copy the software for
future development or use.
Software licenses are important
A software license establishes the rights of all parties involved with the software: the author,
the provider and the end users. It defines the relationship between the software company
and users and explains how they are protected.
Software license agreements protect developers
• They protect developers' intellectual property and trade secrets based on copyright
laws.
• They limit what other parties can do with the covered software code.
• They limit the liability of the vendor.
Software license agreements protect users
• They define what users can do with software code they did not write.
• They establish how users stay in compliance with software licenses, protect
themselves from infringement claims and limit their legal liability.
• They help users maintain a positive relationship with software developers and
vendors.
• They prevent overspending on licenses by establishing clear parameters of how many
licenses an organization needs.
Different types of software licenses?
There are two general types of software licenses that differ based on how they are viewed
under copyright law.
http://edusastra.com

• Free and open source software (FOSS) licenses are often referred to as open
source. FOSS source code is available to the customer along with the software
product. The customer is usually allowed to use the source code to change the
software.
• Proprietary licenses are often referred to as closed source. They provide customers
with operational code. Users cannot freely alter this software. These licenses also
usually restrict reverse engineering the software's code to obtain the source code.

Open Source Software:


Definition
Open source is a term that originally referred to open source software (OSS). Open source software is
code that is designed to be publicly accessible—anyone can see, modify, and distribute the code as
they see fit.

➢ Open source software is developed in a decentralized and collaborative way, relying on peer
review and community production.

➢ Open source software is often cheaper, more flexible, and has more longevity than its
proprietary peers because it is developed by communities rather than a single author or
company.

➢ Open source has become a movement and a way of working that reaches beyond software
production.

➢ The open source movement uses the values and decentralized production model of open
source software to find new ways to solve problems in their communities and industries.

Benefits
1.Lesser hardware costs:Since Linux and open source solutions are easily portable and
compressed, it takes lesser hardware power to carry out the same tasks when compared to
the hardware power it takes on servers, such as, Solaris, Windows or workstations. With this
less hardware power advantage, you can even use cheaper or older hardware and still get the
desired results.
2.High-quality software:Open source software is mostly high-quality software. When you use
the open source software, the source code is available. Most open source software are well-
designed. Open source software can also be efficiently used in coding. These reasons make
open source software an ideal choice for organizations.
3.No vendor lock-in:IT managers in organizations face constant frustration when dealing with
vendor lock-ins'. Lack of portability, expensive license fees and inability to customize software
are some of the other disadvantages. Using open source software gives you more freedom
and you can effectively address all these disadvantages.
http://edusastra.com

4.Integrated management:By using open source software, you can benefit from integrated
management. Open source software uses technologies, such as, common information model
(CIM) and web based enterprise management (WBEM). These high-end technologies enable
you to integrate and combine server, application, service and workstation management. This
integration would result in efficient administration.
5.Simple license management:When you use open source software, you would no longer
need to worry about licenses. Open source software enables you to install it several times and
also use it from any location. You will be free from monitoring, tracking or counting license
compliance.
6.Lower software costs:Using open source software can help you minimize your expenses.
You can save on licensing fees and maintenance fees. The only expenses that you would
encounter would be expenditure for documentation, media and support.
7.Abundant support:You will get ample support when you use open source software. Open
source support is mostly freely available and can be easily accessed through online
communities. There are also many software companies that provide free online help and also
varied levels of paid support. Most organization who create open source software solutions
also provide maintenance and support.
8.Scaling and consolidating
Linux and open source software can be easily scaled. With varied options for clustering, load
balancing and open source applications, such as email and database, you can enable your
organization to either scale up and achieve higher growth or consolidate and achieve more
with less.

Difference between Unix and Windows operating system:

You might also like