Operating system Notes
Introduction of Operating System
PROCESS: Program to process, Lifecycle of the process, Process control block, IPC
Protection And Security
What does the processor talk to the I/O device?
The old processors accessed the I/O devices using special I/O instructions. But, today’s processors communicate with the I/O devices via bus. I/O devices are accessed through memory mapped addresses.
There are three methods with which the I/O devices can be accessed by the processor. They are:
In programmed I/O, special I/O instructions are used to communicate with the I/O device
Interrupt driven I/O
Here, the I/O device sends an interrupt signal when it wants to communicate with the processor. When an interrupt occurs, the processor executes the interrupt service routine
Direct Memory Access
In this method, the data is transferred from the memory to the I/O device without the involvement of the CPU. This method is very efficient than the other two methods.
What is DMA?
Direct Memory Access allows the computer to transfer the data directly from the main memory to the I/O device and vice versa. The CPU (or processor) is not involved in this transaction. The DMA is an efficient method because it improves the efficiency of the processor. It speeds up the overall operation of the computer.
Give a description about Device Drivers?
Device drivers help the external I/O device to communicate with the Operating System. Without the device drivers, the interaction between the processor and the I/O devices is impossible. The device driver is a set of files which are hardware specific. The device drivers are needed when the features of the I/O device are not known to the computer.
What is the Life Cycle of an I/O request?
When an I/O request occurs, the current process is blocked if the request is appropriate. Then, the request is processed. Once the I/O operation is completed, the control is transferred to the process, and the output of the I/O operation is returned.
What do you understand by Synchronous and Asynchronous I/O System?
Synchronous I/O system
In a synchronous I/O system, the I/O operations block the current process that is executed by the CPU. Here, the I/O operations are blocking. Synchronous I/O systems can perform either read operation or write operation at a time.
Asynchronous I/O system
In an asynchronous I/O system, the I/O operation and the user processes are executed simultaneously. Many simultaneous read/write operations are allowed. Here, the I/O operations are non-blocking. This system starts the execution of another process before completing the I/O operation. Such systems are more complex and less secure.
What are the Blocking and Non-Blocking input output?
In a blocking IO, the control is not returned to the process thread until the I/O operation is complete. Blocking IO is used in cases in which the process utterly needs the data from the I/O operation, and the process cannot be executed further until the I/O operation is over.
In a non-blocking I/O, the call is returned to the thread before the completion of the I/O operation. After the completion of the I/O call, the resulting data is returned to the corresponding application.
What are the characteristics of I/O Devices?
The following are the characteristics of an I/O device
a.An I/O device enables the users to communicate with the computer
b.The I/O devices can send data to the computer and receive data from the computer
c.The I/O devices require corresponding device drivers to interact with the CPU
d.The I/O devices can directly communicate with the memory through the DMA controller.
e. When an I/O device wants to interact with the CPU, it generates an interrupt signal.
Write about the Kernel I/O subsystem
The kernel provides the following services to the I/O devices:
Scheduling refers to the order in which the I/O requests are processed. This order is decided by the priority of the I/O devices.
Caching helps in storage of data in a memory location which can be accessed by the processor faster than the other memory locations. The cache memory stores the duplicate copy of the data.
Buffer stores the data to be transferred between the devices temporarily.
A spool is a buffer which is similar to a queue. Spooling is the process in which the data is stored temporarily in a queue until the processor executes it.
Any error that occurs during an I/O operation is handled by the kernel.
The kernel provides exclusive access to an I/O device. The system calls are used for allocation and de-allocation of the device.
The I/O operation is considered as a privileged to prevent the usage of illegal I/O instructions by the user.
What are the different modes of Interrupt? How is polling achieved?
The two modes of interrupt are:
Maskable interrupts are the interrupt that can be disabled by the CPU. Usually, lower priority interrupts are maskable. These interrupts are masked, and executed after the execution of the current process.
Non-maskable interrupts are the interrupts that cannot be disabled by the CPU. These are higher priority interrupts. The current process being executed is stopped and the interrupt is handled.
When more than one interrupts occur at a time, the order in which the interrupts have to be serviced is determined the ISR. Polling method orders the interrupts according to their priority. The interrupts with the highest priority is handled first.
Explain the difference between Internal Interrupt and Software Interrupt.