Mail Archives: djgpp/1998/05/18/09:10:26
On Mon, 18 May 1998, Joseph Kaplan wrote:
> I have put a print statement in the interrupt handler to show this.
Regardles of whether this is or isn't the cause of your problem, using
print statements in an interrupt handler is a VERY bad idea. Most print
functions call DOS, which is an absolute no-no in an interrupt handler.
If you do, sooner or later your program will crash
If you must print something, use direct screen (aka conio) functions, and
also avoid cprintf, which might call malloc. The safest way is to create
a string in a buffer and then call cputs to write it to VRAM.
> void CondorArinc429Impl::protectedInterruptHandler(...)
> {
> cout << "Interrupt Handler" << endl;
> determineReceiver();
> outportb(interrupt_control_port,interrupt_acknowledge);
> }
I don't see here where do you send the EOI byte to the PIC, unless the
last statement above does it. If you don't send EOI, you won't get more
than a single interrupt.
> >Second, the code and data of the handler need to be locked.
> >
> I didn't lock any of the code or the data because I am using
> CWSDPR0 as my memory manager. I thought that was only
> necessary if you had a paging memory manager.
That is correct, you don't need to lock with CWSDPR0.
- Raw text -