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

Osy w22 Even

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)
9 views5 pages

Osy w22 Even

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

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION

(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2005 Certified) (ISO/IEC - 27001 - 2005 Certified)

WINTER – 2022 EXAMINATION WINTER – 2022 EXAMINATION


MODEL ANSWER MODEL ANSWER
Subject: Operating System Subject Code: 22516 Subject: Operating System Subject Code: 22516

c) Define : Process, PCB 2M leading to internal blocks at all. Thus, it


Ans. Process:-A process is a program in execution. Process is also called fragmentation. may lead to external
as job, task or unit of work. Correct fragmentation.
Definition Logical A logical address A logical address
1M each
PCB:-Process Control Block is a data structure that contains Address divides into page divides into section
information of the process related to it. The process control block is offset and page offset and section
also known as a task control block, entry of the process table, etc. number in the case of number in the case of
d) Define CPU and I/O burst cycle. 2M Paging. Segmentation.
Ans. CPU burst cycle: It is a time period when process is busy with CPU. Data Storage In the case of Paging, In the case of
Correct the page table leads to Segmentation, the
I/O burst cycle: It is a time period when process is busy in working Definition the storage of the page segmentation table leads
1M each
with I/O resources. data. to the storage of the
e) Differentiate between paging and segmentation. 2M segmentation data.

Any two
f) Write syntax of following commands- 2M
Ans. Parameters Paging Segmentation
relevant (i) Kill
differences (ii) Sleep 1M for each
Individual In Paging, we break a In the case of – 1M each Ans. i) kill correct
Memory process address space Segmentation, we break Syntax: kill Pid
syntax
into blocks known as a process address space
pages. into blocks known as ii) sleep
sections/segments. Syntax: sleep NUMBER[SUFFIX]…
Memory Size The pages are blocks The sections/segments sleep OPTION
of fixed size. are blocks of varying g) List any four file operations. 2M
sizes. Ans.  Creating a file
Accountability The OS divides the The compiler mainly
 Writing a file: Any four
available memory into calculates the size of operations
 Reading a file:
individual pages. individual segments, ½ M each
their actual address as  Repositioning within a file
well as virtual address.  Deleting a file
Speed This technique is This technique is  Appending new information to the end of the file
comparatively much comparatively much  Renaming an existing file.
faster in accessing slower in accessing  Creating copy of a file, copy file to another I/O device such as
memory. memory than Paging. printer or display
Size The available memory The user determines the 
determines the individual segment 2. Attempt any THREE of the following: 12
individual page sizes. sizes. a) Explain Time sharing O.S. 4M
Fragmentation The Paging technique The Segmentation Ans. In time sharing system, the CPU executes multiple jobs by switching
may underutilize some technique may not use among them. The switches occur so frequently that the users can
of the pages- thus some of the memory interact with each program while it is running. It includes an

Page 3 / 21 Page 4 / 21
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2005 Certified) (ISO/IEC - 27001 - 2005 Certified)

WINTER – 2022 EXAMINATION WINTER – 2022 EXAMINATION


MODEL ANSWER MODEL ANSWER
Subject: Operating System Subject Code: 22516 Subject: Operating System Subject Code: 22516

4. I/O device Management Shared memory


Input / Output device management provides an environment for the
better interaction between system and the I / O devices (such as
printers, scanners, tape drives etc.). To interact with I/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  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.
5. Secondary-Storage Management
The computer system provides secondary storage to back up main  All the processes using the shared memory segment should attach
memory. Secondary storage is required because main memory is too to the address space of the shared memory. All the processes can
small to accommodate all data and programs, and the data that it exchange information by reading and/or writing data in shared
holds is lost when power is lost. Most of the programs including memory segment.
compilers, assemblers, word processors, editors, and formatters are  The form of data and location are determined by these processes
stored on a disk until loaded into memory. Secondary storage consists who want to communicate with each other.
of tapes drives, disk drives, and other media.  These processes are not under the control of the operating system.
The operating system is responsible for the following activities in  The processes are also responsible for ensuring that they are not
connection with disk management: writing to the same location simultaneously.
 Free space management  After establishing shared memory segment, all accesses to the
 Storage allocation shared memory segment are treated as routine memory access and
 Disk scheduling. without assistance of kernel.
d) Describe different scheduling criteria. 4M
c) Explain shared memory model of Interprocess communication 4M Ans.  CPU utilization: - In multiprogramming the main objective is to
keep CPU as busy as possible. CPU utilization can range from 0 Any four
(IPC) scheduling
Ans. Inter-process communication: Cooperating processes require an Explanation to 100 percent. criteria -1M
Inter- process communication (IPC) mechanism that will allow them 3M
each
Diagram
to exchange data and information. 1M
 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 7 / 21 Page 8 / 21
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2005 Certified) (ISO/IEC - 27001 - 2005 Certified)

WINTER – 2022 EXAMINATION WINTER – 2022 EXAMINATION


MODEL ANSWER MODEL ANSWER
Subject: Operating System Subject Code: 22516 Subject: Operating System Subject Code: 22516

released. The preempted resources are added to the list of resources  The directory contains a pointer to the first and the last blocks of
for which the process is waiting. Process will be restarted only when Diagram
the file. Optional
all the resources i.e. its old resources, as well as the new ones that it is  To create a new file, simply create a new entry in the directory.
requesting will be available.
 The following figure shows the linked allocation.
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 = {R1, 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.

c) Explain fixed size memory partitioning. 4M


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
4M
 Each partition contains exactly one process.
 The number of programs to be executed depends on number of
partitions.
 When the partition is free, a selected process from the input queue
is loaded into the free partition.  There is no external fragmentation since only one block is needed
 When the process terminates, the partition becomes available for
at a time.
another process.
 The operating system keeps a table indicating parts of memory  The size of a file need not be declared when it is created.
which are available and which are occupied.  A file can continue to grow as long as free blocks are available
 Initially, all memory is available for user processes and it is  This method is used only for a sequential access files
considered as one large block of available memory, a hole.  This method requires more space to store pointers
 When a process arrives, large enough hole of memory is allocated  So instead of blocks, clusters are used for allocation but this
to the processes. creates internal fragmentation.

d) Explain linked file allocation method. 4M
4. Attempt any THREE of the following: 12
Ans. Linked Allocation:
a) Compare between command line and Graphical user interface. 4M
 This allocation is on the basis of an individual block. Each block Correct
(Any four points)
explanation
contains a pointer to the next block in the chain. 4M,
 The disk block can be scattered anywhere on the disk.

Page 11 / 21 Page 12 / 21
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2005 Certified) (ISO/IEC - 27001 - 2005 Certified)

WINTER – 2022 EXAMINATION WINTER – 2022 EXAMINATION


MODEL ANSWER MODEL ANSWER
Subject: Operating System Subject Code: 22516 Subject: Operating System Subject Code: 22516

e) 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 techniques
Correct
blocks in the disk are managed. Explanation
2M each
1. Bit Vector
2. Linked List
Ans. Gantt Chart SJF
1 )Bit Vector:
For each
scheduling The free-space list is implemented as a bit map or bit vector.
Gantt chart Each block is represented by 1 bit. If the block is free, the bit is 1; if
Waiting Time 1M, the block is allocated, the bit is 0.
P1=17 For example, consider a disk where blocks 2, 3, 4, 5, 8, 9, 10, 11, 12,
P2=3 Each 13 are free and the rest of the blocks are allocated.
P3=0 average
waiting time The free-space bit map would be : 0011110011111100
P4=10 calculation
Average waiting time=Waiting time of all processes / Number of 1M
processes 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
=(17+3+0+10) /4
=30/4
=7.5 milliseconds (ms) 0 0 1 1 1 1 0 0 1 1 1 1 1 1 0 0
Gantt Chart FCFS 1=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.

Waiting Time 2) Linked List


P1=0 In this approach, the free disk blocks are linked together i.e. a free
P2=9 block contains a pointer to the next free block. The block number of
P3=16 the very first disk block is stored at a separate location on disk and is
P4=19 also cached in memory. In this approach, link all the disk blocks
Average waiting time=Waiting time of all processes / Number of together, keeping a pointer to the first free block. This block contains
processes a pointer to the next free disk block, and so on.
=(0+9+16+19) /4
=44/4
=11 milli seconds (ms)

Page 15 / 21 Page 16 / 21
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2005 Certified) (ISO/IEC - 27001 - 2005 Certified)

WINTER – 2022 EXAMINATION WINTER – 2022 EXAMINATION


MODEL ANSWER MODEL ANSWER
Subject: Operating System Subject Code: 22516 Subject: Operating System Subject Code: 22516

6. Attempt any TWO of the following: 12 b) Consider the following memory map and assume a new process 6M
a) Solve given problem by using 6M P4 comes with memory requirements of 6 KB.
(i) Pre-emptive SJF Locate (Draw) this process in memory using. Each fit
(ii) Round Robin (Time Slice = 3 ms) i) First fit diagram 2M
Calculate average waiting time using Gantt Chart ii) Best Fit
iii) Worst Fit

Ans. (i) Pre emptive SJF:


Each Ans. First Fit: Allocate Best Fit: Allocate Worst fit: Allocate
method 3M
- the first free block the smallest free the largest free
1M for to the new process block that is big block to the new
Gantt chart, P4. enough to process P4.
accommodate new
Waiting Time= (Total completion time –Burst time ) – Arrival 1M for process P4.
Waiting
time time O. S. O. S. O. S.
calculation, P1 P1 P1
P11 –(17-8)-0 = 9ms, P4 6KB <FREE> 12 KB <FREE> 12 KB
P12- (5 – 4) -1 =0ms, 1M for
<FREE> 6KB P2 P2
P13- ( 26-9)-2 =15ms, Average
waiting time P2 <FREE> 19 KB P4 6 KB
P14- ( 10-5)-3 =2ms P3 <FREE> 13 KB
<FREE> 19 KB
Average waiting time :- (9+0+15+2)/4= 26/4=6.5 ms P4 6 KB
P3 P3
<FREE> 7 KB <FREE> 1 KB <FREE> 7 KB
(ii) Round Robin (Time Slice = 3 ms)
c) Construct and explain directory structure of a file system in 6M
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 Explanation
of structure
(UFD). The UFD lists only files of a single user. System contains a 2M each,
Waiting time: - P11 = (23-8)-0 =15ms,
master file directory (MFD) which is indexed by user name or
P12-(16 – 4)- 1 =11ms,
account number. Each entry in MFD points to the UFD for that user. Constructio
P13-(26-9)-2 =15ms, n of
When a user refers to a particular file, only his own UFD is searched.
P14-(21-5)-3 =13ms structure
Different users can have files with the same name, as long as all the 1M each
Average waiting time:- (15+11+15+13)/4=54/4= 13.5ms
file names within each UFD are unique.

Page 19 / 21 Page 20 / 21

You might also like