I Can't Get Interrupts Working: Difference between revisions

m
no edit summary
[unchecked revision][unchecked revision]
(→‎FASM notice: Fixed grammar. Also, ISR is an interrupt service routine, IRS are the world's largest collection of bureaucrats.)
mNo edit summary
Line 19:
=== My Handler doesn't get called (C) !? ===
 
If you're programming the IDT setup in C, make sure the IDTR structure has been correctly understood by your compiler. As intelIntel's 6 bytes structures enfringeinfringe most compiler's packing rules, you'll need to use either ''bitfields'' or ''packing pragmas''. Use <tt>sizeof()</tt> and <tt>OFFSETOF()</tt> macros to make sure the expected definition is used (a runtime test would be fine)
 
 
=== 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 behaviourbehavior as [[#Assembly_Example|the example]], but displaying a character indicating the fault. Exceptions occuringoccurring 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
Line 51:
=== I'm not receiving any IRQ ===
 
Make sure you [[#ISR_problems|receive software interrupts]] first. Also make sure you enabled the IRQ of your interrestinterest on the PIC mask and that you enabled the cascading line (bit #2 of the master) if you're waiting for a slave IRQ.
 
=== I can only receive one IRQ ===
Anonymous user