BN104 Operating Systems Assignment: Memory and Process Scheduling

Verified

Added on  2023/06/07

|7
|1027
|464
Homework Assignment
AI Summary
This assignment solution delves into key aspects of operating systems, addressing memory management, process scheduling, and related algorithms. The solution begins by analyzing memory allocation, including demand paging and virtual memory concepts. It then explores process scheduling algorithms like FCFS, SJN, SRT, and Round Robin, providing detailed examples and turnaround/waiting time calculations. The document also covers logical address calculations and page replacement strategies such as LRU. The assignment incorporates the use of the status bit for the LRU algorithm for new entries and validation of the new entries. Finally, it includes a bibliography of relevant sources.
Document Page
Running head: OPERATING SYSTEM
Operating System
Name of the Student:
Name of the University:
Author Note
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
1
OPERATING SYSTEM
Answer to question number 1
a. Page 4 is at that start of frame 1
b. Yes, Page 2 has been mapped to frame 2.
No page 3 has not been mapped to frame 3.
c. 3,6 and 7 are the pages which are yet to be loaded into the memory.
d. When the process A is referencing any type of address in page number 3, the address
is looked up in the reference table by the CPU and CPU would not be able to get the
address from the reference table and a miss would be returned from the cache. Hence
the CPU would have to look for the resource which is present in the memory of the
computer and this would result in to the process going in to the waiting phase.
e. The address corresponding to the logical addresses are:
1023 mod log (1023) = 1
3000 mod log (3000) = 2988
4120 mod log (4120) = 4107
5000 mod log (5000) = 4987
Answer to question number 2
a.
Document Page
2
OPERATING SYSTEM
The pages would be replaced in the following order: 3, 16,8,1,18,4,15,12.
b. The status bit is used for the LRU algorithm for the new entries and validation of the new
entries.
Order of replacement of the bit is in the LRU algorithm: 18,12,8,3,0,16,14,6.
Answer to question number 3
a.
FCFS
A A A A A A A A A A A A B B B B B C C D D D D D D D D D D D E
0 1 2 3 4 5 6 7 8 9 1
0
1
1
1
2
1
3
1
4
1
5
1
6
1
7
1
8
1
9
2
0
2
1
2
2
2
3
2
4
2
5
2
6
2
7
2
8
2
9
3
0
3
1
Document Page
3
OPERATING SYSTEM
SJN
A A B B C C B B B E A A A A A A A A A A D D D D D D D D D D D
0 1 2 3 4 5 6 7 8 9 1
0
1
1
1
2
1
3
1
4
1
5
1
6
1
7
1
8
1
9
2
0
2
1
2
2
2
3
2
4
2
5
2
6
2
7
2
8
2
9
3
0
3
1
SRT
A A B B C C B B B E A A A A A A A A A A D D D D D D D D D D D
0 1 2 3 4 5 6 7 8 9 1
0
1
1
1
2
1
3
1
4
1
5
1
6
1
7
1
8
1
9
2
0
2
1
2
2
2
3
2
4
2
5
2
6
2
7
2
8
2
9
3
0
3
1
Round Robin
A A A B B B C C D D D E A A A B B D D D A A A D D D A A A D D
0 1 2 3 4 5 6 7 8 9 1
0
1
1
1
2
1
3
1
4
1
5
1
6
1
7
1
8
1
9
2
0
2
1
2
2
2
3
2
4
2
5
2
6
2
7
2
8
2
9
3
0
3
1
b.
Turnaround time: The turnaround time is measured by the total time required by a process to
be completed.
Waiting time: The total waiting time is the total time that a process would have to wait before
it gets allocated for processing.
FCFS
Process Arrival Time Burst Time Completion
Time
Turnaround
Time
Waiting
Time
A 0 12 12 12 0
B 2 5 17 15 10
C 4 2 19 15 13
D 6 11 30 24 13
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
4
OPERATING SYSTEM
E 9 1 31 22 21
Average Turnaround Time: (12+15+15+24+22)/5 = 17.6
Average Waiting Time: (0+10+13+13+21)/5 = 11.4
SJN
Process Arrival Time Burst Time Completion
Time
Turnaround
Time
Waiting
Time
A 0 12 20 20 8
B 2 5 9 7 2
C 4 2 6 2 0
D 6 11 31 25 14
E 9 1 10 1 0
Average Turnaround Time: (20+7+2+25+1)/5 = 11
Average Waiting Time: (8+2+0+14+0)/5 = 4.8
SRT
Process Arrival Time Burst Time Completion
Time
Turnaround
Time
Waiting
Time
A 0 12 20 20 8
B 2 5 9 7 2
C 4 2 6 2 0
D 6 11 31 25 14
E 9 1 10 1 0
Document Page
5
OPERATING SYSTEM
Average Turnaround Time: (20+7+2+25+1)/5 = 11
Average Waiting Time: (8+2+0+14+0)/5 = 4.8
Round Robin
Process Arrival Time Burst Time Completion
Time
Turnaround
Time
Waiting
Time
A 0 12 29 29 17
B 2 5 17 15 10
C 4 2 8 4 2
D 6 11 31 25 14
E 9 1 12 3 2
Average Turnaround Time: (29+15+4+25+3)/5 = 15.2
Average Waiting Time: (17+10+2+14+2)/5 = 9
Document Page
6
OPERATING SYSTEM
Bibliography
[1] Moraru, I., Andersen, D.G., Kaminsky, M., Tolia, N., Ranganathan, P. and Binkert, N,
November. Consistent, durable, and safe memory management for byte-addressable non
volatile main memory. In Proceedings of the First ACM SIGOPS Conference on Timely
Results in Operating Systems (p. 1). ACM., 2013.
[2] Sirohi, A., Pratap, A. and Aggarwal, M. Improvised Round Robin (CPU) Scheduling
Algorithm. International Journal of Computer Applications, 99(18), pp.40-43., 2014.
chevron_up_icon
1 out of 7
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]