LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (http://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   When an interrupt appears (http://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/when-an-interrupt-appears-4175429408/)

elico 09-28-2012 04:26 AM

When an interrupt appears
 
when a hardware interrupt is invoked
what happens ?

If I understood well, the rellevant interrupt handler function is executed and at end the processor goes back to do what it did before the interrupt .

am I right ?

also "context get saved" what does it mean ?


Eliahu

pan64 09-28-2012 04:33 AM

would be nice to describe that hardware. In general you are right. hardware interrupt will cause the current state will be saved, irq handler will be executed, state will be restored and CPU will continue where it was at the time of the interrupt. Context is probably the state of anything which is restored at the end.

414N 09-28-2012 04:38 AM

If you're talking about x86 architecture, what you're saying is basically right.
"context get saved" could mean two things:
  • the CPU pushes the contents of the CS and IP registers (which point to the next instruction of the current program) in the stack before jumping to the interrupt service routine. This is automatically done by the CPU every time an interrupt is served.
  • the general purpose registers (ax, bx, ...) are generally pushed on the stack prior to running the first instruction of the interrupt service routine, so they can be restored to their previous state after the interrupt routine has finished its deed. This is to be performed by the programmer of the interrupt service routine, if the routine needs to use one of those registers as a temporary storage.

elico 09-28-2012 04:57 AM

Thanks
Elico


All times are GMT -5. The time now is 04:44 AM.