Os - Viva Questions
Os - Viva Questions
Ans. OS is used for communication between the computer systems and their peripherals and also
provides an environment for the development and execution of programs. It also provides a
means by which a user can give instructions to the computer system.
2. What are the differences between UNIX and Linux Operating systems?
Ans. The major differences are –
Free of Cost
6. What is a lock?
Ans. A lock is an object which allows the manipulation or prevents manipulation of an object by
one thread. Only that thread that has the key can unlock it and use or change it.
Kernel level thread: Kernel threads are implemented by OS and are independent in
nature.
13. If a Kernel Level Thread is blocked will that stop all other processes?
Ans. No, Kernel level threads are implemented by OS, and hence if one gets blocked OS can
schedule the operation to different other processors in a multiprocessor system, and hence all
other processes can be performed easily.
Ready: Process after creation in between new and ready is picked up by the OS to the
main memory and is getting ready for dispatch for execution.
Waiting: The process might require I/O and hence needs to wait for the completion of
that I/O operation. This waiting does not require CPU but remains in the main memory.
Suspended blocked: Similar to suspended ready, but swaps the process which was using
I/O operation and lack of memory cause this swapping.
Process ID
Process State
I/O operations
Scheduling information
Registers
Program Counter
Memory Limits
Pre-emptive Scheduling
Long term Schedulers or Job scheduler: This works as a selector of processes in the
ready state. It brings multiple processes in the ready state. This also control the degree of
multiprogramming.
Medium term Schedulers: This is responsible for the swapping in and out of the
processes from the main memory to secondary memory and vice-versa. This is necessary
if the main memory goes overloaded, we need to free it up for further executions.
Short term schedulers: These are also called CPU schedulers which is responsible for
selecting a process from the ready state and dispatch it to processor for execution. It does
not load the process in the processor but it dispatched it only. The loading is done by
Dispatcher. Context Switching is done by this dispatcher.
Response time: first time when process gets CPU -arrival time
Multilevel Queueing
Mutual Exclusion: Only one process can access a resource at a given time (or there are
limited number of the same resource).
Hold and Wait: Processes already holding a resource can request additional resources
without releasing their current resources.
Circular Wait: Two or more processes form a circular chain where each process is
waiting on another resource in the chain.
Shared Memory
Message Passing
32. Is it possible for a thread to acquire more than one lock (Mutex)?
Ans. Yes, a thread can need more than one resources and hence more locks but it is logically
unnecessary to have multiple locks for the same resource for the same thread.
33. Does a thread always get blocked if its required resource is not available?
Ans. Not really, if a thread is capable to skipping the particular section and pick up the next
section of task it can always do so.
Dots in the resource vertex denotes number of instances of that resource present
Edges: these are the arrows or directions for assignment or dependency of resources to a
process.
Accumulators
Index Registers
Stack Pointer
Multi-programmed OS
Timesharing OS
Distributed OS
Batched OS
Real-time OS