0% found this document useful (0 votes)
73 views4 pages

Os Ps 1

The document contains a series of assignment questions related to Operating Systems, focusing on memory management, page replacement algorithms, resource allocation, and disk scheduling. It includes calculations for page faults using various algorithms, memory allocation strategies, and the application of the Banker's algorithm for deadlock avoidance. Additionally, it addresses the implications of different scheduling methods and memory partitioning techniques.

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)
73 views4 pages

Os Ps 1

The document contains a series of assignment questions related to Operating Systems, focusing on memory management, page replacement algorithms, resource allocation, and disk scheduling. It includes calculations for page faults using various algorithms, memory allocation strategies, and the application of the Banker's algorithm for deadlock avoidance. Additionally, it addresses the implications of different scheduling methods and memory partitioning techniques.

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/ 4

Assignment Module-2

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


Subject Name & Code: Operating Systems (BCSC0004)
Submission Date:

Q1: Consider the following page reference string. 1,2,3,4,5,3,4,1,6,7,8,7,8,9,7,8,9,5,4,5,4,2 How


many page faults would occur for the following replacement algorithm, assuming 3, 4 and 5
frames respectively?
a. Optimal page replacement. b. LRU page replacement. c. FIFO page replacement

Q2: 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.

Q3: Calculate page faults for (LRU, FIFO, OPT) for following sequences where page frame is
three.
0,1,2,1,4,2,3,7,2,1,3,5,1,2,5.

Q4: 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?

Q5: 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?
Q6: 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?

Q7. 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.

Q8. 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.

Q9. Describe the SSTF disk scheduling algorithm using the following data. The dist head is
initially at position-cylinder 53.the cylinder sequence of requests is 98, 183, 37, 122, 14, 124, 65.
67. Find the total head movement.

Q10. Suppose that a disk drive has 5000 cylinders, numbered 0 to 4999. The drive currently
services a request at cylinder 143, and the previous request was at cylinder 125. the queue of
pending request in FIFO order is 86,1470,913,1774,948,1509,1022,1750,130 Starting from the
current position, what is the total distance(in cylinders) that the disk arm moves to satisfy all
pending requests, for each of the following algorithms i)FCFS ii) SSFT iii) SCAN iv) LOOK v)
C-SCAN.

Q11. The queue of requests in FIFO is 86, 147, 91, 177, 94,150,102,175,130 what is the total
head movement needed to satisfy the requests for the following Scheduling algorithms FCFS,
SJF, SCAN, LOOK, C-SCAN.
Q12. Suppose that the head of moving head disk with 200 tracks numbered 0 to 199 is currently
serving the request at track 143 and has just finished a request at track 125. If the queue request
is kept in FIFO order, 86, 147, 91, 177, 94, 150, 102, 175, 130. What is the total head movement
to satisfy these requests for i) FCFS II) SSTF disk scheduling algorithm

Q13: A system contains three programs and each requires three tape units for its operation. The
minimum number of tape units which the system must have such that deadlocks never arise is
_________.

Q14: Assume that in a certain computer, the virtual addresses are 64 bits long and the physical
addresses are 48 bits long. The memory is word addressable. The page size is 8 kB and the word
size is 4 bytes. The Translation Look-aside Buffer (TLB) in the address translation path has 128
valid entries. At most how many distinct virtual addresses can be translated without any TLB
miss?

Q15: 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.

Q16: 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.

Q17: Assume that there are 3-page frames which are initially empty. If the page reference string
is 1, 2, 3, 4, 2, 1, 5, 3, 2, 4, 6, the number of page faults using the optimal replacement policy
is__________.

Q18: 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?

Q19: Consider the virtual page reference string 1, 2, 3, 2, 4, 1, 3, 2, 4, 1 On a demand paged


virtual memory system running on a computer system that main memory size of 3 pages frames
which are initially empty. Find the number of page faults under the corresponding page
replacements policy.: LRU, FIFO and OPTIMAL.

Q20 A system uses FIFO policy for page replacement. It has 4 page frames with no pages loaded
to begin with. The system first accesses 100 distinct pages in some order and then accesses the
same 100 pages but now in the reverse order. How many page faults will occur?

Q21: A process has been allocated 3 page frames. Assume that none of the pages of the process
are available in the memory initially. The process makes the following sequence of page
references (reference string): 1, 2, 1, 3, 7, 4, 5, 6, 3, 1 If optimal page replacement policy is used,
how many page faults occur for the above reference string?
Q22: In a virtual memory system, size of virtual address is 32-bit, size of physical address is 30-
bit, page size is 16 Kbyte and size of each page table entry is 32-bit. The main memory is byte
addressable. Which one of the following is the maximum number of bits that can be used for
storing protection and other information in each page table entry?

Q23: Consider six memory partitions of size 200 KB, 400 KB, 600 KB, 500 KB, 300 KB and
250 KB. These partitions need to be allocated to four processes of sizes 357 KB, 210 KB, 468
KB and 491 KB in that order.

Perform the allocation of processes using-

1. First Fit Algorithm


2. Best Fit Algorithm
3. Worst Fit Algorithm

You might also like