0% found this document useful (0 votes)
41 views

Practice Problem Set OS

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views

Practice Problem Set OS

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Practice Problem: Memory Management

1. Define memory management in the context of a basic bare machine and resident monitor.
2. Explain how memory is organized and accessed in these systems.
3. Define multiprogramming and fixed partitions.
4. Explain how fixed partitions are allocated to multiple programs.
5. Discuss the advantages and limitations of this memory management technique.
6. Compare and contrast variable partitions with fixed partitions.
7. Explain the challenges and benefits of managing memory with variable partitions.
8. Define paging and segmentation.
9. Explain how paging and segmentation are implemented in memory management.
10. Define paged segmentation and its purpose.
11. Explain the process of combining paging and segmentation in memory management.
12. Define virtual memory and its significance in modern computing. Explain how virtual memory is
implemented.
13. Discuss the advantages of virtual memory over physical memory.
14. Define demand paging and explain its role in virtual memory.
15. Discuss how demand paging works and when it is triggered.
16. Explain the benefits and challenges of demand paging.
17. Discuss factors that influence the performance of demand paging.
18. Discuss the effects of thrashing on system performance. Explain strategies to mitigate thrashing.
19. Explain how cache memory is organized and accessed.
20. Discuss the benefits of cache memory in improving system performance.
21. Define locality of reference and its importance in memory management.
22. Explain the principles of temporal and spatial locality.
23. Discuss how memory management techniques leverage locality of reference to improve performance.
24. Define protection schemes in the context of memory management.
25. Explain how protection schemes are implemented to ensure the security and integrity of memory.

Numerical problem on Page replacement Algorithm.


1. Consider a system with 4 frames and the following reference string: 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5.
Using the FIFO page replacement algorithm, what is the total number of page faults?
2. Given a reference string of length 10: 7, 0, 1, 2, 0, 3, 0, 4, 2, 3. If the system has 3 frames and uses the
Optimal page replacement algorithm, how many page faults occur?
3. Consider a system with 5 frames and the following reference string: 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5. If
the system uses the LRU page replacement algorithm, how many page faults occur?
4. Given a reference string of length 12: 3, 4, 2, 3, 1, 4, 5, 1, 2, 5, 3, 4. If the system has 4 frames and uses
the MRU Page replacement algorithm how many page faults occur?
5. Consider a reference string: 4, 7, 6, 1, 7, 6, 1, 2, 7, 2. the number of frames in the memory is 3. Find out
the number of page faults respective to: 1. Optimal Page Replacement Algorithm 2. FIFO Page
Replacement Algorithm 3. LRU Page Replacement Algorithm.

Numerical problem on Paging

1. Consider a computer system with a 32-bit virtual address space and a page size of 4KB. If the system
uses a two-level page table with each table fitting in a single page, what is the size of the outer page
table?

2. Consider a system with a 32-bit virtual address space and a page size of 4KB. If the page table entry size
is 8 bytes, what is the size of the page table in bytes for a process that has 64 entries in its page table?

3. Given a system with a 128-bit virtual address space and a page size of 32KB, if the page table entry size
is 8 bytes, what is the maximum number of page table entries that can fit in a single page?
4. Consider a machine with 64 MB physical memory and a 32bit virtual address space. If the page size is 4
KB, what is the approximate size of the page table?

5. Consider a computer system with a 36-bit virtual address space and a page size of 2KB. If the page table
entry size is 6 bytes, what is the size of the page table in bytes for a process that has 128 entries in its
page table?

6. Assume an average page-fault service time is 25 milliseconds and a memory access time is 100
nanoseconds. Find the Effective Access Time? Effective Access Time (EAT)= (1 – p) x (ma) + p x (page
fault time)

Dead Lock numerical problem

Q1 Consider a system with three resource types (A, B, C) and three processes (P1, P2, P3). The maximum resource
requirement, allocation, and current available resources for each process and resource type are given below:

Using the Banker's algorithm, determine if the system is in a safe state or deadlock. Show your work step
by step, including the calculation of the need matrix, the work and finish arrays, and the sequence of
processes. If the system is in deadlock, explain which processes are deadlocked and why. Propose a
resource allocation strategy that prevents deadlock in the given system. Justify your choice of strategy
and explain how it avoids deadlock.
Q2. Consider a system with four resource types A, B, C, and D, and four processes P1, P2, P3, and P4.
The maximum resource requirement and allocation for each process are as follows:
Process P1: Max (2, 1, 1, 2), Allocation (1, 0, 0, 1)
Process P2: Max (2, 2, 1, 1), Allocation (1, 1, 0, 0)
Process P3: Max (1, 2, 2, 1), Allocation (0, 1, 1, 0)
Process P4: Max (1, 1, 1, 1), Allocation (1, 1, 1, 1)
Initially, the available resources are (2, 1, 1, 2). Determine whether the system is in a deadlock state or
not. If so, identify the deadlock and the processes involved. If not, explain why the system is deadlock-
free.

Numerical Problem on Memory allocation:

1. The sequence of requests for blocks of size 300, 25, 125, 50 can be satisfied if we use Either first fit or
best fit policy (any one).
2. 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-First Fit Algorithm Best Fit Algorithm Worst Fit
Algorithm.

3. Consider the requests from processes in given order 300K, 25K, 125K, and 50K. Let there be two
blocks of memory available of size 150K followed by a block size 350K.
Which of the following partition allocation schemes can satisfy the above requests?
A) Best fit but not first fit.
B) First fit but not best fit.
C) Both First fit & Best fit.
D) neither first fit nor best fit.
4. Consider a system with 32 KB of physical memory and the following memory allocation requests
from processes: Process P1 requests 10 KB of memory. Process P2 requests 6 KB of memory
Process P3 requests 12 KB of memory. Process P4 requests 4 KB of memory. Process P5 requests 8
KB of memory. The system uses the following memory allocation techniques:1. First Fit 2.
Best Fit 3. Worst Fit

Practice problem: I/O Management and Disk Scheduling

1. Explain the concept of I/O devices and subsystems.


2. Discuss various types of I/O devices and their functionalities.
3. Describe different buffering techniques used in I/O operations.
4. Explain the role of disk storage in computing systems.
5. Discuss the structure and components of a typical disk storage system.
6. Discuss various disk scheduling algorithms such as FCFS, SSTF, SCAN, C-SCAN. Analyze the
advantages and disadvantages of each algorithm.
7. Explain the structure and attributes of a file. Discuss different file types and their uses.
8. Compare and contrast different file organization and access mechanisms.
9. Discuss the structure and organization of file directories.
10. Discuss the importance of file system security and protection mechanisms in modern computing
environments.
11. Describe common file system security threats such as malware, data breaches, and insider attacks.
Discuss strategies for mitigating these threats and enhancing file system security.
12. Define RAID (Redundant Array of Independent Disks) and explain its purpose in data storage systems.
Discuss the different RAID levels (e.g., RAID 0, RAID 1, RAID 2, RAID 3, RAID 4, RAID 5 and 6).

Numerical problem on Disk scheduling

13. Consider one disk with 200 cylinders, numbered 0 to 199. Assume the current position of head is at
cylinder 66. The request queue is given as follows: 55, 32, 6, 99,58, 71, 86, 153, 11, 179, 42. Answer for
each of the following disk-scheduling algorithms: (i)First Come First Served FCFS (ii ) Shortest Seek
Time First (SSTF) (iii)SCAN (iv)C-SCAN (iv)LOOK (v)C-LOOK Count the total distance (in cylinders)
of the disk arm movement to satisfy the requests.

14. Consider an imaginary disk with 51 cylinders. A request comes in to read a block on cylinder 11.
While the seek to cylinder 11 is in progress, new requests come in for cylinders 1, 36, 16, 34, 9, and 12,
in that order. Starting from the current head position, what is the total distance (in cylinders) that the disk
arm moves to satisfy all the pending requests, for each of the following disk scheduling Algorithms? 1.
FCFS (First come first serve) 2. SSTF (Shorted seek time first) 3. SCAN 4. C-SCAN 5. LOOK (Elevator)
6. C-LOOK.

15. Suppose the order of requests are 70, 140, 50, 125, 30, 25, 160 and the initial position of the Read-Write
head is 60. Answer for each of the following disk-scheduling algorithms: (i) First Come First Served
FCFS (ii) Shortest Seek Time First (SSTF) (iii)SCAN (iv)C-SCAN (iv)LOOK (v)C-LOOK Count the
total distance (in cylinders) of the disk arm movement to satisfy the requests.

You might also like