Tuesday, 3 November 2015

Buffers

  •  A buffer is a small amount of fast memory used as a temporary.
  • The processor can store data to the buffer or receive data from the buffer very quickly and then get on with something else while the storage device takes its time in reading or sending data.
  • Saving data from primary memory to secondary storage has two stages : fill the processor from the buffer and then empty the buffer to storage
  • the system in fine if the buffer can hold all the data that needs to be sent to the storage device however if there is more data than will fit in the buffer , the storage device has to be able to tell the processor that it as used up all the data in the buffer and is ready for more.
Interrupts


  • The storage device sends an interrupt to signal to the processor that it needs attention.When the processor receives an interrupt , it stores it and carries on with what is it doing
  • It checks al the waiting interrupts and services the most important one, in this case the processor would fill the buffer with more data.
  • The use of interrupts is widespread in any computer system.Any device  e.g printer keyboard and can use an interrupt to signal that it needs attention of the processor 








There are a number of different types  interrupts 

I/O interrupt - these are input and output interrupts devices such as the keyboard and mouse demand attention, otherwise your mouse and keyboard inputs would never get a look in

Time interruptSome programs trigger a 'timer interrupt' for example a data-logging application that *has* to read an input sensor every 1 second.Or perhaps a screen recording application that has to read the next screen update.

Program interrupt - software is also allows to issue interrupts to the CPU.For example software has detected that an error has occurred and will issue a software interrupt for the CPU to run somes instructions to try to clear the error 

Hardware commands interrupt -Reset Button pressed,Power Supply failure,Power-down command (screen off, hibernate etc.),These send a physical signal to the CPU via the interrupt chip.







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



No comments:

Post a Comment