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 05: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 05: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.