Uploaded by luxuriousjoker02

Final Assignment

advertisement
Final Assignment DITS 2213- Operating System
Answer ALL questions.
1. Given below an example of memory configuration after a number of placement and
swapping-out operations. Show the location of new allocation using first-fit, next-fit and
worst-fit placement algorithms in satisfying the following allocation requests:
a. 15M.
b. 20M.
Allocated block
4M
12M
Free block
16M
8M
14M
20M
Last allocated block (10M)
(6 marks)
2. Suppose the OS on your computer uses the buddy system for memory management. Initially
the system has 512M block of memory available.
a. By using diagram, show the results of each memory request/release via memory layout
at each stage according to the followings orders:
A requests 64M
B requests 80M
C requests 150M
Release A
D requests 100M
(10 marks)
b. Calculate the total of internal fragmentation (in M unit) after memory allocation to
request D is fulfilled.
(2 marks)
3. The replacement policy deals with the selection of a page in main memory to be replaced
when a new page is brought in. Given a process has five (5) virtual pages on disk and is
assigned a fixed allocation of three page frames in main memory. If the following page
trace occurs:
1
5
3
2
4
3
5
2
1
6
3
1
a. Show the successive pages residing in the three frames using LRU and Optimal
policies. Show clearly when each page fault would occur.
(8 marks)
b. Between LRU and Optimal policies, which replacement policy displays better
memory performance? Justify your answer.
(2 marks)
4.
Perform the analysis of disk scheduling algorithm from the following sequence of disk
track request:
29, 110, 186, 147, 41, 10, 164, 205
Assume the disk head is initially positioned over track 150 and moving in the direction of
decreasing track number. The analysis should be based on Shortest Seek Time First (SSTF)
and C-SCAN policies. Compute the average seek length for both algorithms.
(10 marks)
5.
Consider the following set of processes:
Table 1: Processes Scheduling
Process
Arrival Time
Service Time
A
0
5
B
2
2
C
4
4
D
8
4
a. Compute the finish time and turnaround time for the following scheduling policies:
i.
Shortest Remaining Time (SRT)
ii.
Shortest Process Next (SPN)
(10 marks)
b. Based from the results in (a), identify which scheduling policy display better
performance. Justify your answer.
(2 marks)
Download