0% found this document useful (0 votes)
67 views5 pages

Operating - System - KCS 401 - Assignment - 2

This document contains an assignment on operating system concepts divided into 5 units. The first unit discusses why caches are not made as large as the devices they cache. The second unit covers differences between signal() and semaphore operations and rules to avoid deadlock in dining philosophers problem. The third unit covers deadlock-free conditions in resource allocation systems and use of banker's algorithm. The fourth unit implements memory allocation policies and covers page table concepts. The fifth unit calculates disk arm movement for different scheduling algorithms based on request queues.

Uploaded by

jdhfdsjfo
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)
67 views5 pages

Operating - System - KCS 401 - Assignment - 2

This document contains an assignment on operating system concepts divided into 5 units. The first unit discusses why caches are not made as large as the devices they cache. The second unit covers differences between signal() and semaphore operations and rules to avoid deadlock in dining philosophers problem. The third unit covers deadlock-free conditions in resource allocation systems and use of banker's algorithm. The fourth unit implements memory allocation policies and covers page table concepts. The fifth unit calculates disk arm movement for different scheduling algorithms based on request queues.

Uploaded by

jdhfdsjfo
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/ 5

ASSIGNMENT - 2

OPERATING SYSTEM KCS 401

Unit-1
1. If a cache can be made as large as the device for which it is caching (for
instance, a cache as large as a disk), why not make it that large and
eliminate the device?

Unit-2
1. How does the signal () operation associated with monitors differ from the
corresponding operation defined for semaphore?
2. Consider the dining-philosopher problem where the chopsticks are placed
at the center of the table and any two of them could be used by a
philosopher. Assumes that request for chopsticks are made one at a time.
Describe a simple rule determining whether a particular request could be
satisfied without causing deadlock given the current allocation of
chopsticks to philosophers.

Unit-3
1. Consider a system consisting of m resources of the same type being
shared by n processes. Resources can be requested and released by
processes only one at a time. Show that the system is deadlock free if the
following two conditions hold:
a. The maximum need of each process is between 1 and m resources.
b. The sum of all maximum needs is less than m+n.
2. Consider the following snapshot of the system:

Allocation Max Available


ABCD ABCD ABCD
P0 0012 0012 1520
P1 1000 1750
P2 1354 2356
P3 0632 0652
P4 0014 0656
Answer the following questions using the banker’s algorithm:
a. What is the content of the matrix Need?
b. Is the system in a safe state?
c. If the request from process P1 arrives for (0, 4, 2, 0), can the request be
granted immediately?

3. What scheduling policy will you use for each of the following case?
Explain your reason for choosing them.

a. The processes arrive at large time interval.


b. The system’s efficiency is measured by the percentage of jobs
completed.
c. All the processes take almost equal amounts of time to complete.
4. What happens if the time allocated in a Round Robin Scheduling is
very large? And what happens if the time allocated is very low?
5. A shortest Job First Algorithm may lead to starvation where a process
with large execution time is made to wait for indefinitely long times. Suggest a
modification to the SJF that overcomes this problem.
6. Suppose a new process in a system arrives at an average of six
processes per minute and each process requires an average of 8 rounds of
service time. Estimate the fraction of time the CPU is busy in a system with a
single processor.
7. Assume you have the following jobs to execute with one processor,
with the jobs arriving in the order listed here:
Burst
time
P0 80
P1 20
P2 10
P3 20
P4 50

a. Suppose a system uses FCFS scheduling. Create a Gantt chart illustrating the
execution of these processes?
b. What is the turnaround time for process P3?
c. What is average wait time for the processes?
8. Using the problem load in the previous problem suppose a system uses SJN
scheduling.
a. Create a Gantt chart illustrating the execution of these processes?
b. What is the turnaround time for process P4?
c. What is the average wait time for the processes?

9. Assume you have the following jobs to execute with one processor, with the
jobs arriving in the order listed here:

Burst time Arrival time


P0 80 0
P1 20 10
P2 10 10
P3 20 80
P4 20 85

a. Suppose a system uses RR Scheduling with a quantum of 15.Create a


Gantt chart illustrating the execution of these processes.
b. What is the turnaround time for process P3?
c. What is the average wait time for the processes?

Unit-4

1. Implement following memory allocation policies with given data


FCFS
First Fit
Best Fit
Available memory: 35units
OS: 10units
User Process: 25 units

Time of 0 3 7 12 18 25 29
arrival(units)
Processing 5 3 9 10 16 2 8
time(units)
Memory 3 5 8 12 2 6 9
required(units)

2. Consider a system with 80% hit ratio, 50 nanoseconds time to search the
associative register, 750 nanoseconds time to access memory. Find the time to
access a page:
a. When the page number is in associative memory.
b. When the time to access a page when not in associative memory.
c. Find the effective access memory time.
3. Consider the Segment table:
What is the physical address for the following logical address?
a. 0,430 b. 1, 10 c. 1, 11 d. 2,500

Segment Base Length


0 219 600
1 2300 14
2 90 100
3 1327 580
4 1952 96

4. Suppose an average page fault service time of 8 milliseconds and a memory


access time of 200 nanoseconds. Calculate the effective access time in
nanosecond.
5. Suppose we have a paging system with 4 frames and 12pages,where the
number of frames denotes the number of pages that can be held in RAM at any
given time. Assume the pages are accessed by some programme in the order
shown below, from left to right. Also assume that the programme has just
started so the frames are initially empty. How many page faults will be
generated assuming that the LRU algorithm is being used?
Ordered in which pages are occurred:

342147253613

6. Find out the page fault using FIFO page replacement.


Reference string is:
123412512345
Taking 3 frames and 4 frames.
7. Reference string is: 2 3 4 2 1 3 7 5 4 3
Find out the page fault using optimal page replacement taking 3 and 4 frames.
8. If the hit ratio to a TLB is 80%and it takes 50 nan0seconds to search the TLB
and 150 nanoseconds to access the main memory, then what must be the
effective memory access time in nanoseconds?
Unit-5
1. Suppose that a disk drive have 5000 cylinders numbered 0 to 4999. The drive
is currently serving 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 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 algorithm?

a. FCFS
b. SSTF
c. SCAN
d. LOOK
e. C-SCAN
f. C-LOOK

2. Work Queue: 23, 89, 132, 42,187. There are 200 cylinders numbered from 0-
199. The disk starts at number 100.
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 algorithm?

a. FCFS
b. SSTF
c. SCAN
d. LOOK
e. C-SCAN
f. C-LOOK

You might also like