Operating System Scheduling Algorithms Analysis

Verified

Added on  2020/10/05

|13
|2335
|376
AI Summary
The assignment provides a detailed analysis of various scheduling algorithms in operating systems, including First-Come-First-Served (FCFS), Shortest Job First (SJF), and Round Robin. The report calculates the start time and finish time for each job using these algorithms and compares their performance. Additionally, it discusses internal and external fragmentation in operating system memory management.

Contribute Materials

Your contribution can guide someone’s learning journey. Share your documents today.
Document Page
Operating System

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
TABLE OF CONTENTS
INTRODUCTION...........................................................................................................................3
Task 1...............................................................................................................................................3
Operating System........................................................................................................................3
Document Page
INTRODUCTION
OS is a computer application that interacts between user and system. It manages all the
resources and operations of computer. These resources include CPU, file storage, system
memory, network connections and I/O devices. In this report described the operating system, its
types, characteristics etc. Different algorithm is used in this report to solve the given problems.
Task 1
Operating System
OS is a programme that is installed in computer with the help of boot program and
manages all other program of system. These other program are basically known as applications.
The applications use operating system with the help of Application Program Interface (API).
Characteristics of Operating System-
Il
lustration 1: OS
(Source: operating system, 2018)
Document Page
11 Memory Management- Operating system allocates memory when a process or program
requests and keep track record of primary memory.11 Process Management- It allocates and deallocates the processor (CPU) as per the need
of system.11 File Management- It manages file storage i.e. allocates and deallocates the resources.11 Security- It protects from unauthorized access to programs by password, pon and other
techniques.
System performance Controls- OS records delays between content for service from computer.11 Operators Interactions- The action done between operator and system through
instructions.
Operating system Types
1. Batch Operating System- In BOS there is no direct interaction of computer. There is a
sequence of similar jobs which operator takes and group them into batches. For Example-
Payroll System, Bank Statements etc (Feng,Yang and Wang, 2018).
2. Time Sharing Operating System- In this every task has give some time for performing,
so that every task works smoothly. These are multitasking system. For Example- Multics,
Unix etc.
3. Distributed Operating System- It manages many systems and can combine to a songle
platform. These are also called loosely coupled system. For Example- LOCUS etc.
4. Networking Operating System- They work in various OS and can connect with
common network. It allows shared access pof files, printers, security, applications and
other networking functions. For Example- MS window server 2003, 2008, UNIX, Linux,
Novell NetWare etc.
5. Real Time Operating System- These type of system works on real time. The time
interval for process and respond to inputs is very small. For Example- Scientific
experiments, Medical imaging system, robots, air traffic control system etc.
Operating system is set of program and overall operations that is performing different
functions in computer system. This is the main part of hardware system to control their memory
allocation, control input and output, job scheduling etc. There are different type of operations
system such as Linux, Mac operating system, windows etc. Operating system like Linux that is
designed by Microsoft. It is very powerful operating system. Most of the organizations use this

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
technique because it provides safety and security in the computer system. It is a host application
program that run on hardware machine (DiLuoffo, Michalson and Sunar,2018). Operating
system is one of challenging features which help for reconfiguration of computing system. This
article will provide the historical review and summarize the entire concept of operating system.
The main purpose of this article to determine the pattern of system which are already
available in marketplace. Abstraction is concept in operating system and it is powerful
mechanism to handle and maintain the common task of hardware system. There are different
models applicable in operating system to provide the efficient computing services to customer
and clients.
ï‚· Partitioning
ï‚· scheduling
ï‚· input and output protection
ï‚· Application loading
ï‚· Internal memory management
Resource management is important for operating system to solve the issue and problem
of partitioning reconfiguration. In operating system, reconfiguration logic cannot be solved and
manage in network. Job scheduling is main concept in the hardware system ans it will calculate
the system creations or also adopt the runtime creations. Operating system provide the protection
to application and support hardware (Li Feng Chen and Huang, 2018). First of all, implementing
different operations on privilege level on the other hand, operating system is managed the
memory management in hardware system. The above discussion, it can be determines that
operating system id mainly focus on the application and allow executing different functions
between CPU and hardware system.
Q2. Given the following information:
Job List
Job Number Memory Requested
Job A 57k
Job B 920k
Job C 50k
Job D 701k
Memory Block List
Document Page
Memory Block Memory Block Size
Block 1 900k
Block 2 910k
Block 3 200k
Block 4 300k
a. Use the best-fit algorithm to indicate which memory blocks are allocated to each of the
four arriving jobs.
Job A - 57k
Allocated in 200 Memory block
200-57= 143 Free Size
Job B- 920 K
Cannot fit in both blocks 1 and 2. Two blocks are used to fit. Even so much memory is not
wasted so it fit Block 2
Allocated in Block 2 910K and remaining 10 to other block.
Job C- 50k
Allocated in 200 Memory block i.e. 143 free memory
143-50= 93 Free Size
Job D- 701k
Allocated in 900 Memory block
900- 701= 199 Free Size
b. Use the first-fit algorithm to indicate which memory blocks are allocated to each of the
four arriving jobs.
Job A - 57k
Allocated in 900 Memory block
900-57= 843 Free Size
Job B- 920 K
Document Page
It takes both block 1 and 2 but Block 1 is busy for Job A so it has to wait for completion of Job A
Job C- 50k
Allocated in 200 Memory block
200-50= 150 Free Size
Job D- 701k
Job D is fit in both block 1 and 2 but it is not possible so it has to wait for other blocks as Job A
and C finish then it fits.
900- 701= 199 Free Size
So in First fit algorithm the memory waste is more than best-fir algorithm.
Hence, Best-fit Algorithm turns out to be best for the problem.
Q3. Difference between internal fragmentation and external fragmentation.
Ans:
Internal fragmentation External fragmentation
Basic IF is occurred when it allocates
fixed size memory blocks and
also allocate processes.
EF is occurred when the
variable size memory space
allocate of process
dynamically.
Occurrence In case, the memory can
assigned to process and it is
slightly larger that memory
request. It creates free apace
memory allocation in the form
of blocks.
External process occur when
the process remove form
memory and it creates free
memory space which cause
external fragmentation.
Solution The memory must be
partitioned into the size blocks.
It also assigns the best value
that will fit in the process.
It is very compaction,
segmentation and paging.

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Q4. If a program has 471 bytes and will be loaded into page frames of 100 bytes each, and the
instruction to be used is at byte 132, answer the following questions:
a. How many pages are needed to store the entire job?
= 471/100+1
= 5
b. Compute the page number and exact displacement for each of the byte addresses where
the data is stored. (Remember that page numbering starts at zero)
To store page number: 3 bits
To store offset: 7 bits
5. Given that main memory is composed of only three page frames for public use and that a
seven-page program (with pages a, b, c, d, e, f, g) that requests pages in the following order: a,
c, a, b, a, d, a, c, b, d, e, f
a. Using the FIFO page removal algorithm, indicate the movement of the pages into and
out of the available page frames (called a page trace analysis) indicating each page fault
with an asterisk (*). Then compute the failure and success ratios.
Page request ab ac d aef gcbg
Page Fault ** ** * *** ****
Page 1 aa aa d ddf f f bb
Page 2 b bb b aaagggg
Page 3 c c ceeeeccc
Total faults: 10
Failure: 10/12
83.33%
Total faultless: 2
Success: 2/12
16.66e%
Document Page
b. Increase the size of memory so it contains four page frames for public use. Using the
same page requests as above and FIFO, do another page trace analysis and compute the
failure and success ratios.
Page request ab ac d aef gcbg
Page Fault ** ** * *** ****
Page 1 aa aa a aeeeebb
Page 2 b bb b bbf f f f
Page 3 c c cccgggg
Page 4 d ddddccc
Total faults: 9
Failure: 9/12
75%
Total faultless: 3
Success: 3/12
25%
c. What general statement can you make from this example? Explain your answer.
Ans : Example b is the best choice of given statement because it can be represented the success
and failure ratio in proper manner.
Failure : Success= 75% : 25%
Five jobs arrive nearly simultaneously for processing and their estimated CPU cycles are,
respectively: Job A = 12, Job B = 2, Job C = 15, Job D = 7, and Job E = 3 ms.
a. Using FCFS, and assuming the difference in arrival time is negligible, in what order
would they be processed? What is the total time required to process all five jobs? What is
the average turnaround time for all five jobs?
Job A=12 ms
Job B= 2 ms
Job A=15 ms
Job B= 7 ms
Document Page
Job A=3 ms
Arrival time= 0
Order of Processing= A-B-C-D-E
Total time for Jobs would be= 12+2+15+7+3= 39 ms
Average Turnaround time for jobs= (0+12+14+29+36+39)/5
=26
b. Using SJN, and assuming the difference in arrival time is negligible, in what order would
they be processed? What is the total time required to process all five jobs? What is the
average turnaround time for all five jobs?
Job A=12 ms
Job B= 2 ms
Job A=15 ms
Job B= 7 ms
Job A=3 ms
Arrival time= 0
Order of Processing= E-B-D-A-C
Total time for Jobs would be= 12+2+15+7+3= 42 ms
Average Turnaround time for jobs= (0+3+8+15+27+42)/5
=19
Q7. Given the following information:
Job Arrival Time CPU Cycle
A 0 15
B 2 2
C 3 14
D 6 10
E 9 1

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
Calculate the start time and finish time for each of the five jobs using each of the following
scheduling algorithms
a. FCFS
Job A:
Start Time- 0
Finish Time-
Job B:
Start Time- 2
Finish Time-
Job C:
Start Time- 3
Finish Time-
Job D:
Start Time- 6
Finish Time- 10
Job E:
Start Time- 9
Finish Time- 1
b. SJF
Job A:
Start Time- 0
Finish Time- 15
Job B:
Start Time- 2
Finish Time- 18
Job C:
Start Time- 3
Finish Time- 42
Job D:
Start Time- 6
Finish Time- 28
Document Page
Job E:
Start Time- 9
Finish Time- 16
c. SRT
Job A:
Start Time- 0
Finish Time- 14
Job B:
Start Time- 2
Finish Time- 3
Job C:
Start Time- 3
Finish Time- 38
Job D:
Start Time- 6
Finish Time- 24
Job E:
Start Time- 9
Finish Time- 10
d. Round Robin
Job A:
Start Time- 0
Finish Time- 39
Job B:
Start Time- 2
Finish Time- 4
Job C:
Start Time- 3
Finish Time- 42
Job D:
Document Page
Start Time- 6
Finish Time- 35
Job E:
Start Time- 9
Finish Time- 17
CONCLUSION
This report discuss about the different algorithms to solve the problems. It also describe
the internal and external fragmentation in the operating systerm.
1 out of 13
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]

Your All-in-One AI-Powered Toolkit for Academic Success.

Available 24*7 on WhatsApp / Email

[object Object]