0% found this document useful (0 votes)
26 views15 pages

Os Viva Questions

An operating system is system software that manages computer hardware and software resources, providing services for computer programs. It performs functions such as process management, memory management, and device management, while also handling scheduling and deadlock situations. Key concepts include processes, threads, memory allocation strategies, and various algorithms for scheduling and deadlock avoidance.

Uploaded by

whatsapplachu04
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)
26 views15 pages

Os Viva Questions

An operating system is system software that manages computer hardware and software resources, providing services for computer programs. It performs functions such as process management, memory management, and device management, while also handling scheduling and deadlock situations. Key concepts include processes, threads, memory allocation strategies, and various algorithms for scheduling and deadlock avoidance.

Uploaded by

whatsapplachu04
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/ 15

1. What is an operating system?

 An operating system is system software that manages computer


hardware, software resources, and provides common services for
computer programs. It acts as an intermediary between the computer
hardware and user applications.
2. Explain the role of an operating system.
 The role of an operating system includes managing hardware
resources, providing a user interface, facilitating communication
between software and hardware, managing files and directories, and
handling errors and exceptions.
3. What are the main functions of an operating system?
 The main functions of an operating system include process
management, memory management, device management, file system
management, and user interface management.
4. Differentiate between a process and a thread.
 A process is an instance of a program that is being executed, while a
thread is the smallest unit of execution within a process. Multiple
threads can exist within a single process and share the process's
resources.
5. What is a scheduler? Explain its types.
 A scheduler is a component of the operating system that selects
processes from the ready queue and allocates the CPU to them. Types
of schedulers include long-term schedulers (for selecting processes
from the job queue to the ready queue), short-term schedulers (for
selecting processes from the ready queue to the CPU), and medium-
term schedulers (for swapping processes between main memory and
disk).
6. Describe the process scheduling algorithms.
 Process scheduling algorithms include First Come First Serve (FCFS),
Shortest Job Next (SJN), Shortest Remaining Time (SRT), Round Robin
(RR), Priority Scheduling, and Multilevel Queue Scheduling.
7. What is CPU scheduling? Why is it important?
 CPU scheduling is the process of determining which process gets the
CPU at any given time. It is important for efficient utilization of the CPU
and to ensure fairness and responsiveness in multitasking
environments.
8. What is deadlock? How can it be prevented?
 Deadlock is a situation where two or more processes are unable to
proceed because each is waiting for the other to release a resource.
Deadlock can be prevented using techniques such as deadlock
avoidance, deadlock detection, and deadlock prevention.
9. Explain the concept of memory management in an operating
system.
 Memory management involves allocating and deallocating memory
space to processes, ensuring protection and access control, and
managing virtual memory.
10. What are the different memory allocation strategies?
 Memory allocation strategies include contiguous memory allocation,
non-contiguous memory allocation (paging and segmentation), and
virtual memory allocation.

What is a real-time system?


Real-time system is used in the case when rigid-time requirements have
been placed on the operation of a processor. It contains a well defined and
fixed time constraints.

6) What is kernel?
Kernel is the core and most important part of a computer operating system
which provides basic services for all parts of the OS.

What do you mean by a process?


An executing program is known as process. There are two types of
processes:

o Operating System Processes


o User Processes

What are the different states of a process?


A list of different states of process:

o New Process
o Running Process
o Waiting Process
o Ready Process
o Terminated Process

What is the use of paging in operating system?


Paging is used to solve the external fragmentation problem in operating
system. This technique ensures that the data you need is available as quickly
as possible.

What is the concept of demand paging?


Demand paging specifies that if an area of memory is not currently being
used, it is swapped to disk to make room for an application's need.

What is virtual memory?


Virtual memory is a very useful memory management technique which
enables processes to execute outside of memory. This technique is
especially used when an executing program cannot fit in the physical
memory.

What are the four necessary and sufficient conditions behind the
deadlock?
Mutual Exclusion Condition: It specifies that the resources involved are
non-sharable.

2) Hold and Wait Condition: It specifies that there must be a process that
is holding a resource already allocated to it while waiting for additional
resource that are currently being held by other processes.

3) No-Preemptive Condition: Resources cannot be taken away while they


are being used by processes.

4) Circular Wait Condition: It is an explanation of the second condition. It


specifies that the processes in the system form a circular list or a chain where each
process in the chain is waiting for a resource held by next process in the chain.

What is Banker's algorithm?


Banker's algorithm is used to avoid deadlock. It is the one of deadlock-
avoidance method. It is named as Banker's algorithm on the banking system
where bank never allocates available cash in such a manner that it can no
longer satisfy the requirements of all of its customers.

What is the difference between logical address space and


physical address space?
Logical address space specifies the address that is generated by CPU. On the
other hand physical address space specifies the address that is seen by the
memory unit.

What is fragmentation?
Fragmentation is a phenomenon of memory wastage. It reduces the capacity
and performance because space is used inefficiently.

How many types of fragmentation occur in Operating System?


There are two types of fragmentation:

o Internal fragmentation: It is occurred when we deal with the


systems that have fixed size allocation units.
o External fragmentation: It is occurred when we deal with systems
that have variable-size allocation units.

What is semaphore?
Semaphore is a protected variable or abstract data type that is used to lock
the resource being used. The value of the semaphore indicates the status of
a common resource.

There are two types of semaphore:

o Binary semaphores
o Counting semaphores

What are the Operations in Semaphores?


The Operations in Semaphores are:

1. Wait or P Function ()
2. Signal or V Function ()

What is a binary Semaphore?


Binary semaphore takes only 0 and 1 as value and used to implement
mutual exclusion and synchronize concurrent processes.

What is Belady's Anomaly?


Belady's Anomaly is also called FIFO anomaly. Usually, on increasing the
number of frames allocated to a process virtual memory, the process
execution is faster, because fewer page faults occur. Sometimes, the reverse
happens, i.e., the execution time increases even when more frames are
allocated to the process. This is Belady's Anomaly. This is true for certain
page reference patterns.

What is starvation in Operating System?


Starvation is Resource management problem. In this problem, a waiting
process does not get the resources it needs for a long time because the
resources are being allocated to other processes.

What is aging in Operating System?


Aging is a technique used to avoid the starvation in resource scheduling
system.

What are overlays?


Overlays makes a process to be larger than the amount of memory allocated
to it. It ensures that only important instructions and data at any given time
are kept in memory.

What is a System Call in Operating Systems?


Programs can communicate with the operating system by making a system
call. When a computer application requests anything from the kernel of the
operating system, it performs a system call.System call uses Application
Programming Interfaces(API)to deliver operating system services to user
programs

What are the differences between Thread and Process

Thread Process
Threads are executed within the same Processes are executed in the different memory
process spaces

Threads are not independent of each Processes are independent of each other
other

What are the types of Threads in Operating System?


The types of Threads in Operating System are:

1. User Level Threads


2. Kernel Level Threads

What is the Difference between Dispatcher and Scheduler?

Dispatcher Scheduler

Dispatcher is the one who Scheduler is the one which selects a process
moves the process to the which is feasible to be executed at this point
desired state of time.

The time taken by Dispatcher is The Time taken by the Scheduler is not
known as Dispatch Latency counted basically

Dispatcher is dependent on Scheduler is not dependent of Dispatcher


Scheduler

Dispatcher allows Context Scheduler only allows the process to the ready
Switching to occur queue

What are the methods of Handling Deadlocks?


The methods of handling deadlock are:

1. Deadlock Prevention
2. Deadlock Detection and Recovery
3. Deadlock Avoidance
4. Deadlock Ignorance

How can we avoid Deadlock?


We can avoid Deadlock by using Banker's Algorithm.

How can we detect and recover the Deadlock occurred in


Operating System?
First, what we need to do is to allow the process to enter the deadlock state.
So, it is the time of recovery.

We can recover the process from deadlock state by terminating or aborting


all deadlocked processes one at a time.

Process Pre Emption is also another technique used for Deadlocked Process
Recovery.

What is paging in Operating Systems?


Paging is a storage mechanism. Paging is used to retrieve processes from
secondary memory to primary memory.

The main memory is divided into small blocks called pages. Now, each of the
pages contains the process which is retrieved into main memory and it is
stored in one frame of memory.

It is very important to have pages and frames which are of equal sizes which
are very useful for mapping and complete utilization of memory.

What is Address Translation in Paging?


Logical and physical memory addresses, both of which are distinct, are the
two types of memory addresses that are employed in the paging process.
The logical address is the address that the CPU creates for each page in the
secondary memory, but the physical address is the actual location of the
frame where each page will be allocated. We now require a technique known
as address translation carried out by the page table in order to translate this
logical address into a physical address.

What is Translational Look Aside Buffer?


Whenever logical address is created by the Central Processing Unit (CPU),
the page number is stored in the Translational Look Aside Buffer. Along, with
the page number, the frame number is also stored.

What are Page Replacement Algorithms in Operating Systems?


The Page Replacement Algorithms in Operating Systems are:

1. First In First Out


2. Optimal
3. Least Recently Used
4. Most Recently Used

5. What is a device
queue?
6. A list of processes
waiting for a particular
I/O device is
7. called device queue.
8. What is a long term
scheduler?
9. Long term schedulers
are the job schedulers
that select processes
from
10.the job queue and load
them into memory for
execution.
11.What are short term
scheduler?
12.The short term
schedulers are the CPU
schedulers that select a
process
13.form the ready queue
and allocate the CPU to
one of them.
14. What is context
switching?
15. Transferring the
control from one
process to other
process
16. requires saving the
state of the old process
and loading the
17. saved state for new
process.
18. What is a device
queue?
19. A list of processes
waiting for a particular
I/O device is
20. called device
queue.
21.What is a long term
scheduler?
22.Long term schedulers
are the job schedulers
that select processes
from
23.the job queue and load
them into memory for
execution.
24.What are short term
scheduler?
25.The short term
schedulers are the CPU
schedulers that select a
process
26.form the ready queue
and allocate the CPU to
one of them.
27. What is context
switching?
28. Transferring the
control from one
process to other
process
29. requires saving the
state of the old process
and loading the
30. saved state for new
process.
What is a device queue?
A list of processes
waiting for a particular
I/O device is
called device queue.
What is a long term
scheduler?
Long term schedulers are
the job schedulers that
select processes from
the job queue and load
them into memory for
execution.
What are short term
scheduler?
The short term schedulers
are the CPU schedulers that
select a process
form the ready queue and
allocate the CPU to one of
them.
What is context
switching?
Transferring the control
from one process to
other process
requires saving the state
of the old process and
loading the
saved state for new
process.
What is a device queue? A list of processes waiting for a particular I/O
device is called device queue.
What is a long term scheduler? Long term schedulers are the job
schedulers that select processes from the job queue and load them into
memory for execution.
What are short term scheduler? The short term schedulers are the CPU
schedulers that select a process form the ready queue and allocate the CPU
to one of them.
What is context switching? Transferring the control from one process to
other process requires saving the state of the old process and loading the
saved state for new process.

You might also like