Table of Contents
- What is OS?
- Modes of OS?
- Define system call
- Function of the OS
- Types of Operating Systems
- Define process & Thread
- What is process control block?
- What is a Pipe and when it is used?
- What is bootstrap program?
- Explain demand paging
- Define Race condition
- Define Process synchronization
- What is the difference between main memory and secondary memory?
- What is Critical Section?
- What is thrashing in OS?
- What do you mean by Sockets in OS?
- What do you mean by cascading termination?
- Define Aging
- What is the difference between paging and segmentation?
- What is virtual memory?
- What do you mean by Semaphore in OS? Why is it used?
- Difference between micro kernel and monolithic kernel?
- What do you mean by Belady’s Anomaly?
- Necessary Conditions for Deadlock
- What are overlays?
- What is Buffer?
- What is Banker's Algorithm?
- Logical Address vs Physical Address?
- What is Interrupt?
- What is the Direct Access Method?
- What is Cycle Stealing?
- What is a trapdoor in OS?
- What is a dispatcher?
- What is a critical section?
- Additional Topics
What is OS?
An Operating System (OS) is a collection of software that manages computer hardware resources and provides common services for computer programs. It acts as an interface between the software and computer hardware.
Back to Top↑
Modes of OS
User mode: Applications do not have direct access to system resources; they must make system calls. A failure in user mode affects only that process, with each process having a separate virtual address space.
Kernel mode: Programs have direct access to system resources, and a failure can crash the entire OS. All processes share a single virtual address space.
Back to Top↑
Define system call
A system call is a mechanism used by programs to request services from the operating system (OS). In simpler terms, it is a way for a program to interact with the underlying system, such as accessing hardware resources or performing privileged operations.
Function of the OS
- Memory and Processor Management
- Providing User Interface
- File and Device Management
- Resource Scheduling
- Error Detection
- Security
Types of Operating Systems
There are several types of Operating Systems which are mentioned below.
- Batch Operating System : This type of operating system does not interact with the computer directly. There is an operator which takes similar jobs having the same requirements and groups them into batches.
- Multi-Programming System : Multiprogramming Operating Systems can be simply illustrated as more than one program is present in the main memory and any one of them can be kept in execution.
- Multi-Processing System : Multi-Processing Operating System is a type of Operating System in which more than one CPU is used for the execution of resources
- Multi-Tasking Operating System : Multitasking Operating System is simply a multiprogramming Operating System with having facility of a Round-Robin Scheduling Algorithm. It can run multiple programs simultaneously.
- Time-Sharing Operating System : Each task is given some time to execute so that all the tasks work smoothly. Each user gets the time of the CPU as they use a single system. The time that each task gets to execute is called quantum.
- Distributed Operating System : A distributed System is a collection of autonomous computer systems that are physically separated but are connected by a centralized computer network that is equipped with distributed system software
- Network Operating System : a network operating system(NOS) is software that connects multiple devices and computers on the network and allows them to share resources on the network
- Real-Time Operating System : A real-time operating system (RTOS) is a special kind of operating system designed to handle tasks that need to be completed quickly and on time.
There are two types of RTOS :
Hard real time : missing an occasional deadline can cause any permanent damage. Many of these are found in
industrial process control, car engine control system.
Soft real time : missing an occasional deadline does not cause any permanent damage. Used in digital audio,
multimedia system.
Define process & Thread
- Process: Program in execution.
- Thread: Segment of a process.
Process States: new, ready, run, block, exit.
Back to Top↑
What is process control block?
A Process Control Block (PCB) is a data structure maintained by the OS for every process.
What is a Pipe and when it is used?
The pipe is generally a connection among two or more processes that are interrelated to each other. It is a mechanism that is used for inter-process communication using message passing. One can easily send information such as the output of one program process to another program process using a pipe. It can be used when two processes want to communicate one-way i.e., inter-process communication (IPC).
What is bootstrap program?
It is generally a program that initializes OS during startup i.e., first code that is executed whenever computer system startups. OS is loaded through a bootstrapping process or program commonly known as booting.
Explain demand paging
Demand paging is a method that loads pages into memory on demand. This method is mostly used in virtual memory. In this, a page is only brought into memory when a location on that particular page is referenced during execution.
Define Race condition
The situation where several processes access and manipulate shared data concurrently. The final value of the shared data depends upon which process finishes last.
Define Process synchronization
Process synchronization in OS is the task of coordinating the execution of processes in such a way that no two processes can access the same shared data and resources.
What is the difference between main memory and secondary memory?
-
Main memory: Main memory in a computer is RAM (Random Access Memory).The programs and data that the CPU requires during the execution of a program are stored in this memory.
- Secondary memory: Secondary memory in a computer are storage devices that can store data and programs. Such storage devices are capable of storing high-volume data. Storage devices can be hard drives, USB flash drives, CDs, etc.
What is Critical Section?
Critical Section: The part of program where the shared resource is accessed is called critical section or critical region.
What is thrashing in OS?
It is generally a situation where the CPU performs less productive work and more swapping or paging work. It spends more time swapping or paging activities rather than its execution.
What do you mean by Sockets in OS?
The socket in OS is generally referred to as an endpoint for IPC (Interprocess Communication). Here, the endpoint is referred to as a combination of an IP address and port number.
What do you mean by cascading termination?
Cascading termination is a process termination in which if the parent process is exiting or terminating then the children process will also get terminated. It does not allow the child to continue processing as its parent process terminates. It is generally initiated by OS.
Define Aging
It simply increases the priority of processes that wait in the system for resources for a long period of time.
What is the difference between paging and segmentation?
- Paging: It is generally a memory management technique that allows OS to retrieve processes from secondary storage into main memory. It is a non-contiguous allocation technique that divides each process in the form of pages.
- Segmentation: It is generally a memory management technique that divides processes into modules and parts of different sizes. These parts and modules are known as segments that can be allocated to process.
What is virtual memory?
It is a memory management technique feature of OS that creates the illusion to users of a very large (main) memory. It is simply space where a greater number of programs can be stored by themselves in the form of pages.
What do you mean by Semaphore in OS? Why is it used?
Semaphore is a normal variable that is used to control access to shared resources in multi-threaded or multi-process systems. It maintains a count of available resources and provides two atomic operations: wait() and signal().
Types of Semaphores
There are two main types of semaphores:
Binary semaphore: A binary semaphore is a synchronization object that can only have two values: 0 and 1.
Counting semaphore: A counting semaphore is a synchronization object that can have a value greater than 1.
Difference between micro kernel and monolithic kernel?
MicroKernel :
- In this software or program, kernel services and user services are present in different address spaces.
- If a service crashes, it does affect on working of the microkernel.
Monolithic Kernel:
- In this software or program, kernel services and user services are usually present in the same address space.
- If a service crashes, the whole system crashes in a monolithic kernel.
What do you mean by Belady’s Anomaly?
Belady’s Anomaly is a phenomenon in which if we increase the number of frames in memory, then the number of page faults also increases. It is generally experienced when we use FIFO (First in First out) page replacement algorithm.
Necessary Conditions for Deadlock
There are basically four necessary conditions for deadlock as given below:
Mutual Exclusion: Mutual Exclusion condition requires that at least one resource be held in a non-shareable mode, which means that only one process can use the resource at any given time.
Hold and Wait: The hold and wait condition specifies that a process must be holding at least one resource while waiting for other processes to release resources that are currently held by other processes.
No Pre-emption: resources cannot be taken forcibly from a process a process can only release resources voluntarily after completing its task.
Circular Wait or Resource Wait: This condition implies that circular processes must exist, with each process waiting for a resource held by the next process in the chain.
What are overlays?
The concept of overlays is that whenever a process is running it will not use the complete program at the same time, it will use only some part of it.
What is Buffer?
A buffer is a memory area that stores data being transferred between two devices or between a device and an application.
What is Banker's Algorithm?
The Bankers Algorithm in OS is a deadlock avoidance algorithm used to avoid deadlocks and to ensure safe execution of processes. The algorithm maintains a matrix of maximum and allocated resources for each process and checks if the system is in a safe state before allowing a process to request additional resources.
Logical Address vs Physical Address?
Logical:
- Logical Address Space is a set of all logical addresses generated by the CPU in reference to a program.
- Logical address are generated by CPU.
- Users can view the logical address of a program.
Physical Address:
- Physical Address is a real address where actual data has been stored in the machine and set of all physical addresses mapped to the corresponding logical addresses.
- Computed by MMU.
- Users can never view the physical address of the program.
What is Interrupt?
The interrupt is a signal emitted by hardware or software when a process or an event needs immediate attention. It alerts the processor to a high-priority process requiring interruption of the current working process. In I/O devices one of the bus control lines is dedicated for this purpose and is called the Interrupt Service Routine (ISR).
What is the Direct Access Method?
Direct memory access (DMA) is a method that allows an input/output (I/O) device to send or receive data directly to or from the main memory, bypassing the CPU to speed up memory operations. The process is managed by a chip known as a DMA controller (DMAC).
What is Cycle Stealing?
Cycle stealing is a method of accessing computer memory (RAM) or bus without interfering with the CPU. It is similar to direct memory access (DMA) for allowing I/O controllers to read or write RAM without CPU intervention.
What is a trapdoor in OS?
A trap door is a method of gaining access to information or OS features that are normally beyond a user's access authority. The distinguishing feature of a trap door is that it is intentionally hidden and used only when needed.
What is a dispatcher?
The dispatcher is the module that gives process control over the CPU after it has been selected by the short-term scheduler. This function involves the following:
- Switching context
- Switching to user mode
- Jumping to the proper location in the user program to restart that program
What is a critical section?
When more than one processes access the same code segment that segment is known as the critical section. The critical section contains shared variables or resources which are needed to be synchronized to maintain the consistency of data variables.
Additional topics to be done
- Critical section problem
- Solution for critical section: Software, Hardware, OS based solution
- Peterson Algorithm
- Banker Algorithm
- Semaphore in detail
- Semaphore solution for the Producer Consumer Problem, Dinning Philosopher Problem, Reader Writer Problem. Back to Top↑
Top comments (0)