I Can't Get Interrupts Working: Difference between revisions

Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content deleted Content added
Line 22: Line 22:
=== My handler is called but it doesn't return !? ===
=== My handler is called but it doesn't return !? ===


Try to run it in the BOCHS and see if you get any exception report. Program all your exception to have the same kind of behavior as [[#Assembly_Example|the example]], but displaying a character indicating the fault. Exceptions occurring at the end of an interrupt handler are usually due to a wrong stack operation within the handler.
Try to run it in the Bochs and see if you get any exception report. Program all your exception to have the same kind of behavior as [[#Assembly_Example|the example]], but displaying a character indicating the fault. Exceptions occurring at the end of an interrupt handler are usually due to a wrong stack operation within the handler.


* don't try to return from an exception (unless you solved its cause). Returning from a division by zero, for instance, makes no sense at all
* don't try to return from an exception (unless you solved its cause). Returning from a division by zero, for instance, makes no sense at all
Line 29: Line 29:
* make sure your handler doesn't trash unexpected registers. For exceptions and hardware IRQ handlers, no registers *at all* should be modified.
* make sure your handler doesn't trash unexpected registers. For exceptions and hardware IRQ handlers, no registers *at all* should be modified.


Another common source of error at this point comes from misimplementation of ISR in C. Check the InterruptServiceRoutines page for enlightenment ...
Another common source of error at this point comes from mis implementation of ISR in C. Check the InterruptServiceRoutines page for enlightenment ...


== IRQ problems ==
== IRQ problems ==