0% found this document useful (0 votes)
24 views10 pages

Os Viva Questions

The document contains a comprehensive set of viva questions and answers regarding operating systems, covering fundamental concepts such as the definition of an operating system, the roles of the kernel and shell, types of operating systems, and various functions and services provided by operating systems. It also discusses processes, threads, scheduling, memory management, and issues like deadlocks and fragmentation. Additionally, it explains key terms and concepts related to performance metrics and resource management in operating systems.

Uploaded by

athilgg
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)
24 views10 pages

Os Viva Questions

The document contains a comprehensive set of viva questions and answers regarding operating systems, covering fundamental concepts such as the definition of an operating system, the roles of the kernel and shell, types of operating systems, and various functions and services provided by operating systems. It also discusses processes, threads, scheduling, memory management, and issues like deadlocks and fragmentation. Additionally, it explains key terms and concepts related to performance metrics and resource management in operating systems.

Uploaded by

athilgg
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/ 10

CSL 204 Operating Systems Lab

VIVA QUESTIONS – Operating systems

1. What is an operating system?


An operating system is a program that acts as an intermediary between the user
and the computer hardware.
The purpose of an OS is to provide a convenient environment in which user can
execute programs in a convenient and efficient manner.
2. What is kernel and shell
kernel is the core part of an operating system. It acts as a bridge between the
hardware and software.
The shell is the interface between the user and the kernel. It interprets user
commands and passes them to the kernel for execution.
3. What are the different operating systems?
1. Batched operating systems - Batched Operating Systems are early types of
operating systems where similar jobs are grouped (batched) together and
executed one after another without user interaction.
2. Multi-programmed operating systems- A multi-programmed operating
system allows multiple programs to be loaded into memory and executed
simultaneously, improving CPU utilization by keeping it busy at all times.
3. timesharing operating systems - a type of multitasking OS that allows
multiple users to access the system simultaneously by sharing CPU time
4. Distributed operating systems - manages a group of independent computers
and makes them appear to the users as a single unified system.
5. Real-time operating systems - designed to process data and respond to inputs
or events within a guaranteed time frame, often in real-world, time-critical
applications.
4. Functions and services of Operating systems

Dept. of CSE MBITS


1
CSL 204 Operating Systems Lab
• Process management- Handles creation, scheduling, and termination of
processes. Allocates CPU time to processes.

• Memory management- Manages RAM (main memory) and allocates memory to


programs. Keeps track of memory usage.
• Network management-
• Error Detection and Handling- Detects and handles errors in hardware, software,
and users' programs.
• Program Execution-Loads and runs programs, manages execution.
• I/O Operations-Handles input/output operations on devices.
• File System Manipulation-Allows programs and users to create, read, write, and
delete files.
• Communication Services - Allows processes to communicate with each other
(Inter-Process Communication).
• Resource Allocation-Allocates CPU, memory, and I/O to various programs and
users.
• Security and Protection-Restricts unauthorized access to system resources and
data.
• System Monitoring-Tracks system performance and resource usage.
5. What is a boot-strap program?
Bootstrapping is a technique by which a simple computer program activates
a more complicated system of programs.
6. What is booting?
Booting is the process of starting or restarting a computer. It involves loading the
operating system (OS) into the computer’s main memory (RAM) so that the
system becomes ready for use.
7. Booting steps
ii Power On – When the computer is turned on, power is supplied to all
components.
Dept. of CSE MBITS
2
CSL 204 Operating Systems Lab
iii POST (Power-On Self-Test) – The system checks hardware components (like
RAM, CPU, keyboard) to ensure they’re working properly.
iiii BIOS/UEFI Execution – The BIOS (Basic Input/Output System) or UEFI
(newer firmware) looks for a bootable device (like a hard disk, SSD, or USB).
iiv Bootloader – A small program called the bootloader (like GRUB in Linux or
Windows Boot Manager) is loaded from the boot sector.
iv Loading OS – The bootloader loads the operating system into RAM.
ivi OS Initialization – The operating system starts system services and prepares
the system for user interaction.
8. What is BIOS?
A BIOS is software that is put on computers which allows the user to configure
the input and output of a computer.
9. What are residence monitors?
Early operating systems were called residence monitors.
10.What is dual-mode operation?
In order to protect the operating systems and the system programs from the
malfunctioning programs the two mode operations were evolved:
1. System mode.
2. User mode.
Here the user programs cannot directly interact with the system resources, instead
they request the operating system which checks the request and does the required
task for the user programs-DOS was written for / intel 8088 and has no dual-
mode.
Pentium provides dual-mode operation.
11.What are system calls?
System calls provide the interface between a process and the operating system.
Eg: fork() -to create a new process
kill()-used to send a signal to a process.
exit()-to terminate the current process.

Dept. of CSE MBITS


3
CSL 204 Operating Systems Lab
wait()-is used by a parent process to pause its execution until one of its child
processes finishes (terminates).
12.What is a layered approach and what is its advantage?
Layered approach is a step towards modularizing of the system, in which the
operating system is broken up into a number of layers (or levels), each built on
top of lower layer. The bottom layer is the hard ware and the top most is the user
interface.
13.What are a virtual machines and site their advantages?
It is the concept by which an operating system can create an illusion that a process
has its own processor with its own (virtual) memory.
14.What is a process?
A program in execution is called a process. Process is an active entity whereas
program is passive
15.What are the states of a process?
1. New
2. Running
3. Waiting
4. Ready
5. Terminated
16.What are various scheduling queues?
1. Job queue
2. Ready queue
3. Device queue
17.What is a job queue?
When a process enters the system it is placed in the job queue.
18.What is a ready queue?
The processes that are residing in the main memory and are ready and waiting to
execute are kept on a list called the ready queue.
19.What is a device queue?

Dept. of CSE MBITS


4
CSL 204 Operating Systems Lab
A list of processes waiting for a particular I/O device is called device queue. (like
a printer, disk, or network interface)
20.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.
21.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.
22.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.
23.What is a thread?
A thread is a program line under execution. Thread sometimes called a light-
weight process, is a basic unit of CPU utilization.
Difference between a process and thread
Feature Process Thread

An independent program in A lightweight sub-task within


Definition
execution with its own memory a process

Shares the same memory


Memory Has its own memory space with other threads of the
process

Processes are isolated from Threads are not isolated, they


Isolation
each other share resources

Inter-process communication Threads communicate easily


Communication
(IPC) is slow and complex and quickly

Higher overhead (more Lower overhead (less


Overhead
resources needed) resource usage)

Dept. of CSE MBITS


5
CSL 204 Operating Systems Lab
24.What are types of threads?

1. User thread
2. Kernel thread
User threads are easy to create and are created in user space.
Kernel threads are supported directly by the operating system.
25.What are multithreading models?
• Many-to-one model
• One-to-one model
• Many-to –many
26.What is process synchronization?
A situation, where several processes access and manipulate the same data
concurrently and the outcome of the execution depends on the particular order in
which the access takes place, is called race condition. To guard against the race
condition we need to ensure that only one process at a time can be manipulating
the same data. The technique we use for this is called process synchronization.
27.What is CPU Scheduler?
Selects from among the processes in memory that are ready to execute,
and allocates the CPU to one of them.
28.What is Throughput, Turnaround time, waiting time and Response time?
Throughput – number of processes that complete their execution per
time unit.
Turnaround time – amount of time to execute a particular process
Waiting time – amount of time a process has been waiting in the ready
queue.
Response time – amount of time it takes from when a request was submitted until
the first response is produced, not output.

29.What is race condition?

Dept. of CSE MBITS


6
CSL 204 Operating Systems Lab
A situation, where several processes access and manipulate the same data
concurrently and the outcome of the execution depends on the particular order in
which the access takes place, is called race condition.
30.What is critical section problem?
Critical section is the code segment of a process in which the process may be
changing common variables, updating tables, writing a file and so on. Only one
process is allowed to go into critical section at any given time (mutually
exclusive).
The three basic requirements of critical section are:
1. Mutual exclusion
2. Progress
3. bounded waiting
31.What is a semaphore?
A semaphore is an integer variable that, apart from initialization, is accessed only
through two standard atomic operations: Wait and Signal.
32.What is dining philosophers’ problem?
Consider 5 philosophers who spend their lives thinking and eating. The
philosophers share a common circular table surrounded by 5 chairs, each
belonging to one philosopher. In the center of the table is a bowl of rice, and the
table is laid with five single chop sticks. When a philosopher thinks, she doesn’t
interact with her colleagues.
From time to time, a philosopher gets hungry and tries to pick up two chop sticks
that are closest to her .A philosopher may pick up only one chop stick at a time.
Obviously she can’t pick the stick in some others hand. When a hungry
philosopher has both her chopsticks at the same time, she eats without releasing
her chopsticks. When she is finished eating, she puts down both of her chopsticks
and start thinking again.
33.What is a deadlock?
A deadlock is a situation in operating systems where two or more processes are
unable to proceed because each is waiting for the other to release a resource.
Dept. of CSE MBITS
7
CSL 204 Operating Systems Lab
34.What is resource allocation graph?
This is the graphical description of deadlocks. This graph consists of a set of
edges E and a set of vertices V. The set of vertices V is partitioned into two
different types of nodes P={p1,p2,…,pn}, the set consisting of all the resources
in the system, R={r1,r2,…rn}.
A directed edge Pi to Rj is called a request edge;
a directed edge Rj to Pi is called an assignment edge.
Pictorially we represent a process Pi as a circle, and each resource type Rj as
square.
35.What are deadlock prevention techniques?
1. Mutual exclusion : Some resources such as read only files shouldn’t be
mutually exclusive. They should be sharable. But some resources such as printers
must be mutually exclusive.
2. Hold and wait : To avoid this condition we have to ensure that if a process is
requesting for a resource it should not hold any resources.
3. No preemption : If a process is holding some resources and requests another
resource that cannot be immediately allocated to it (that is the process must wait),
then all the resources currently being held are preempted(released
autonomously).
36.Circular wait : the way to ensure that this condition never holds is to impose a
total ordering of all the resource types, and to require that each process requests
resources in an increasing order of enumeration.
37.What is a safe state and a safe sequence?
A system is in safe state only if there exists a safe sequence.
A sequence of processes is a safe sequence for the current allocation state if, for
each Pi, the resources that the Pi can still request can be satisfied by the currently
available resources plus the resources held by all the Pj, with j.
38.What is virtual memory?
A virtual memory is hardware technique where the system appears to have more
memory that it actually does.
Dept. of CSE MBITS
8
CSL 204 Operating Systems Lab
39.What is cache memory?
Cache memory is a small, high-speed memory located close to the CPU that stores
frequently accessed data and instructions.
It acts as a buffer between the CPU and the main memory (RAM).
Cache memory is faster than RAM but much smaller in size.
It helps reduce the time it takes for the CPU to access data from the main memory.
What is paging
Paging is a memory management technique used in operating systems to allow
non-contiguous memory allocation, which helps avoid fragmentation and
efficiently manage physical memory.
What is demand paging
Demand Paging is a memory management technique used in virtual memory
systems where pages are loaded into RAM only when they are needed, rather
than loading the entire process into memory at once.
40.What is fragmentation

Fragmentation is a memory management issue where usable memory is wasted


or inefficiently used, making it harder to allocate space to processes — even if
there's technically enough memory available.
41.What is External Fragmentation
- Happens in contiguous memory allocation.
- Free memory is scattered in small blocks across the system.
- Even though total free memory might be enough, there’s no single large block
to satisfy a request.
Like trying to park a bus in a lot full of motorcycles — there’s space, just not
enough in one spot.
42.What is Internal Fragmentation
-Happens when allocated memory is slightly larger than the requested memory.
-The unused portion inside the allocated block is wasted.

Dept. of CSE MBITS


9
CSL 204 Operating Systems Lab
Like ordering a large pizza and eating only ¾ of it every time — that leftover
crust adds up.
43.What is starvation and aging?
Starvation: Starvation is a resource management problem where a process does
not get the resources it needs for a long time because the resources are being
allocated to other processes.
Aging: Aging is a technique to avoid starvation.
44.What is Belady’s Anomaly
Belady’s Anomaly is a phenomenon in operating systems where increasing the
number of page frames results in more page faults
More page frames → more page faults
Usually seen in FIFO page replacement
45.Define the following
Seek Time
• The time it takes for the disk’s read/write head to move to the track where the
required data is located.
Rotational Latency (Rotational Delay)
• The time it takes for the desired sector of the disk (on the track) to rotate under
the read/write head.
Transfer Time
• The time taken to actually transfer the data once the read/write head is in
position.
Access Time
• Total time to access data from the disk.
• Access Time = Seek Time + Rotational Latency + transfer time
Bandwidth
• The rate of data transfer — how much data can be moved in a given amount of
time.

Dept. of CSE MBITS


10

You might also like