0% found this document useful (0 votes)
422 views6 pages

Operating System Model Answers

This document is a model answer sheet for an Operating Systems class test containing multiple choice and descriptive questions. The test covers topics like CPU scheduling algorithms, memory management techniques, page replacement algorithms, and performance metrics. It provides the questions, expected answers, and marking schemes. For each question, the key points and concepts are assessed.
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)
422 views6 pages

Operating System Model Answers

This document is a model answer sheet for an Operating Systems class test containing multiple choice and descriptive questions. The test covers topics like CPU scheduling algorithms, memory management techniques, page replacement algorithms, and performance metrics. It provides the questions, expected answers, and marking schemes. For each question, the key points and concepts are assessed.
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/ 6

Department of Computer Engineering (NBA Accredited)

Model Answer Sheet

Academic Year: 2022-2023 Class Test: 2


Course Name and Code: Operating System (22516) Class: CO5I
Name of Course Teacher: Vijay Patil
Q. Sub Answer Marking
No QN Scheme
1 Attempt Any Five of the following 08
a. Write Unix Commands for following 02
1) Create three empty files f1 f2 f3 ( ½ m for
2) List inode number of files/directories each
3) Rename abc.txt to xyz.txt Command)
4) Create a folder OSY

Commands:
1) touch f1 f2 f3
2) ls -i
3) rm abc.txt xyz.txt
4) mkdir OSY
b. Define terms: 1) Throughput 2) Waiting Time 02
Throughput: If the CPU is busy executing processes, then work (1m for
is being done. One measure of work is the number of processes each term)
that are completed per time unit called Throughput. For long
processes, this rate may be one process per hour, for short
transactions, throughput might be 10 processes per second.

Waiting Time: Waiting time is the sum of the periods spent


waiting in the ready queue.
Waiting Time=Starting Time – Arrival Time
c. Describe any four File Attributes 02
Name: The symbolic file name is the only information kept in (1/2 for
human readable form. each
Type: This information is needed for those systems that support attributes)
different types.
Location: This information is a pointer to a device and to the
location of the file on that device.
Size: The current size of the file (in bytes, words or blocks) and
possibly the maximum allowed size are included in this attribute.
Protection: Access control information controls that who can do
reading, writing, executing and so on.
Time, Date and User Identification: This information may be
kept for creation, Last modification and last use. These data can
be useful for protection, security and usage monitoring.
Identifier: File system gives a unique tag or number that
identifies file within file system and which is used to refer files
internally.
Creator or Owner: A creator is a user or a person who has
created that file and the owner is a person who owns that file
currently.

Page 1 of 6
Department of Computer Engineering (NBA Accredited)
Model Answer Sheet

Q. Sub Answer Marking


No QN Scheme
d. Define term Paging and Segmentation 02
Paging: (1m for
Paging is a memory management technique by which a each def. )
computer stores and retrieves data from secondary storage for
use in main memory. In paging, the operating system retrieves
data from secondary storage in same-size blocks called pages.
The basic idea behind paging is that when a process is swapped
in, the pager only loads into memory those pages that it
expects the process to need.

Segmentation:
Segmentation is a memory management scheme that
implements the user’s view of a program. In segmentation, the
entire logical address space is considered as a collection of
segments with each segment having a number and a length. The
length of a segment may range from 0 to some maximum value
as specified by the hardware and may also change during the
execution. The user specifies each logical address consisting of a
segment number (s) and an offset (d). A segment is a logical unit
such as main program, procedure, function, method, object, local
variables, global variables, common block, stack, symbol table,
arrays etc.

e. Draw diagram for Two Level Directory Structure 02


( 2m for dia)

OR

f. Define Term: Internal Fragmentation and External 02


Fragmentation ( 1m for
Internal Fragmentation: each def.)
 Internal fragmentation occurs when the memory
allocator leaves extra space empty inside of a block of
memory that has been allocated for a client.
Page 2 of 6
Department of Computer Engineering (NBA Accredited)
Model Answer Sheet

Q. Sub Answer Marking


No QN Scheme
 If the memory allocated to the process is slightly larger
than the memory demanded, then the difference
between allocated and demanded memory is known as
internal fragmentation.

External Fragmentation:
 External fragmentation happens when there’s a
sufficient quantity of area within the memory to satisfy
the memory request of a method. However, the
process’s memory request cannot be fulfilled because
the memory offered is in a non-contiguous manner.
 External fragmentation occurs whenever a method of
dynamic memory allocation happens to allocate some
memory and leave a small amount of unusable memory.

2 Attempt any Three of the following 12


a. Describe FIFO Page Replacement Algorithm and find out 04
Page Fault and Page Hit for following reference string in (2m for
FIFO assuming three frames: 2, 3, 2, 1, 5, 2, 4, 5, 3, 2, 5, 2 Explanation
The simplest page replacement algorithm is a FIFO. A FIFO and 2m for
replacement algorithm associates with each page the time when Calculation)
that page was brought into memory. When a page must be
replaced, the oldest page is chosen. FIFO queue is created to
hold all pages in memory. We replace the page at the head of
the queue. When a page is brought into memory, we insert it at
the tail of the queue. The FIFO page replacement algorithm is

Page 3 of 6
Department of Computer Engineering (NBA Accredited)
Model Answer Sheet

Q. Sub Answer Marking


No QN Scheme
easy to understand and program. It performance is not always
good.
Using FIFO Page Replacement Algorithm

Total Number of Page fault using three frames=9


Total Number of Page Hit using three frames=3
b. Calculate Average Turn Around Time and Average Waiting Time 04
for following set of processes in FCFS algorithm and Round (1m for
Robin Algorithm (Time Slice 4 msec) use Gantt Chart: Gantt chart
Process Burst Time and 1m for
P1 10 Cal )
P2 04
P3 09
P4 06

FCFS:

RR:

c. Compare MFT (Static Memory Partitioning) and MVT 04


(Dynamic Memory Partitioning) (Any four points) (1m for
each point)
Page 4 of 6
Department of Computer Engineering (NBA Accredited)
Model Answer Sheet

Q. Sub Answer Marking


No QN Scheme
MFT MVT
In this petitioning, memory is In this petitioning, region or
divided into several partitions partition size is not fixed and
of fixed size that size never canvary dynamically.
changes.
Process cannot grow at Process grow or shrink at run
runtime time
Poor memory utilization Good memory utilization
Suffers from Internal Suffers from External
Fragmentation Fragmentation
Difficult Implementation Easy implementation
Example: IBM 360, DOS etc Example: IBM OS
d. Describe any four conditions for Deadlock 04
Mutual Exclusion: The resources involved are non-shareable. At (1m for
least one resource (thread) must be held in a non-shareable each
mode, that is, only one process at a time claims exclusive control condition)
of the resource. If another process requests that resource, the
requesting process must be delayed until the resource has been
released. A disk drive can be shared by two processes
simultaneously. This will not cause deadlock, but printers, tape
drives, plotters etc. have to be allocated to a process in an
exclusive manner until the process completely finishes its work
with it, which normally happens when the process ends. This will
cause deadlock.

Hold and Wait: Requesting process already holds resources


while waiting for requested resources. Even if a process holds
certain resources at any moment, it is possible for it to request
for new resource. There must exist a process that is holding a
resource already allocated to it while waiting for additional
resource that are currently being held by other processes. It will
not give the resource already held and request for new one. If it
is true, deadlock will take place and if this is not true, a deadlock
can never take place.

No-Preemption: Resources cannot be pre-empted i.e a resource


can be released only voluntarily by the process holding it. Once
the resources are allocated to the process, system cannot
forcefully deallocate the resources from a process even though
that process goes into the waiting state for additional resources.

Circular Wait: The processes in the system form a circular list or


chain where each process in the list is waiting for a resource held
by the next process in the list. The set of waiting processes P0,
P1, P2, P3…..Pn waiting for resources which are already held by
the next process. In this example, P0 is waiting for the resource
Page 5 of 6
Department of Computer Engineering (NBA Accredited)
Model Answer Sheet

Q. Sub Answer Marking


No QN Scheme
already held by P1, P1 waiting for the resource already held by
P2, P2 waiting for the resource already held by P3, Pn-1 waiting
for the resource which is held by Pn and Pn waiting for the
resource which is held by P0.

It is necessary to understand that all these four conditions have


to be satisfied simultaneously for deadlock.

Page 6 of 6

You might also like