Os Interview Notes
Os Interview Notes
OS acts as an interface between the user and the computer hardware components.
It is a system software that provides an environment to execute programs.
Every computer systemneeds an os to run programs and interact with the users.
Without os, it would just be one dumb hardware machine.
MAIN FUNCTIONS OF OS ARE:
Memory management, File management, I/O management, Processor management, Device
management,Security,Networking etc.
USER--->APPLICTION --->OPERATING SYSTEM--->HARDWARE
7)What is paging?
Paging is a memory management scheme in which the data is stored and retrieved from
the secondary storage for use in the main memory.
The part of secondary storage that is used for paging is known as virtual memory.
In paging a process is divided into fixed-size contiguous block known as pages & is
stored on secondary storage.
A page is the smallest of data for the memory management used in virtual memory &
the main memory is also divided into fixed size contiguous blocks known as frames.
Pages from the secondary storage are mapped into frames in the main memory & frames
must be kept of same size as the page inorder to have maximum utilization of
memory.
This process of transferring of pages between main memory & virtual memory is
referred to as Paging in Windows OS or Swapping in Linux.
10)What is a Thread?
A thread is the smallest unit of execution within a process. A process can have
multiple threads
It is a light weight process. It breaks up into smaller units that can be used
concurrently thus provides concurrency within a process.
It exists within a process and uses process resources such as code ,date and files.
Just like process it has its own attributes such as thread id ,program counter ,
register set and a stack.
Thread enhances the throughput of the system because when a process is split into
threads the function of each thread is considered as one job
& the no. of jobs done in unit time increases.
In a multiprocessing environment threads can be distributed over a series of
processes & can run in parallel on different processors
11)What is a deadlock?
A deadlock is a situation where the two processes are waiting for each other to
complete in order to start their operation.
This happens when first process is holding a resources and waiting for another
resource that is currently being held by the second process
& the second process is waiting for the resource held by the first process & this
waill cause them to wait forever and be in the state of deadlock
12)What are the necessary conditions that can lead to a deadlock situation in a
system?
There are 4 different conditions that result in deadlock and they are:
Mutual Exclution-a resource cannot be shared between two processes, only one
process can use a particular resource at a time
Hold and wait-A process is holding atleast one resource & waiting for another
resource
Circular wait- a group of processors are waiting for each other to release the
resource and noone is releasing their own resource.