You are on page 1of 9

1. Define Operating System.

Ans. An operating system (OS) is system software that


manages computer hardware and software resources, and
provides common services for computer programs.
Time-sharing operating systems schedule tasks for efficient use
of the system and may also include accounting software for
cost allocation of processor time, mass storage, printing, and
other resources.

2.What is the purpose of command interpreter?


Ans. A command interpreter allows the user to interact with a
program using commands in the form of text lines. It was
frequently used until the 1970’s. However, in modern times many
command interpreters are replaced by graphical user interfaces and
menu-driven interfaces.

3.What is process?
Ans. A process is an active program i.e a program that is under
execution. It is more than the program code as it includes the program
counter, process stack, registers, program code etc. Compared to this,
the program code is only the text section.
A program is not a process by itself as the program is a passive entity,
such as file contents, while the process is an active entity containing
program counter, resources etc.

4.Define Program system?


Ans. System Programming can be defined as the act of building Systems
Software using System Programming Languages. According to Computer System
Programs, and finally Application Programs. Program Development and Execution
can be done conveniently in System Programs. Some of the System Programs are
simply user interfaces, others are complex. It traditionally lies between the user
interface and system calls.
5.What is Context Switching?
Ans. Context Switching involves storing the context or state of a
process so that it can be reloaded when required and
execution can be resumed from the same point as earlier. This
is a feature of a multitasking operating system and allows a
single CPU to be shared by multiple processes.

6. Which scheduler controls the degree of


multiprogramming? How?
Ans. Long Term Schedular controls degree of
multiprogramming.
 Long-term scheduler is also known as Job Scheduler.
 It selects a balanced mix of I/O bound and CPU bound
processes from the secondary memory (new state).
 Then, it loads the selected processes into the main
memory (ready state) for execution.

7.What is turn Around time?


Ans. Turnaround time (TAT) is the amount of time taken to
complete a process or fulfill a request.[1][2] The concept thus
overlaps with lead time and can be contrasted with cycle time.

8. What is CPU I/O Burst Cycle?


Ans. The state of process under execution is called CPU
burst and the state of process under I/O request & its handling
is called I/O burst. Processes alternate between these two
states. Process execution begins with a CPU burst. That is
followed by an I/O burst, which is followed by another CPU
burst, then another I/O burst, and so on.

9.What is Semaphore?
Ans. In computer science, a semaphore is
a variable or abstract data type used to control access to a
common resource by multiple threads and avoid critical
section problems in a concurrent system such as
a multitasking operating system.

10. Define Critical Section problem.


Ans. Critical Section is the part of a program which tries to
access shared resources. That resource may be any resource in
a computer like a memory location, Data structure, CPU or any
IO device.
Solutions to the Critical Section Problem
 a simple algorithm that can be run by two processes to

ensure mutual exclusion for one resource (say one


variable or data structure)
 does not require any special hardware

 it uses busy waiting (a spinlock)

11.Define rollback.
Ans. In database technologies, a rollback is an operation which
returns the database to some previous state. Rollbacks are
important for database integrity, because they mean that the
database can be restored to a clean copy even after erroneous
operations are performed.[1] They are crucial for recovering
from database server crashes; by rolling back
any transaction which was active at the time of the crash, the
database is restored to a consistent state.
The rollback feature is usually implemented with a transaction
log, but can also be implemented via multiversion concurrency
control.

12. List two types of multiprocessor. Explain both in detail.


Ans.

 Loosely coupled multiprocessor system


 Tightly coupled multiprocessor system

1. In loosely-coupled multiprocessor systems, each processor


has its own local memory, input/output (I/O) channels,
and operating system. Processors exchange data over a high-
speed communication network by sending messages via a
technique known as "message passing". Loosely-coupled
multiprocessor systems are also known as distributed-memory
systems, as the processors do not share physical memory and
have individual I/O channels.

2.Multiprocessor system with a shared memory closely


connected to the processors.
A symmetric multiprocessing system is a system with
centralized shared memory called main memory (MM)
operating under a single operating system with two or more
homogeneous processors.

13.List and explain services provided by operating system.

Ans. Service provided by operating system:-


1. Program execution
2. I/O operations
3. File system manipulation
4. Communication
5. Error detection
6. Resource allocation
7. Protection

14. Explain the process Control Block with a diagram.


Ans.
A process control block (PCB) is a data structure used by computer operating systems to store
all the information about a process. It is also known as a process descriptor. When a process is
created (initialized or installed), the operating system creates a corresponding process control
block.
This specifies the process state i.e. new, ready, running, waiting or terminated.

15,What is CPU scheduling? State criteria of CPU scheduling.


Ans.
*CPU scheduling is a process that allows one process to use the
CPU while the execution of another process is on hold(in waiting
state) due to unavailability of any resource like I/O etc, thereby
making full use of CPU. The aim of CPU scheduling is to make the
system efficient, fast, and fair.

Whenever the CPU becomes idle, the operating system must select
one of the processes in the ready queue to be executed. The
selection process is carried out by the short-term scheduler (or CPU
scheduler). The scheduler selects from among the processes in
memory that are ready to execute and allocates the CPU to one of
them.

*The CPU scheduler determines the order and priority in which processes
are executed and allocates CPU time accordingly, based on various criteria
such as CPU utilization, throughput, turnaround time, waiting time, and
response time.
16.Diffrence between Preemptive and non preemptive scheduling.
Ans.
S.No. Preemptive Scheduling Non-Preemptive Scheduling

The CPU scheduling in which the The type of scheduling in which once the resources
resources (CPU Cycle) have been (CPU Cycle) have been allocated to a process, the
1. allocated to a process for a limited process holds it until it completes its burst time or
amount of time is known as preemptive switches to the 'wait' state is known as non-
scheduling. preemptive scheduling.

In the preemptive scheduling, a process In the non-preemptive scheduling, a process cannot


2. can be interrupted when it is being be interrupted until it terminates itself or its time is
executed. over.

If a process that has a high priority If a process that has a long burst time is running the
3. arrives frequently in the 'ready' queue, CPU, then the process that has less CPU burst time
the low priority processes may starve. would starve

4. It has overheads. It does not have overheads.

5. It is flexible in nature. It is not flexible in nature.

6. It is expensive. It is not expensive.

Examples − Round Robin scheduling, Examples − First Come First Serve and Shortest Job
7. Shortest Remaining Time First First.
scheduling.

17.Explian Reader’s And Writer’s Problem?


Ans.
This is a synchronisation problem which is used to test newly
proposed synchronisation scheme. The problem statement is,
if a database or file is to be shared among several concurrent
process, there can be broadly 2 types of users –

 Readers – Reader are those processes/users which only


read the data
 Writers – Writers are those processes which also write,
that is, they change the data .

It is allowed for 2 or more readers to access shared data,


simultaneously as they are not making any change and even
after the reading the file format remains the same.

But if one writer(Say w1) is editing or writing the file then it


should locked and no other writer(Say w2) can make any
changes until w1 has finished writing the file.

18.Explian Resource Allocation graph.

Ans.
As Banker’s algorithm using some kind of table like allocation, request, available all
that thing to understand what is the state of the system. Similarly, if you want to
understand the state of the system instead of using those table, actually tables are
very easy to represent and understand it, but then still you could even represent the
same information in the graph. That graph is called Resource Allocation Graph
(RAG).
So, resource allocation graph is explained to us what is the state of the system in
terms of processes and resources. Like how many resources are available, how
many are allocated and what is the request of each process. Everything can be
represented in terms of the diagram. One of the advantages of having a diagram is,
sometimes it is possible to see a deadlock directly by using RAG, but then you might
not be able to know that by looking at the table. But the tables are better if the
system contains lots of process and resource and Graph is better if the system
contains less number of process and resource.
We know that any graph contains vertices and edges. So RAG also contains vertices
and edges. In RAG vertices are two type –
1. Process vertex – Every process will be represented as a process vertex.Generally,
the process will be represented with a circle.
2. Resource vertex – Every resource will be represented as a resource vertex. 

19.Explian necessary conditions for deadlock


Ans.
 is a situation which involves the interaction of more than one resources and
processes with each other. We can visualise the occurrence of deadlock as a situation
where there are two people on a staircase. One is ascending the staircase while the
other is descending. The staircase is so narrow that it can only fit one person at a
time. As a result, one has to retreat while the other moves on and uses the staircase.
Once that person has finished, the other one can use that staircase. But here, neither
person is willing to retreat and waits for the other to retreat. None of them are able to
use the staircase. The people here are the processes, and the staircase is the resource.
When a process requests for the resource that is been held another process which
needs another resource to continue, but is been held by the first process, then it is
called

a deadlock.   T
here are four conditions necessary for the occurrence of a deadlock. They can be
understood with the help of the above illustrated example of staircase:
1. Mutual Exclusion: When two people meet in the landings, they can’t just
walk through because there is space only for one person. This condition
allows only one person (or process) to use the step between them (or the
resource) is the first condition necessary for the occurrence of the
deadlock.
2. Hold and Wait: When the two people refuse to retreat and hold their
ground, it is called holding. This is the next necessary condition for
deadlock.
3. No Preemption: For resolving the deadlock one can simply cancel one of
the processes for other to continue. But the Operating System doesn’t do
so. It allocates the resources to the processors for as much time as is
needed until the task is completed. Hence, there is no temporary
reallocation of the resources. It is the third condition for deadlock.
4. Circular Wait: When the two people refuse to retreat and wait for each
other to retreat so that they can complete their task, it is called circular
wait. It is the last condition for deadlock to occur.

You might also like