Page faults and interrupt handlers 
Author Message
 Page faults and interrupt handlers

I am having a wee problem with an interrupt handler crashing my programme.
First, some background.

The applicable portion of code is in interrupt-driven serial communications
routine.  There are a pair of 64K buffers (incoming and outgoing).  There
is a function that puts a bunch of bytes into the outgoing buffer, a function
that pulls bytes from the incoming buffer, and the interrupt handler which
sends a single byte from the outgoing buffer when it gets a TxREADY interrupt
and reads a single byte into the incoming buffer when it gets an RxREADY
interrupt.

Communications are happening in pseudo-DOSland (see below) at 9600,8,1,none,
and are asynchronous (no acknowledgements, and a system can only be doing one
of sending and receiving at a given time thanks to a RTS/CTS protocol I've
built).

Code is compiled with Watcom 10.0 and running with the DOS/4GW extender.

The problem I am having is that the code dies somewhere in the interrupt
handler (those guys are hard to debug).  I have reason to believe that it
is the act of receiving a byte which is the problem.  I get a message that
looks like this:

DOS/4GW error (2001): exception 0Eh (page fault)

I also get:

Crash address (unrelocated) = 1:0001CD3D

Rational Systems (maker of DOS/4GW) does not support the product, since it
is shipped only with Watcom.  They are apparently working on a manual, but it
is not yet done.  I have so far only been able to get fax-back support from
Watcom, which leaves something to be desired.

I did a hex dump of the executable, and checked at offset 0001CD3D, which
can't be the right thing to do, because the operation at that address is a
CLD (clear direction flag).

Compiling with the PMODE/W replacement for DOS/4GW causes the machine to
reboot instead of crashing.

Oh yeah, it doesn't always happen, just once in a while.

Any thoughts?  I'm at my wits end.

While I'm here, what kinds of functions can be used safely in an interrupt
handler?  Do they have to be re-entrant?  So far, I know that inp and outp
work fine, and printf doesn't. :-(
------------------------------------------------------------------------------
Greg Schmidt, Software Engineer, Mytec Technologies Inc., Toronto, Canada



Fri, 26 Dec 1997 03:00:00 GMT  
 Page faults and interrupt handlers
[snip]
Quote:
>The problem I am having is that the code dies somewhere in the interrupt
>handler (those guys are hard to debug).  I have reason to believe that it
>is the act of receiving a byte which is the problem.  I get a message that
>looks like this:

[snip]

This will be better addressed in a DOS or x86 newsgroup.  However, I have a
few random thoughts that I will e-mail to you shortly.  I won't post them
because they have nothing to do with C, are Borland C specific and take up
too much space.  If someone else wants 'em, please e-mail me.

Claude.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 vv    vv       David Claude Brown

 ||     | /
 /\------/
(oo)
(~~)



Sat, 27 Dec 1997 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to define Interrupt, Interrupt Handler in C/C++

2. * ISR handlers (interrupt handlers) *

3. How to setup an interrupt handler

4. Interrupt handler

5. New tutorial (Interrupts & Handlers) - Please provide feedback

6. Interrupt Handler Re Direction

7. Interrupt Handlers, Function Calls, and the Stack

8. 8086 Interrupt handlers

9. Interrupt Handler in C(like dos-0x21)

10. interrupt Handler

11. microsoft c/ interrupt handler prob

12. Interrupt Handlers in C

 

 
Powered by phpBB® Forum Software