Operating System Assignment #3, Assignments of Operating Systems

this is the assingment to data base and data and data and its base because the base of data the base of data base itlsel

Typology: Assignments

2019/2020

Uploaded on 10/27/2020

fahad-siddiqui
fahad-siddiqui 🇵🇰

1

(2)

2 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
SIR SYED UNIVERSITY OF ENGINEERING AND
TECHNOLOGY
I NTRODUCTION T O O PERATING S YSTEM
(SWE 204)
ASSIGNMENT # 3
Submitted by :
Muhammad Fahad Siddiqui (2019-SE-206)
Muhammad Ali Hamza (2019-SE-219)
Muhammad Moiz Bakaseer (2019-SE-221)
Shahzaib Ansari (2019-SE-249)
Submitted to :
Miss Falak Saleem
1
pf3
pf4

Partial preview of the text

Download Operating System Assignment #3 and more Assignments Operating Systems in PDF only on Docsity!

SIR SYED UNIVERSITY OF ENGINEERING AND

TECHNOLOGY

INTRODUCTION TO OPERATING SYSTEM

(SWE 204)

ASSIGNMENT # 3 Submitted by : Muhammad Fahad Siddiqui (2019-SE-206) Muhammad Ali Hamza (2019-SE-219) Muhammad Moiz Bakaseer (2019-SE-221) Shahzaib Ansari (2019-SE-249) Submitted to : Miss Falak Saleem

ASSIGNMENT # 3

Question 1 (Solved by 2019-SE-2**)

Suppose we have 64bit logical address with 8KB of page size and size of each entry in the page is 4 Bytes. Calculate the following: (i) Inner page size. (ii) Outer page size. (iii) Page offset

Answer.

Question 2 (Solved by 2019-SE-2**)

Given the following stream of page references by an application, calculate the number of page faults the application would incur with the FIFO, LRU and Optimal page replacement algorithms. Assume that there are 3 frames, and all are initially empty. Reference Stream: E D H B D E D A E B E D E B G.

Answer.

Question 3 (Solved by 2019-SE-2**)

(a) Consider the following data of a system has five processes (P0, P1, P2, P3 and P4) and four types of resources (A, B, C and D). There are multiple resources of each type. Is the following state safe or not? If it is, show how the processes can complete. If not, show how they can deadlock. (b) Draw the resource-allocation graph when the sets Process, Resource, and Edges are: P = {T1, T2, T3, T4} R = {A, B, C, D} E = {T1B, AT1, AT2, BT2, T3B, CT3, T2C, T4C, DT3 and DT4} Assume there exists two instances of resource A and D one instance of resource B and C. As well, assume resources A, B, C and D are non-preemptive and cannot be shared. (i) Draw wait-for-graph with the help of resource allocation graph. (ii) Could a deadlock exist in the system? Briefly explain.

Answer.

(a)

(b)

Question 8 (Solved by 2019-SE-2**)

Please mark whether the following statements are true or false. (i) One way of implementing semaphores on uni-processor machines is by using Peterson’s algorithm. (ii) A critical section is a segment of code that can be executed by more than one process/thread at a time. (iii) Hardware interrupts can be disabled both from user- and kernel-space. (iv) Counting semaphores are the most primitive synchronization mechanisms.

Answer.

Question 9 (Solved by 2019-SE-2**)

Briefly explain the following: (i) Why rotational latency is usually not considered in disk scheduling? How would you modify SSTF, SCAN, and C-SCAN to include latency optimization? (ii) Why must the bit map for file allocation be kept on mass storage, rather than in main memory? (iii) Consider a system that supports the strategies of contiguous, linked, and indexed allocation. What criteria should be used in deciding which strategy is best utilized for a particular file? (iv) How file allocation table (FAT) works? Explain with the help of diagram. (v) What is the difference between deadlock prevention and deadlock avoidance? What category does Bankers algorithm fall in and why?

Answer.