BN104: Introduction to OS: Memory and Process Management

Verified

Added on  2025/04/07

|14
|1555
|173
AI Summary
Desklib provides past papers and solved assignments for students. This solved assignment covers operating systems.
Document Page
Melbourne Institute of
Technology
BN104
Operating system
Assignment one
Introduction to operating systems, Memory and
process management
Student ID:
Student Name:
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Contents
Introduction.....................................................................................................3
B-Q1.................................................................................................................4
a...................................................................................................................4
b...................................................................................................................4
c....................................................................................................................4
d...................................................................................................................4
e...................................................................................................................5
B-Q2.................................................................................................................7
A...................................................................................................................7
B-Q3.................................................................................................................8
a...................................................................................................................8
b.................................................................................................................10
Conclusion.....................................................................................................13
References.....................................................................................................14
Document Page
Introduction
We are going to find out the answer to the following question based on the frames and the paging. We
will get to know the address of the given frames where we will find out the starting and the end
addresses. We will also be going to check the memory allocation term. We are also going to discuss
upon the translation of the Physical address in respect to the Logical address. We will also be going to
learn about the relocation of the memory. And at last, we are going to discuss and find out the waiting
and the turnaround time for the different processes.
Document Page
B-Q1
OS
0 0 Page 1
1 1 Page 4
2 2 Page 2
3 3 free
4 4 Page 8
5 5 free
6 6 Page 0
7 7 Page 5
8 8 free
PAGES FRAMES
Table 1
a.
The starting address of frame 1 is 1024. As the frame 0 starting address is from 0 to 1023. After which
the address will start with 1024 to 2047.
Ending address of frame 1 is 2047. As we defined in the above line that the address of the frame 1 is
from 1024 to 2047. The end address is 2047.
b.
Ans:
1. Yes, page 2 is mapped to frame 2 as it is given in the table above that in frame 2 page 2 has been
assigned.
2. No, page 3 is not mapped to frame 3 because in the above-given table page 3 has not been
assigned to any of the frames. Frame 3 has been set free.
c.
The pages which have not been assigned to any of the frames are page 3, page 6, and page 7. As we can
see in the table that frame 3, frame 5, and frame 8 has been set free, that means that no pages have
been loaded in the memory.
d.
As it has been given that page 3 has not been assigned in any of the frame and process A is trying to
access page 3, then it will lead to the blocking state of the process A which is trying to invoke page 3. If it
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
is in the priority case for accessing page 3 then the algorithm which will be used is LRU which stand for
Least Recently Use algorithm. The least recently used page will be swapped with page 3 and the process
which has been blocked will again go to the ready state and again it will try to access page 3. And hence
it will be able to access the page.
Process A goes to the block state while accessing page 3. Then after swapping of the page with the least
use page, it will change its state from block to ready [3].
e.
For this conversion of the logical address to physical address, we need to follow some rules and need to
find out some values to calculate the physical address of the given address.
Given:
Page size=1024
I. For 1023
Need to find out:
Offset = (Logical Address) mod Page size.
= 1023 mod 1024
= 1023
Page number = logical address / page size
= 1023 / 1024
= 0.9
Frame number = it is the correspondence to the frame number
= 1
Now Physical Address = (Page Size * Frame Number) + offset
= (1024 * 1) + 1023
= 2047
II. For 3000
Offset = 3000 mod 1024
= 952
Page no. = 3000/1024
= 2.92
Frame no. = 3
Physical Address = (1024 * 3) + 952
= 3072 + 952
Document Page
= 4024
III. For 4120
Offset = 4120 mod 1024
= 24
Page no. = 4120/1024
= 4.02
Frame no. = 4
Physical Address = (1024 * 4) + 24
= 4096 + 24
= 4120
IV. For 5000
Offset = 5000 mod 1024
= 904
Page no. = 5000/1024
= 4.8
Frame no. = 5
Physical Address = (1024 * 5) + 904
= 6024
Hence the given table will be:
Logical address
maps to
Physical address
1023 2047
3000 4024
4120 4120
5000 6024
Document Page
B-Q2
a
The process of memory compaction is like small chunks which are in the
free space in memory Is combined and collected which is then used to form
a very large chunk. The use of the memory compaction is for the efficient
use of the memory. The drawback of this compaction is that the
performance cannot be done for the static relocation. It is only performed
for the allocation in a dynamic way.
In my point of view, it shall be used and performed with the given optimum
rate. It can be useful for accommodating different process with respect to
time. This will let in the best utilisation of space in the memory. The
drawback for this given process will take more consumption of the CPU and
will used for the chunks which are free to combine them [1].
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
B-Q3
a
i. FCFS which is First Come First Serve.
The representation of the following scheduling algorithm is in the following way:
A B C D E
0 13 19 22 34 36
Required time for completion of each process are as follow:
A – 13
B – 19
C – 22
D – 34
E - 36
ii. SJN it stands for Shortest Job Next.
A E C B D
0 13 15 18 24 36
Required time for completion of each process are as follow:
A – 13
B – 24
C – 18
D - 36
E – 15
iii. SRT stands for Shortest Remaining Time.
A B C B B B E A D
0 1 3 6 7 9 10 12 24 36
Document Page
Required time for completion of each process are as follow:
A – 24
B – 10
C – 6
D – 36
E - 12
iv. Round Robin (Quantum is 3)
A B C D E A B D A D A D A
0 3 6 9 12 14 17 20 23 26 29 32 35 36
The required time for completion of each process is as follow:
A – 36
B – 20
C – 9
D – 35
E – 14
Document Page
b
Waiting Time: Waiting time for the process is that time in which the process is waiting in the ready state
to get executed. The formula to find out the waiting time is
W.T = Difference of the burst time with respect to the turnaround.
Turnaround Time: The time which is required for executing the process. That time is termed as
turnaround time. The formula to find out turnaround time is
TT = difference between the (arrival time + burst time) with respect to the completion time [].
For A:
FCFS:
T.R = 13 – 0 = 13
W.T = 13 – 13 = 0
SJN:
T.R = 19 – 0 = 13
W.T = 13 – 13= 0
SRT:
T.R = 24 – 0 = 24
W.T = 24 – 13 = 11
RR:
T.R = 36 – 0 = 36
W.T = 36 – 13 = 23
For B:
FCFS:
T.R = 19 – 1 = 18
W.T = 18 – 6 = 12
SJF:
T.R = 24 – 1 = 23
W.T = 23 – 6 = 17
SRT:
T.TR = 10 – 1 = 9
W.T = 9 – 6 = 3
R.R:
T.R = 20 – 1 = 19
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
W.R = 19 – 6 = 13
For C:
FCFS
T.R = 22 – 3 = 19
W.T = 19 - 3 = 16
SJF:
T.R = 18 – 3 = 15
W.T = 15 – 3 =12
SRT:
T.R = 6 – 3 = 3
W.T = 3 – 3 = 0
R.R:
T.R = 9 – 3 = 6
W.T = 6 – 3 = 3
For D:
FCFS
T.R = 34 – 7 = 27
W.T = 27 – 12 = 15
SJF:
T.R = 36 – 7 = 29
W.T = 29 – 12 = 17
SRT:
T.R = 36 – 7 = 29
W.T = 29 – 12 = 17
R.R:
T.R = 35 – 7 = 28
W.T = 28 – 12 = 16
For E:
FCFS
T.R = 36 – 9 = 27
W.T = 27 – 2 = 25
SJF:
Document Page
T.R = 15 – 9 = 6
W.T = 6 – 2 = 4
SRT:
T.R = 12 – 9 = 3
W.T = 3 – 2 = 1
R.R:
T.R = 14 – 9 = 5
W.T = 5 – 2 = 3
chevron_up_icon
1 out of 14
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]