Device Service Routines

The Device Service routines is a software routine invoked by an interrupt request from a hardware device. It is also known as Interrupt Service Routine (ISR) or simply interrupt handler. It handles the request and sends it to the CPU, interrupting the active process. When the device Service routines is complete, the process is resumed.

The device service routines examine an interrupt and determine how to handle it. Device service routines handle the interrupt, and then return a logical interrupt value. If no further handling is required because the device is disabled or data is buffered, then It notifies the kernel. An device service routine must perform very fast to avoid slowing down the operation of the device and the operation of all lower priority device service routines.

A basic example of an device service routines or Interrupt Service Routine or ISR for short, is a routine that handles keyboard events, such as pressing or releasing a key. Each time a key is pressed, the the ISR processes the input. For example, if you press and hold the right arrow key in a text file, the ISR will signal to the CPU that the right arrow key is depressed. The CPU sends this information to the active word processor or text editing program, which will move the cursor to the right. When you let go of the key, the ISR handles the "key up" event. This interrupts the previous "key down" state, which signals to the program to stop moving the cursor.

Many types of hardware devices, including internal components and external peripherals can sent interrupts to the CPU. Examples include keyboards, mice, sound cards, and hard drives. A device driver enables communication between each of these devices and the CPU. ISRs prioritize interrupt requests based on the Interrupt Request setting of the device (or port). Typically the keyboard is at the top of the Interrupt Request list, while devices like hard drives are further down.

Next Topic :

No comments:

Post a Comment