Operating System Complete
Operating System Complete
Objectives of OS
1. To make the computer system convenient and easy to use for the user.
2. To use the computer hardware in an efficient way.
3. To execute user program and make solving user problems easier.
4. Process management/ Memory management/ File management/ Device management.
[Date] 1
Date: 22-11-2023 AIM 2.0
[Date] 2
Date: 22-11-2023 AIM 2.0
[Date] 3
Date: 22-11-2023 AIM 2.0
Functions of OS
1. Processor management
2. Act as a resource manager
3. Memory management
4. File management
a. FAT: File allocation table
b. NTFS: New technology file system
Encryption/ Decryption feature
5. Security
Firewall and Antivirus
6. Device management
7. Input/ output devices
Device driver management by OS
8. Deadlock prevention
System Hang or Blue Screen of Death Prevention
9. Time management
Fast Processing by system to minimize processing time
10. Coordinates with system software and hardware
[Date] 4
Date: 22-11-2023 AIM 2.0
[Date] 5
Date: 22-11-2023 AIM 2.0
[Date] 6
Date: 22-11-2023 AIM 2.0
There are two types of Multi-Tasking Systems which are listed below.
1. Pre-emptive Multi-Tasking
2. Cooperative Multi-Tasking
Multiprocessing
[Date] 7
Date: 22-11-2023 AIM 2.0
Advantages of RTOS
Fast Processing
Fixed time
Example – RTGS (Real time gross settlement), IMPS (Immediate payment Service)
[Date] 8
Date: 22-11-2023 AIM 2.0
1. Hard RTOS: These operating systems guarantee that critical tasks are completed within
a range of time.
For example, a robot is hired to weld a car body. If the robot welds too early or too late,
the car cannot be sold, so it is a hard real-time system that requires complete car welding
by the robot hardly on time., scientific experiments, medical imaging systems, industrial
control systems, weapon systems, robots, air traffic control systems, etc.
2. Soft RTOS: Soft RTOS accepts a few delays via the means of the Operating system. In this kind
of RTOS, there may be a closing date assigned for a particular job, but a delay for a small amount
of time is acceptable. So, cut off dates are treated softly via means of this kind of RTOS.
For Example, this type of system is used in Online Transaction systems and Livestock
price quotation Systems. Like ATMs, Ticket Booking, Reservation System, etc.
3. Firm RTOS: RTOS of this type have to follow deadlines as well. In spite of its small
impact, missing a deadline can have unintended consequences, including a reduction in
the quality of the product. Example: Multimedia applications.
For Example, this system is used in various forms of Multimedia applications.
4. Deterministic Real-time operating System: Consistency is the main key in this type of
real-time operating system. It ensures that all the task and processes execute with
predictable timing all the time, which make it more suitable for applications in which
timing accuracy is very important. Examples: INTEGRITY, PikeOS.
[Date] 9
Date: 22-11-2023 AIM 2.0
o Easy to layout, develop and execute real-time applications under the real-time
operating system.
o The real-time working structures are extra compact, so those structures require much
less memory space.
o In a Real-time operating system, the maximum utilization of devices and systems.
o Focus on running applications and less importance to applications that are in the
queue.
o Since the size of programs is small, RTOS can also be embedded systems like in
transport and others.
o These types of systems are error-free.
o Real-time operating systems have complicated layout principles and are very costly to
develop.
o Real-time operating systems are very complex and can consume critical CPU cycles.
CPU Scheduling
3. Burst Time: Burst time is the total time takes by the process for its execution on the
CPU.
4. Arrival Time: Arrival time is the time when a process enters into the ready sate and
is ready for its execution.
[Date] 10
Date: 22-11-2023 AIM 2.0
5. Exit time: Exit time is the time when a process completes its execution and exit from
the system.
6. Waiting time: It is the time when a process is in the memory waiting to be executed
by the CPU.
7. Response Time: Response time is the time spent when the process is in the ready
state and gets the CPU for the first time.
8. Throughput: Throughput is a way to find the efficiency of a CPU. It can be defined
as the number of processes executed by the CPU in a given amount of time.
Types of Scheduling
Advantages
Disadvantages
[Date] 11
Date: 22-11-2023 AIM 2.0
Advantages
a. It is a more robust method because a process may not monopolize the processor.
b. Each event causes an interruption in the execution of ongoing tasks.
c. It improves the average response time.
d. It is more beneficial when you use this method in a multi-programming environment.
e. The operating system ensures that all running processes use the same amount of CPU.
Disadvantages
a. It requires the use of limited computational resources.
b. It takes more time suspending the executing process, switching the context, and
dispatching the new incoming process.
c. If several high-priority processes arrive at the same time, the low-priority process
would have to wait longer.
The resources are assigned to a Once resources are assigned to a process, they are
process for a long time period. held until it completes its burst period or changes
to the waiting state.
[Date] 12
Date: 22-11-2023 AIM 2.0
Its process may be paused in the When the processor starts the process execution, it
middle of the execution. must complete it before executing the other
process, and it may not be interrupted in the
middle.
When a high-priority process When a high burst time process uses a CPU,
continuously comes in the ready another process with a shorter burst time can
queue, a low-priority process can starve.
starve.
It is flexible. It is rigid.
It affects the design of the It doesn't affect the design of the OS kernel.
operating system kernel.
Its CPU utilization is very high. Its CPU utilization is very low.
Examples: Round Robin and FCFS and SJF are examples of non-Preemptive
Shortest Remaining Time First scheduling.
Scheduling Algorithm
FCFS considered to be the simplest of all operating system scheduling algorithms. First
come first serve scheduling algorithm states that the process that requests the CPU first is
allocated the CPU first and is implemented by using FIFO queue.
[Date] 13
Date: 22-11-2023 AIM 2.0
Characteristics of FCFS:
FCFS supports non-Preemptive and Preemptive CPU scheduling algorithms.
Tasks are always executed on a First-come, First-serve concept.
FCFS is easy to implement and use.
This algorithm is not much efficient in performance, and the wait time is quite
high.
Advantages of FCFS:
Easy to implement
First come, first serve method
Disadvantages of FCFS:
FCFS suffers from Convoy effect.
The average waiting time is much higher than the other algorithms.
FCFS is very simple and easy to implement and hence not much efficient.
Characteristics of SJF:
Shortest Job first has the advantage of having a minimum average waiting time
among all operating system scheduling algorithms.
It is associated with each task as a unit of time to complete.
It may cause starvation if shorter processes keep coming. This problem can be solved
using the concept of ageing.
[Date] 14
Date: 22-11-2023 AIM 2.0
Disadvantages of SJF:
One of the demerits SJF has is starvation.
Many times, it becomes complicated to predict the length of the upcoming CPU
request
3. Round Robin
Round Robin is a CPU scheduling algorithm where each process is cyclically assigned a
fixed time slot. It is the Preemptive version of First come First Serve CPU Scheduling
algorithm. Round Robin CPU Algorithm generally focuses on Time Sharing technique.
Each process gets a small unit of CPU time (time quantum), usually 10-100 milliseconds.
After this time has elapsed, the process is pre-empted and added to the end of the ready
queue.
Timer interrupts every quantum to schedule next process.
Spooling
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
[Date] 15
Date: 22-11-2023 AIM 2.0
Note: The older MS-DOS FAT file system supports a maximum of 8 characters for the base
file name and 3 characters for the extension, for a total of 12 characters including the dot
separator. This commonly known as an 8.3 file name. So, the naming convention in DOS was
8.3
Wildcard characters
[Date] 16
Date: 22-11-2023 AIM 2.0
Points to remember
[Date] 17
Date: 22-11-2023 AIM 2.0
[Date] 18
Date: 22-11-2023 AIM 2.0
[Date] 19
Date: 22-11-2023 AIM 2.0
[Date] 20