Date: Thu, 29 Aug 1996 02:18:15 -0700 (PDT) From: Samuel Vincent To: Mike Marcelais cc: djgpp AT delorie DOT com Subject: Re: Random crashes under DJ with interrupt handlers In-Reply-To: <01bb951c$f492b9a0$ba27379d@michmarc2> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On 28 Aug 1996, Mike Marcelais wrote: > Okay...I've read the DJGPP interrupt guides, I've done real mode interrupt > handlers before with no problem, and now I want to do a simple protected mode > interrupt thing. But it doesn't work. > > Symptom: The code works fine right up until I hook the clock interrupt. Then > it immediately crashes with an error. The error is not consistant; I've seen > `Bound Check', `General Protection Fault', `Stack Fault', `Page Fault', etc. > [snip] > _go32_dpmi_get_protected_mode_interrupt_vector(0x08,&old_handler); > new_handler.pm_offset = _go32_my_cs(); > new_handler.pm_selector = (int)cycleColors; > _go32_dpmi_chain_protected_mode_interrupt_vector(0x08,&new_handler); [snip] Whew.. lots of mail.. been gone a while.. finally catching up.. (I've got a bunch of mail about SVAsync I'll answer within a day or so in case yoru one of those who mailed me...) Anyhow, the problem with the code is in the middle two statements I quoted above. the pm_offset should be the function cycleColors, and the selector should be _go32_my_cs()... If you should want to know more hooking protected mode interrupts without chaining interrupts, etc.. (in the fastest possible way), you can check out SVAsync and its source on DJ's web site. It's a library for serial port communications, and as such hooks the hardware interrupt responsible for asynchronous interrupt-driven communications. -Sam