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

OSY Question Bank Answers

Uploaded by

Sanket Karade
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views6 pages

OSY Question Bank Answers

Uploaded by

Sanket Karade
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

OSY Question Bank Answers:

Q1.ans:
1.Deadlock:-
In multiprogramming environment, several processes may compete for a finite number of resources.
A process requests resources and if the resources are not available then the process enters into the
waiting state. Sometimes a waiting process is never again able to change its status because the
resources requested by it are held by other waiting processes. This situation is called as deadlock.
When a process request for resources held by another waiting process which in
turn is waiting for resources held by another waiting process and not a single process can execute its
task, then deadlock occurs in the system.
Example:- Consider a system with three disk drives and three processes. When each process request
one disk drive, system allocates one disk drive to each process. Now there is no more drive available
in the system. If all three processes request for one more disk drive, then all three processes will go
into the waiting state and system will go in deadlock state. Because any one process from the three
can execute only when one of them will release the disk drive allocated to it.

2.Turnaround Time:-
The time interval 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 I/O operations.

Q2.Ans:
Free space management Technics:-
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 disk.There are mainly four approaches by using which, the free
blocks in the disk are managed.
1. Bit Vector
2. Linked List
Q3.ans:-
Cpu scheduling criterias:-
1. CPU utilization
2.Throughput
3. Turnaround time
4.Waiting time
5.Response time

Q4.Ans:-
Pre-emptive Scheduling:-Even if CPU is allocated to one process, CPU can be preempted to other
process if other process is having higher priority or some other fulfilling criteria.
 Throughput is less
 Only the processes having higher priority are scheduled.
 It doesn’t treat all processes as equal.
 Algorithm design is complex.
Circumstances for preemptive
 Process switch from running to ready state
 Process switch from waiting to ready state
For e.g.: Round Robin, Priority algorithms
Non-Preemptive Scheduling:-
 Throughput is high.
 It is not suitable for RTS.
 Processes having any priority can get scheduled.
 It treats all process as equal.
 Algorithm design is simple.
Circumstances for Non preemptive
 Process switches from running to waiting state
 Process terminates
For e.g.: FCFS algorithm It is suitable for RTS.
Q6.Ans:-
From the user’s point of view, a file is an abstract data type. It can be created, opened, written, read,
closed and deleted without any real concern for its implementation. The implementation of a file is a
problem for the operating system. The main problem is how to allocate space to these files so that disk
space is effectively utilized and files can be quickly accessed. Three major methods of allocating disk
space are in wide use:
 Contiguous
 Linked
 Indexed
Q7.Ans:-
Necessary Conditions:
1. Mutual exclusion: At least one resource must be held in a nonsharable
mode; that is, only one process at a time can use the resource.
2. Hold and Wait: A process must be holding at least one resource and
waiting to acquire additional resources that are currently being held by other processes.
3. No pre-emption: Resources cannot be pre-empted i.e a resource can be released only
voluntarily by the process holding it.
4. Circular wait: A set {P0,P1…Pn} of waiting processes must exist such that P0 is waiting
for a resource held by P1,P1 is waiting for a resource held by P2,…,Pn-1 is waiting for a
resource held by Pn and Pn is waiting for a resource held by P0. Each process is waiting for the
resources held by other waiting processes in circular form.

Q9.Ans:-
Sequential Access Method: The simplest access method is sequential access. Information in the file
is processed in order, one record after the other. This mode of access is by far the beginning current
position most common; for example, editors and compilers usually access files in this fashion. Reads
and writes make up the bulk of the operations on a file. A read operation read next reads the next
portion of the file and automatically advances a file pointer, which tracks the I/O location. Similarly,
the write operation write next appends to the end of the file and advances to the end of the newly
written material (the new end of file).

To read a piece of data that is stored at the end of the file, one has to read all of the data that comes
before it-you cannot jump directly to the desired data. This is similar to the way cassette tape
players work. If one wants to listen to the last song on a cassette tape, he has to either fast-forward
over all of the songs that come before it or listen to them. There is no way to jump directly to
a specific song.
Direct Access Method:
A file is made up of fixed-length logical records that allow programs to read and write records rapidly
in no particular order. Thus, we may read block 14, then read block 53, and then write block 7. There
are no restrictions on the order of reading or writing for a direct-access file. The direct-access
method is based on a disk model of a file, since disks allow random access to any file block.
Directaccess files are of great use for immediate access to large amounts of information. Databases
are often of this type. For the direct-access method, the file operations must be modified to include
the block number as a parameter. The block number provided by the user to the OS is normally a
relative block number. A relative block number is an index relative to the beginning of the file. Thus,
the first relative block of the file is 0, the next is 1, and so on, even though the actual absolute disk
address of the block may be 14703 for the first block and 3192 for the second. The use of relative
block numbers allows the OS to decide where the file should be placed (called the allocation
problem) and helps to prevent the user from accessing portions of the file system that may
not be part of her file. When you work with a direct access file (which is also known as a random
access file), you can jump directly to any piece of data in the file without reading the data that
comes before it. This is similar to the way a CD player or an MP3 player works. You can jump directly
to any song that you want to listen to. Sequential access files are easy to work with, and you can use
them to gain an understanding of basic file operations.

Q10.Ans:-
Fixed Partitioning:
This is the oldest and simplest technique used to put more than one processes in the main
memory. In this partitioning, number of partitions (non-overlapping) in RAM are fixed but
size of each partition may or may not be same. As it is contiguous allocation, hence no
spanning is allowed. Here partition are made before execution or during system configure.

As illustrated in above figure, first process is only consuming 1MB


out of 4MB in the main memory. Hence, Internal Fragmentation in first block is (4-1) =
3MB. Sum of Internal Fragmentation in every block = (4-1)+(8-7)+(8- 7)+(16-14)= 3+1+1+2
= 7MB. Suppose process P5 of size 7MB comes. But this process cannot be accommodated
inspite of available free space because of contiguous allocation (as spanning is not allowed).
Hence, 7MB becomes part of External Fragmentation.
Advantages of Fixed Partitioning –
1. Easy to implement:.
2. Little OS overhead:
Disadvantages of Fixed Partitioning –
1. Internal Fragmentation:
2. External Fragmentation:
3. Limit process size:
4. Limitation on Degree of Multiprogramming:
Variable Partitioning :
It is a part of Contiguous allocation technique. It is used to alleviatevthe problem faced by
Fixed Partitioning. In contrast with fixed partitioning, partitions are not made before the
execution or during system configure. Various features associated with variable Partitioning-
1. Initially RAM is empty and partitions are made during the runtime according to process‟s
need instead of partitioning during system configure.
2. The size of partition will be equal to incoming process.
3. The partition size varies according to the need of the process so
that the internal fragmentation can be avoided to ensure efficient
utilisation of RAM.
4. Number of partitions in RAM is not fixed and depends on the
number of incoming process and Main Memory’s size.
Advantages of Variable Partitioning –
1. No Internal Fragmentation.
2. No restriction on Degree of Multiprogramming.
3. No Limitation on the size of the process.
Disadvantages of Variable Partitioning –
1. Difficult Implementation
2. External Fragmentation

Q12.Ans:-
Each process is represented as a process control block (PCB) in the operating
system. It contains information associated with specific process.
Process State: It indicates current states of a process. Process state can be new,
ready, running, waiting and terminated.
Process number: Each process is identified by its process number, called
process identification number (PID).
Program Counter: It indicates the address of the next instruction to be
executed for the process.
CPU Registers: The registers vary in number and type depending on the
computer architecture. Register includes accumulators, index registers, stack
pointers and general purpose registers plus any condition code information.
Memory Management Information: It includes information such as value of
base and limit registers, page tables, segment tables, depending on the
memory system used by operating system.
Accounting Information: This information includes the amount of CPU used,
time limits, account holders, job or process number and so on. It also includes
information about listed I/O devices allocated to the process such as list of
open files.
Q13.Ans:-
 First-Come - First-Served (FCFS) Scheduling FCFS scheduling is non
preemptive algorithm.
 Once the CPU is allocated to a process, it keeps the CPU until it
releases the CPU, either by terminating or by requesting I/O.
 In this algorithm, a process, that a request the CPU first, is allocated
the CPU first. FCFS scheduling is implemented with a FIFO queue.
 When a process enters the ready queue, its PCB is linked to the tail of
the queue.
 When the CPU is available, it is allocated to the process at the head of
the queue. Once the CPU is allocated to a process, that process is
removed from the queue.
 The process releases the CPU by its own.

Advantage:
It is simple to implement.
Disadvantage:
 This scheduling method is non preemptive, that is, the process will
run until it finishes. Because of this non preemptive
scheduling, short processes which are at the back of the queue have
to wait for the long process at the front to finish.
 It is not suitable for real time systems.
 Average waiting time and average turnaround time is more
comparatively.

Q18.Ans:-
File Attributes:-
 Name: The symbolic file name is the only information kept in human
readable form.
 Identifier: File system gives a unique tag or number that identifies file
within file system and which is used to refer files internally.
 Type: This information is needed for those systems that support
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 determines 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.

You might also like