0% found this document useful (0 votes)
74 views3 pages

Ps 2 Os

The document outlines an assignment for a B.Tech (CSE) course on Operating Systems, covering various topics including memory allocation strategies, resource management using the Banker's algorithm, deadlock scenarios, and system states. It includes multiple questions requiring calculations and analysis related to memory holes, resource allocation, and system safety. The assignment emphasizes understanding of key concepts in operating systems and their practical applications.

Uploaded by

himanshusinghr32
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views3 pages

Ps 2 Os

The document outlines an assignment for a B.Tech (CSE) course on Operating Systems, covering various topics including memory allocation strategies, resource management using the Banker's algorithm, deadlock scenarios, and system states. It includes multiple questions requiring calculations and analysis related to memory holes, resource allocation, and system safety. The assignment emphasizes understanding of key concepts in operating systems and their practical applications.

Uploaded by

himanshusinghr32
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Assignment:Module-2

Course: B.Tech (CSE) Year/Semester: II/IV Session: 2023-2024


Subject Name & Code: Operating Systems (BCSC0004)

Q1: Free memory holes of sizes 15K, 10K, 5K, 25K, 30K, 40K are available. The processes of
size 12K, 2K, 25K, 20K is to be allocated. How processes are placed in first fit, best fit, worst
fit. Calculate internal as well as external fragmentation.

Q2: System snapshot:

a) How many resources are there of type (A, B, C)?


b) What are the contents of the Need matrix?
c) Is the system in a safe state? Why?
d) If a request from process P1 arrives for additional resources of (0, 5, 2), can the Banker's
algorithm grants the request immediately?
e) What would be the new system state after the allocation?

Q3: Consider a system consisting of four resources of the same type that are shared by three
processes, each of which needs at most two resources. Is this system deadlock-free? Why or
why not?

Q4: Consider the following snapshot-

Answer the following questions using banker’s algorithm:


a) What are contents of matrix end?
b) Is the system in safe state?
c) If request for process p1 arrives for (0, 4, 2, 0) .Can the request be granted
immediately?
Q5. Given 3 processes A,B and C, three resources x,y and z and following events, i) A requests
x ii) A requests y iii) B requests y iv) B requests z v) C requests z vi) C requests x vii) C
requests y Assume that requested resources should always be allocated to the request process
if it is available. Draw the resource allocation graph for the sequences. And also mention
whether it is a deadlock? If it is, how to recover the deadlock.

Q6. An operating system uses the Banker’s algorithm for deadlock avoidance when managing
the allocation of three resource types X, Y, and Z to three processes P0, P1, and P2. The table
given below presents the current system state. Here, the Allocation matrix shows the current
number of resources of each type allocated to each process and the Max matrix shows the
maximum number of resources of each type required by each process during its execution.

There are 3 units of type X, 2 units of type Y and 2 units of type Z still available. The
system is currently in a safe state. Consider the following independent requests for
additional resources in the current state:

Req1: P0 requests 0 units of X, 0 units of Y and 2 units of Z


Req2: P1 requests 2 units of X, 0 units of Y and 0 units of Z
Can the requests be granted immediately?

Q7. A system shares 9 tape drives. The current allocation and maximum requirement of tape
drives for 4 processes are shown below:

Describe the current status of the system as safe or unsafe.

Q8: Consider a computer system with 40-bit virtual addressing and page size of sixteen
kilobytes. If the computer system has a one-level page table per process and each page table
entry requires 48 bits, then the size of the per-process page table is __________ megabytes.

Q9: A computer system implements 8 kilobyte pages and a 32-bit physical address space. Each
page table entry contains a valid bit, a dirty bit, three permission bits, and the translation. If the
maximum size of the page table of a process is 24 megabytes, the length of the virtual address
supported by the system is ________ bits.

Q10: Consider a paging hardware with a TLB. Assume that the entire page table and all the
pages are in the physical memory. It takes 10 milliseconds to search the TLB and 80
milliseconds to access the physical memory. If the TLB hit ratio is 0.6, the effective memory
access time (in milliseconds) is

You might also like