question archive A) From the point of view of the device driver, data may be read from an I/O device using polling, Interrupt-driven programmed I/O, or Direct Memory Access (DMA)
Subject:Computer SciencePrice:3.86 Bought12
A) From the point of view of the device driver, data may be read from an I/O device using polling, Interrupt-driven programmed I/O, or Direct Memory Access (DMA). Explain each of above terms, and in each case outline using pseudo-code (or a flow chart) the flow of control in the device driver when reading data from the device. [14 Marks]
B) Give an example situation in which operating systems effectively consider disk storage to be fourth type of "memory". [2 Marks]
C) Explain the operation of a multi-level feedback queue in process scheduling. [4 Marks]
A)Polling
The simplest way to communicate the I/O device with the processor. It periodically checks the device status for next I/O operation. The status register had the information from the I/O device then the processor reach the status register to get the information.
Pseudocode for polling:
#Host action
While value becomes zero
read controller busy bit
Write the command in command register
If output
set write bit
Write byte in data out register.
If input
read data in data-in register,
Set read bit as 0.
Set command ready bit as 1.
#Controller action
If command-ready bit set
Set busy bit as 1.
Read command register
If write bit set
read information from data-out
performs I/O operation
If read bit set
Load data-in register
Clear command ready bit
Clear error bit
Clear busy bit.
Interrupt-driven programmed I/O:
An interrupt signal was given by the controller in the bus when the CPU's attention was needed. The interrupt signal was received by the CPU then it saves the current status and it invokes the appropriate handler by using interrupt vector.
Pseudocode for Interrupt-driven programmed I/O:
Direct Memory Access:
The CPU grants authority for the I/O module to write to memory or read from the memory without the involvement. The data can be exchanged between the I/O device and the main memory. The DMA controller is the special hardware for the DMA which manages the arbitrary access and the data transfer in the system bus.
DMA Pseudocode:
B) Example for Disk Storage:
Hard Disk Drive is one of the disk storage devices used to store information in the form of magnetic storage to record and retrieve magnetic information.
For anyone gonna buy a new laptop or a computer the hard disk specification must be noted because the hard disk used to store text documents, photographs, videos, etc. If the hard disk space is high then the system performance is also high. So the hard disk plays an important role in specification.
C) Multi-level Feedback Queue Scheduling:
The process can be allowed by the multi-level feedback queue between the queues.
The operations are:
A multilevel feedback queue scheduler is determined by the number of the queues, each queue algorithm scheduling, high priority queue, low priority queue, the process needs to enter, and the service for the process.
It was the most general scheme and it was the most complex one.
Step-by-step explanation
Description of the pseudocode and terms as specified:
A)Polling:
Interrupt-driven programmed I/O:
Direct Memory Access:
B) Example for Disk Storage
The hard disk drive is an example of disk storage. It stores more information based on hard disk space available. The system contains more information. Hard disk space is almost full then the execution time for every application becomes high. Because to load every content takes too much time.
C) Multi-level Feedback Queue Scheduling:
Multi-level feedback queue scheduling continuously analyzes the execution time of the processes based on the priority that is a high priority and the low priority.