0 ratings0% found this document useful (0 votes) 259 views21 pagesOS Winter 2022
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER - 2022 EXAMINATION
MODEL ANSWER,
Subject: Operating System Subject Code: 22516
Important Instructions to examiner
1) The answers should be examined by key words and not as word-to-word as given in the
model answer scheme
2). The model answer and the answer written by candidate may vary but the examiner may
try to assess the understanding level of the candidate.
3) The language errors such as grammatical, spelling errors should not be given more
Importance (Not applicable for subject English and Communication Skills
4) While assessing figures, examiner may give credit for principal components indicated in
the figure. The figures drawn by candidate and model answer may vary. The examiner
may give credit for anyequivalent figure drawn.
5) Credits may be given step wise for numerical problems. In some cases, the assumed
constant values may vary and there may be some difference in the candidate's answers
and model answer.
6) In case of some questions credit may be given by judgement on part of examiner of
relevant answer based on candidate's understanding.
7) For programming language papers, credit may be given to any other program based on
equivalent concept.
8) As per the policy decision of Maharashtra State Government, teaching in English/Marathi
and Bilingual (English + Marathi) medium is introduced at first year of AICTE diploma
Programme from academic year 2021-2022. Hence if the students in first year (first and
second semesters) write answers in Marathi or bilingual language (English +Marathi), the
Examiner shall consider the same and assess the answer based on matching of concepts
with model answer
@ | Sub ‘Answer Marking
No| QN. Scheme
1 ‘Attempt any FIVE of the following: 10
a) | Differentiate between Multi programmed and Multitasking operating| 2M
system (Any two points)
Ans, | [Features | Multiprogramming | Multitasking
Any two
Basic Tt allows multiple | A supplementary of the relevant
programs to utilize | multiprogramming a
the CPU | system also allows for
simultaneously. user interaction.
Mechanis | Based on the context [Based on the _time-
m switching sharing mechanism.
mechanism,
Objective [it is useful fort is useful for running
reducing/decreasing _| multiple processes at the
Page 1/21MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER - 2022 EXAMINATION
MODEL ANSWER
Subject: Operating System Subject Code: 22516
CPU idle time and] same time, effectively
increasing increasing CPU and
throughput as_much | system throughput.
possible.
Execution | When one job or]in a multiprocessing
process completes its | system, multiple
execution or switches | processes can operate
to an VO task in a| simultaneously by
multi-programmed _| allocating the CPU for a
system, the system | fixed amount of time.
momentarily
suspends that
process. It selects
another process from
the process
scheduling pool
(waiting queue) to
run,
CPU Ina multiuser | In a ‘single-user
Switching | environment, the | environment, the CPU
cru switches | switches between the
between processes of various
programs/processes | programs
quickly
Timing [It takes maximum | It takes minimum time to
time to execute the | execute the process.
process,
b) _ | List any four services provided by O.S. 2M
Ans. © User Interface
© Program Execution eM each
* 1/0 Operation ieee
* File system Manipulation
* Communication
+ Enror Detection
* Resource Allocation
* Accounting
* Protection and security
Page 2/21MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER - 2022 EXAMINATION
MODEL ANSWER
Subject: Operating System Subject Code: 22516
° Define : Process, PCB 2M
Ans. | Process:-A process is a program in execution. Process is also called
as job, task or unit of work. Correct
Definition
PCB:-Process Control Block is a data structure that contains | “ese
information of the process related to it. The process control block is
also known as a task control block, entry of the process table, ete.
d@d) Define CPU and I/O burst cycle. 2M
‘Ans. | CPU burst cycle: It is a time period when process is busy with CPU.
Correct
VO burst cycle: It is a time period when process is busy in working Definition
with /O resources. eae
©) _| Differentiate between paging and segmentation. 2M
Ans. |{ Parameters] Paging Segmentation any
relevant
Tndividual [Im Paging, we break a|In the case of | | “ferences
Memory process address space | Segmentation, we break
into blocks known as | a process address space
pages. into blocks known as
sections/segments,
Memory Size |The pages are blocks |The — sections/segments
of fixed size. are blocks of varying
sizes.
‘Accountability | The OS divides the |The compiler mainly
available memory into | calculates the size of
individual pag individual segments,
their actual address as
well as virtual address.
Speed This technique is| This technique is
comparatively much | comparatively much
faster in accessing | slower in accessing
memor memory than Paging.
Size The available memory | The user determines the
determines the | individual segment
individual page sizes. | sizes.
Fragmentation | The Paging technique | The Segmentation
may underutilize some | technique may not use
of the _pages- thus | some of _the_memor
Page 3/21MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER - 2022 EXAMINATION
MODEL ANSWER
Subject Code: 22516
it
Teading to internal | blocks at all. Thus
fragmentation. may lead to external
fragmentation.
Logical A logical address | A logical _ address
divides into page | divides into section
offset and page offset and section
number in the case of | number in the case of
Paging. Segmentation.
Data Storage | In the case of Paging, |In the case of
the page table leads to | Segmentation, the
the storage of the page | segmentation table leads
data. to the storage of the
segmentation data.
1) _ | Write syntax of following commands- 2M
@ Kill
ii) Sleep IM for each
Ans. | i) kill correct
Syntax: kill Pid syntax
ii) sleep
Syntax: sleep NUMBER[SUFFIX]
sleep OPTION
g) _ | List any four file operations. 2M.
Ans. * Creating a file
# Writing a file Any four
* Reading a file: Teach
+ Repositioning within a file
* Deleting a file
+ Appending new information to the end of the file
* Renaming an existing file.
‘© Creating copy of a file, copy file to another I/O device such as
printer or display
2. 3 12
a) | Explain Time sharing 0.8. 4M
Ans. | In time sharing system, the CPU executes multiple jobs by switching
among them. The switches occur so frequently that the users can
interact_with each program while it is running. It includes_an
Page 4/21MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Subject: Operating System Subject Code:
WINTER - 2022 EXAMINATION
MODEL ANSWER,
22516
interactive computer system which provides direct communication
between the user and the system. A time-sharing system allows many | Relevant
users to share the computer resources simultaneously. The time- | #*planation
sharing system provides the direct access to many users where CPU|
time is divided among all the users on scheduled basis. The operating
system allocates a time slice to each user. When this time is expired,
it passes control to the next user on the system. The time allowed is
extremely small and the users are given the impression that each of
them has their own CPU and they are the sole owner of the CPU. In
this time slice each user gets attention of the CPU. The objective of
time-sharing system is to minimize response time of process.
Example: The concept of time-sharing system is shown in figure:
Users User 4
a
q
User 2 p User 5
Q
s D
User 4 ‘ative Link (User 6
In above figure, the user 5 is active but user 1, user 2, user 3, and user
4 are in waiting state whereas user 6 is in ready status
b)
Ans.
Describe any two components of O.S. aM
List of System Components:
1. Process management Description
2. Main memory management of any two
3. File management aes
4, 1/0 system management aMeach
5, Secondary storage management
1.Process Management:
A program is a set of instructions. When CPU is allocated to a
program, it can start its execution. A program in execution is a
process. A word processing program run by a user on a PC is a
process. A process needs various system resources including CPU
time, memory, files and I/O devices to complete the job execution,
These resources can be given to the process when it is created or
allocated to it while it is running
Page 5/21MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER - 2022 EXAMINATION
MODEL ANSWER,
Subject: Operating System Subject Code: 22516
The operating system responsible for the following acti
connection with process management:
* Creation and deletion of user and system processes.
* Suspension and resumption of processes.
+ A mechanism for process synchronization.
* A mechanism for process communication,
* A mechanism for deadlock handling.
2. Main-Memory Management
Main memory is a large array of words or bytes, ranging in size from
hundreds of thousands to billions. Each word or byte has its own
address, Main memory is a repository of quickly accessible data
shared by the CPU and VO devices. The central processor reads
instructions from main memory during the instruction fetch cycle and
both reads and writes data from main memory during the data fetch
cycle. The main memory is generally the only large storage device
that the CPU is able to address and access directly.
The operating system responsible for the following activities in
connection with main memory s management
* Keeping track of which parts of memory are currently being used
and by whom.
* Deciding which processes (or parts thereof) and data to move into
and out of memory. 3. Allocating and deallocating memory space
as needed.
3. File Management
A file is a collected of related information defined by its creator.
Computer can store files on the disk (secondary storage), which
provide long term storage. Some examples of storage media are
magnetic tape, magnetic disk and optical disk, Each of these media
has its own properties like speed, capacity, and data transfer rate and
access methods. AA file system normally organized into directories to
ease their use. These directories may contain files and other
directions.
The operating system responsible for the following acti
connection with file management:
* The creation and deletion of files.
+ The creation and deletion of directions.
© The support of primitives for manipulating files and directions.
* The mapping of files onto secondary storage.
+The backup of files on stable storage media
Page 6/21MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Subject: Operating System Subject Code:
WINTER - 2022 EXAMINATION
MODEL ANSWER,
22516
4.1/0 device Management
Input / Output device management provides an environment for the
better interaction between system and the T / O devices (such as
printers, scanners, tape drives ete.). To interact with /O devices in an
effective manner, the operating system uses some special programs
known as device driver. The device drivers take the data that
operating system has defined as a file and then translate them into
streams of bits or a series of laser pulses (in regard with laser printer).
The I/O subsystem consists of several components:
* A memory management component that includes buffering,
caching, spooling
* A general device driver interface
© Drivers for specific hardware devices
5. Secondary-Storage Management
The computer system provides secondary storage to back up main
memory. Secondary storage is required because main memory is too
small to accommodate all data and programs, and the data that it
holds is lost when power is lost. Most of the programs including
compilers, assemblers, word processors, editors, and formatters are
stored on a disk until loaded into memory. Secondary storage consists
of tapes drives, disk drives, and other media.
The operating system is responsible for the following activities in
connection with disk management:
* Free space management
* Storage allocation
* Disk scheduling,
Ans.
Explain shared memory model of Interprocess communication
arc)
Inter-process communication: Cooperating processes require an
Inter- process communication (IPC) mechanism that will allow them
to exchange data and information,
4M
Esplanation
3M
Diagram
IM
Page 7/21MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Subject: Operating System Subject Code:
WINTER - 2022 EXAMINATION
MODEL ANSWER,
22516
Shared memo
Process Pa,
[] 1
“PL
1 es
Process P2
Kernel
Shared Memory System
* In this, all processes who want to communicate with other
processes can access a region of the memory residing in an
address space of a process creating a shared memory segment.
* All the processes using the shared memory segment should attach
to the address space of the shared memory. All the processes can
exchange information by reading and/or writing data in shared
memory segment.
* The form of data and location are determined by these processes
who want to communicate with each other.
* These processes are not under the control of the operating system.
* The processes are also responsible for ensuring that they are not
writing to the same location simultaneously.
* After establishing shared memory segment, all accesses to the
shared memory segment are treated as routine memory access and
without assistance of kernel
d)
Ans.
Describe different scheduling criteria. aM
© CPU utilization: - In multiprogramming the main objective is to
keep CPU as busy as possible. CPU utilization can range from 0 | ay four
to 100 percent sedating
each
« Throughput: - It is the number of processes that are completed
per unit time. It is a measure of work done in the system. When
CPU is busy in executing processes, then work is being done in
the system. Throughput depends on the execution time required
for any process.
Page 8/21MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER - 2022 EXAMINATION
MODEL ANSWER,
22516
Subject: Operating System Subject Code:
* Turnaround time: -The time imerval from the time of
submission of a process to the time of completion of that process
is called as turnaround time. It is the sum of time period spent
waiting to get into the memory, waiting in the ready queue,
executing with the CPU, and doing V/O operations.
‘© Waiting time: - It is the sum of time periods spent in the ready
queue by a process. When a process is selected from job pool, itis
loaded into the main memory. A process waits in ready queue till
CPU is allocated to it.
‘Attempt any THREE of the following: 12
a) _| Draw and explain process state diagram, 4M
Ans. | Different process states are as follows:
1. New Process
2. Ready ‘state
3. Running fam
4, Waiting Explanation
5. Terminated 2M
—_ admited —interupt exit_—+( terminated
XS
G&G»
scheduler dispatch
VO or event completion VO or event wait
waiting
New: When a process enters into the system, it is in new state. In this
state a process is created. In new state the process is in job pool.
Ready: When the process is loaded into the main memory, it is ready
for execution. In this state the process is waiting for processor
allocation.
Page 9/21MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Subject: Operating System Subject Code:
WINTER - 2022 EXAMINATION
MODEL ANSWER,
22516
Running: When CPU is available, system selects one process from
main memory and executes all the instructions from that process. So,
when a process is in execution, it is in running state. In single user
system, only one process can be in the running state. In multiuser
system, there can be multiple processes which are in the running
state,
Waiting State: When a process is in execution, it may request for VO
resources. If the resource is not available, process goes into the
waiting state. When the resource is available, the process goes back to
ready state.
Terminated State:
When the process completes its execution, it goes into the terminated
state. In this state the memory occupied by the process is released.
b)
Ans.
Describe conditions for deadlock prevention. aM
By ensuring that at least one of below conditions cannot hold, we can
prevent the occurrence of a deadlock. Any four
conditions
IM each
1.Mutual Exclusion:
The mutual-exclusion condition must hold for non-sharable
resources. Sharable resources do not require mutually exclusive
access, thus cannot be involved in a deadlock.
2.Hold and Wait
One way to avoid this Hold and Wait is when a process requests a
resource; it does not hold any other resources,
+One protocol that can be used requires each process to request and
be allocated all its resources before it begins execution.
*Another protocol that can be used is, to allow a process to request
resources only when the process has none. A process may request
some resources and use them. Before it requests any additional
resources, it must release all the resources that are currently allocated
toit.
3.No Preemptio
If a process that is holding some resources requests another resource
that cannot be immediately allocated to it, then all resources currently
being held are preempted. That is these resources are implicit
Page 10/21MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Subject: Operating System Subject Code:
WINTER - 2022 EXAMINATION
MODEL ANSWER,
22516
released, The preempted resources are added to the list of resources
for which the process is waiting. Process will be restarted only when
all the resources i.e. its old resources, as well as the new ones that it is
requesting will be available.
4.Circular Wait
Circular-wait condition never holds is to impose a total ordering of all
resource types, and to require that each process requests resources in
an increasing order of enumeration.
Let R = {RI, R2, ..., Rn} be the set of resource types. We assign to
each resource type a unique integer number, which allows us to
compare two resources and to determine whether one precedes
another in our ordering. Formally, define a one-to-one function F: R
_N, where N is the set of natural numbers
* The disk block can be scattered anywhere on the disk.
©) _ | Explain fixed size memory partitioning. aM
Ans, | Fixed Size Memory Partitioning (Static)
‘* Memory is divided into number of fixed size partitions, which is | _ Correct
called as fixed or static memory partitioning. explanation
+ Each partition contains exactly one process. "
«The number of programs to be executed depends on number of
pattitions
‘+ When the partition is fiee, a selected process from the input queue
is loaded into the free partition.
‘© When the process terminates, the partition becomes available for
another process.
‘© The operating system keeps a table indicating parts of memory
which are available and which are occupied.
+ Initially, all memory is available for user processes and it is
considered as one large block of available memory, a hole
‘© When a process arrives, large enough hole of memory is allocated
to the processes
@) | Explain linked file allocation method. aM
‘Ans. | Linked Allocation:
* This allocation is on the basis of an individual block. Each block |_| Correct
. explanation
contains a pointer to the next block in the chain. aM
Page 11/21MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER - 2022 EXAMINATION
MODEL ANSWER,
22516
ing System Subject Code:
+ The directory contains a pointer to the first and the last Blocks of |
- iagram
the file Optional
+ To create a new file, simply create a new entry in the directory.
* The following figure shows the linked allocation.
Directory
file start end
jeep 9 25
* There is no external fragmentation since only one block is needed
ata time.
* The size of file need not be declared when it is created.
* A file can continue to grow as long as free blocks are available
* This method is used only for a sequential access files
* This method requires more space to store pointers
* So instead of blocks, clusters are used for allocation but this
creates internal fragmentation.
4 Attempt any THREE of the following: 12
a) | Compare between command line and Graphical user interface. | 4M
(Any four points)
Page 12/21MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER - 2022 EXAMINATION
MODEL ANSWER
Subject: Operating System Subject Code: 22816
‘Ans. ‘ , Any four
Parameter | Command Line Graphic User poins 1M
Interface(CLD Interface(GUD) each
Definition | Interaction is by | Interaction with devices is by
typingcommands | graphics and_—_visual
‘components and icons
Understan | Commands need to | Visual indicators and icons
ding | be memorized are easy to understand
Memory | Less memory is | More memory is required as,
required for storage | visual components are
involved.
Working | Use of keyboard for | Use of mouse for interaction
Speed | commands makes | makes it slow
CLI quicker.
Resources | Only keyboard Mouse and keyboard both
used can be used
Accuracy | High Comparatively low
Flexibility | Command line | Structure and design can
interface does not | change with updates
change, _ remains
same over time
b) | Write any four systems call related to file management. 4M.
Ans. | System calls related to file management are:
create new file Any 4
delete existing file system calls
IM each
open file
close file
create directories
delete directories
read, write, reposition in file
getfile attributes
set file attributes
Sen aANAYnE
Page 13/21MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER - 2022 EXAMINATION
MODEL ANSWER
Subject Code: 22516
©) | Compare between Long term and short term scheduler. (Any 4M
four points)
Ans. Any four
; . poinis 1M
Sr. Long Term Scheduler Short Term Scheduler ‘each
No
1 Itis job scheduler Itis CPU scheduler
2 | It selects processes from job | It selects processes from
pool and loads them into | ready queue which are ready
memory for execution to execute and allocates
CPU to one of them
3 | Access job pool and ready | Access ready queue and
queue CPU
4 [It executes much less | It executes frequently. It
frequently. It executes when | executes when CPU is
memory has space to | available for allocation
accommodate new process.
Speed is less than short term | Speed is fast
scheduler
6 | It controls the degree of It provides lesser control
multiprogramming over degree of
multiprogramming
7 | It chooses a good process _| It chooses a new process for
that is a mix-up of a processor quite frequently.
input/output bound and CPU
bound.
a) [Solve given problem by using SJF and FCFS scheduling | 4M
algorithm using Gantt chart. Calculate the average waiting time
for cach algorithm
Page 14/21MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER - 2022 EXAMINATION
MODEL ANSWER
Subject Code: 22516
Process | Burst time (in ms)
PI | 9
eee
P2 | 7
| P3 [ 3 5
| Pa 7
‘Ans, | Gantt Chart SJF
Ps P PA PI For each
2 8 7 w | aie
Waiting Time iM
Each
waiting time
calculation
Average waiting time=Waiting time of all processes / Number of | “ray
processes
743+0+10) /4
v4
=7.5 milliseconds (ms)
Gantt Chart FCFS
Fi ® » |
Waiting Time
Average waiting time=Waiting time of all processes / Number of
Processes
= (049416419) /4
=44/4
=11 milli seconds (ms)
Page 15/21MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER - 2022 EXAMINATION
MODEL ANSWER
Subject Code: 22516
©) | Describe free space management technique. (Any two) 4M
Ans. | A file system is responsible to allocate the free blocks to the file
therefore it has to keep track of all the free blocks present in the Any 2
disk.There are mainly four approaches by using which, the free | ‘chmiques
blocks in the disk are managed. fegtanation
2M each
1. Bit Vector
2. Linked List
1 )Bit Vector:
The free-space list is implemented as a bit map or bit vector.
Each block is represented by 1 bit. If the block is free, the bit is 1; if
the block is allocated, the bit is 0.
For example, consider a disk where blocks 2, 3, 4, 5, 8, 9, 10, 11, 12,
13 are free and the rest of the blocks are allocated,
The free-space bit map would be : 0011110011111100
ofofififififofofisifafafafafofo
I-Free block
0= Allocated block
The main advantage of this approach is its relative simplicity and its
efficiency in finding the first free block or n consecutive free blocks
on the disk.
2) Linked List
In this approach, the free disk blocks are linked together i.e. a free
block contains a pointer to the next free block. The block number of
the very first disk block is stored at a separate location on disk and is
also cached in memory, In this approach, link all the disk blocks
together, keeping a pointer to the first free block. This block contains
a pointer to the next free disk block, and so on.
Page 16/21MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER - 2022 EXAMINATION
MODEL ANSWER,
Subject Code: 22516
vou
“)
on]
I
ba) ot
x ‘Attempt any TWO of the followin; 2
a) | Write two uses of following O.S. tools oM
i) Device Management
i) Performance monitor 2uses of
Task Scheduler cach ool
Ans, | i) Device management:
* Managing all the hardware or virtual devices of computer system,
+ Allow interaction with hardware devices through device driver
* Used to install device and component-level drivers as well as
associated software
* Allocate devices to the process as per process requirement and
priority.
* Deallocate devices either temporarily or permanently depending
on condition.
* Keeping track of all device’s data and location,
* Monitoring device status like printers, storage drivers and other
devices
* Used to enforce the predetermined policies and decides which
process receives the device when and for how long.
ii) Performance monitor
1. Monitor various activities on a computer such as CPU or memory
usage.
2. Used to examine how programs running on their computer affect
computer’s performance
3. It is used to identify performance problems or bottleneck that
affect operating system or installed applications.
4, Used to observe the effect of system configuration changes.
Page 17/21MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Subject: Operating System Subject Code:
WINTER - 2022 EXAMINATION
MODEL ANSWER
22516
iii) Task scheduler
1. Assign processor to task ready for execution
2. Executing predefined actions automatically whenever a certain set
of condition is met.
(Any two relevant uses shall be considered)
»)
Ans.
Writer the outputs of following commands
(®) Wait 2385018
(ii) Sleep 09
) PS —u Asha
i) Wait command waits until the termination of specified process ID
oM.
2385018 2M for each
ii) Sleep command is used to delay for 9 seconds during the execution
of a processi.e. it will pause the terminal for 9 seconds
ii) ps command with -u is used to display data/processes for the
specific user Asha.
correct
‘ouput
Ans.
Given a page reference string with three (03) page frames.
Caleulate the page faults with ‘Optimal’ and ‘LRU’ page
replacement algorithm respectively.
°7,0,1,2,0,3,0,4,2,3,0,3,2,1,2,0,1,7,0,1
6M
(Representation of frame can be in any order) Cateutate
i) Optimal page fault
Rel 7] 0] 1
mH 7|7{7
2 ole
BS Tift 3]3
Fault | F[ F[F
Total page Taults- 9
i) LRU
Ref_[7]0]1]2]]3] 9] 4]2]3]9]3]2]1]2] 0] 1] 7] 0
FL |7]7]7/2]2]2] 2/4] 4/4
F Nd
DI s3|3 [2
Fak F[FIFIFL 1FLIFIE
Total page faults-12
with
DTT TOT T]| relevane
diagram-
3M each
Page 18/21MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISOMEC - 27001 - 2005 Certified)
WINTER - 2022 EXAMINATION
MODEL ANSWER
Subject: Operating System Subject Code: 22516
6. ‘Attempt any TWO of the following: 2
a) _ | Solve given problem by using 6M
(@ Pre-emptive SJF
Gi) Round Robin (Time Slice = 3 ms)
Calculate average waiting time using Gantt Chart
= Ar. BLT (in ms)
reaper eeesee. PBS
Py 1 ee
Pa zs 9-1
ee epee eee A ee Se
Ans. ‘s
ns. | (i) Pre emptive SJF: bach
method 3M
1M for
Gantt chart,
Waiting Time= (Total completion time —Burst time ) — Arrival ee
time iting
caleulation,
PLL-(17-8)-0 = 9ms,
P12- (5-4) -1 =Oms, IM for
P13- ( 26-9)-2 =15ms, erage
P14-( 10-5)-3 =2ms waiting time
Average waiting time = (9+0+15+2)/4= 26/4=6.5 ms
(i) Round Robin (Time Slice = 3 ms)
Waiting tim
P12-(16—4)- 1 =I1ms,
P13-(26-9)-2 =15ms,
P14-(21-5)-3 =13ms
Average waiting time:- (15+11+15+13)/4-54/4= 13.5ms
P11 = (23-80 =15ms,
Page 19/21MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER - 2022 EXAMINATION
MODEL ANSWER
Subject Code: 22516
b) | Consider the following memory map and assume a new process | _ 6M.
P4 comes with memory requirements of 6 KB.
jocate (Draw) this process in memory using. Each fit
First fit diagram 2
os
) Best Fit
ii) Worst Fit H.
12 KB |
| SPREE> 19 KB
[ tessa
[=REE> 7KB_ |
Memory
Ans. |[First_ Fit Allocate] Best Fit Allocate] Worst fit Allocate
the first free block | the smallest free | the largest free
to the new process | block that is big| block to the new
Pa. enough to | process P4.
accommodate new
process P4.
OS. OS. os.
Pl Pl PI
12 KB_|| | 12 KB
P2 P2
19 KB
19 KB PS
3 P3
7KB 7 KB
©) | Construct and explain directory structure of a file system in OM
terms of two level and tree structure,
Ans. | 1) Two-level directory: - .
In the two-level structures, each user has its own user file directory ‘yeanctare
(UED). The UED lists only files of a single user. System contains a | “biv eacm,
master file directory (MFD) which is indexed by user name or
account number. Each entry in MFD points to the UFD for that user. | Constructio
When a user refers to a particular file, only his own UFD is searched. | _ "of
Different users can have files with the same name, as long as all the | ‘7yyCtire
file names within each UFD are unique. °
Page 20/21MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER - 2022 EXAMINATION
MODEL ANSWER,
Subject Code: 22516
When we create a file for a user, operating system searches only that
user's UFD to find whether same name file already present in the
directory. For deleting a file again operating system checks the file
name in the user’ UFD only.
master fle
eetey
2. Tree structure:-
In this directory structure user can create their own sub-directories
and organize their files, The tree has a root directory and every file
has a unique path name. A directory contains a set of files or
subdirectories. All directories have the same internal format. One bit
in each directory entry defines the entry as a file (0) or as a
subdirectory (1). Each process has a current directory. Current
directory contains files that are currently required by the process.
When reference is made to a file, the current directory is searched. If
a file needed that is not in the current directory, then the user usually
must either specify a path name or change the current directory.
Page 21/21