OS - Final - Assignment (2021)
OS - Final - Assignment (2021)
OS FINAL ASSIGNMENT
NOTE:
1. On the top of the assignment sheet mention your name, roll-no. name of the Course, name
of the Paper and Semester
2. Also show all calculation at each step.
0 319 600
1 1400 44
2 190 100
3 132 280
4 1052 196
5 2400 38
What are the physical addresses for the following logical addresses and give explanation for the
same.
2. How many processes are there in the system at line 4 and line 8 ? Justify your answer
Line 1: #include <stdio.h>
Line 2: #include <unistd.h>
Line 3: void main()
Line 4: {
Line 5: int i;
Line 6: for (i= 1; i<3; i++)
Line 7: fork();
Line 8: }
3. Assuming a 1-KB page size, what are the page numbers and offsets for the following address
reference (provided as decimal numbers):
I. 2378
II. 19360
III. 34560
Q5. Suppose there is a system with 200 KB of memory with no memory initially allocated.
Given the following sequence of requests by the processes, show the memory layout at
every stage for Best-fit allocation algorithm.
Process Number Nature of Request Amount of memory requested (in KB)
P0 Allocation 30
P1 Allocation 25
P2 Allocation 10
P3 Allocation 25
P0 Deallocation
P3 Deallocation
P4 Allocation 8
P5 Allocation 10
Q6. Consider a logical address space of 64 pages with 2-KB frame size
mapped onto a physical memory of 128 KB.
a. How many bits are there in the logical and physical addresses?
b. How what is the breakup of offset and page number in the logical
address?
Q7.Suppose Consider a disk drive has 200 cylinders numbered from 0 to 199. The request for 62
is being serviced and is moving towards track 99 and the disk request queue contains
read/write requests for the sectors on tracks 184, 55, 103, 96 and 197, respectively. What
is the total number of head movements needed to satisfy the requests in the queue using:
i. FCFS
ii. LOOK
iii. C-SCAN
Q8. At a particular time of computation the value of a counting semaphore is 7. Then 15 wait()
operations and 20 signal() operations were completed on this semaphore. Determine the
resulting value of the semaphore?
i. A flight simulator
ii. Word processor
iii. Generating monthly bank statement
iv. Weapon system
v. Flight Simulator
Q10. A program has just read the first record. It next wants to read the tenth record. How many
records must the program read to input the tenth record using the following access methods?
i. Direct Access
ii. Sequential Accesss
Q11. Explain what may happen if setting the values of Base and Limit registers are not
privileged instructions? Also why is it easy to add a new service in microkernel approach?
Q12. What will happen if a user program to get stuck in an infinite loop and never return control
to the operating system. Explain how operating system deals with such problem?
Q13. Also consider two programmers are working on a joint project. Common Files associated
with the project should be stored in their directory. Which directory implementation structure
they should use and why? Also differentiate between Absolute and Relative pathname.
Q14. A program has just read the fifth record. It next wants to read the ninth record. How many
records must the program read to input the ninth record using the following access methods?
Explain.
i. Sequential Access
ii. Direct Access
Q15. And which network configuration LAN or WAN would best suit the following
environments? Explain.