Tuesday 3 November 2015

Buffers and Interrupts


Buffer

  • A buffer is a small amount of fast memory which is used as temporary data. The processor can store and receive data from the buffer quickly and then gets on with another task while the storage device takes its time reading or sending data. 
  • Saving data from primary storage has two stages: 
      • fill the processor from the buffer 
      • empty the buffer to storage.
  • This system will work if the buffer can hold all the data it needs to that needs to be sent top the storage device. however, if there is more data than will fit in the buffer the storage device needs to tell the processor that it has used all data in the buffer. 


Interrupts
  • The storage device sends an interrupt a signal to the processor that needs attention. When the processor receives this interrupt it stores it and carries on with what it is doing. When it is finished it checks all the interrupts and services and does the most important one first.
  • The use of an interrupt is widespread in any computer system any devices for example the printer or the keyboard.
  • Every interrupt has program code which is run to deal with or service the interrupt. 
The different interrupts:

  • I/O interrupt:
    •  This refers to any interrupt that is being raised by either an input or an output.
  • Hardware interrupt:
    • This refers to any interrupt that is raised by a component of the computer.
  • Program interrupt:
    • This is an interrupt that is raised and triggered by software that is installed onto the computer.
  • Time interrupt:
    • This is an interrupt that is triggered at a specific time or after a specific amount of time.

The operating system manages the interrupt after the execution of an instruction, the processor checks to see in an interrupt has occurred. If it has, the operating system services the interrupt if it is more important than the task already being carried out

1 comment: