Mail Archives: djgpp/1997/10/08/11:32:38
On Wed, 8 Oct 1997, Eli Zaretskii wrote:
> A *lot* of things about hardware interrupts should be documented, because
> it's so much of a black art. The question is (a) where?
I would think section 18 of the djgpp faq, which already has more on
interrupt handling than any tutorial that I have seen (and I have seen
many) might be a good place. In fact this discussion comes at a very
opportune time for me --- I just completed a small thing that hooked the
timer interrupt 0x1c and chained back to it (my first). It was only when
the traceback told me that ds (and es, fs, gs..) were all invalid but that
%cs was, surprisingly not, that I thought of saving %ds myself and
accessing it in the handler with a %cs override.
To be sure, Martynas Kunegelis' excellent demo code does this (for the
keyboard), but does it silently without comment. And as a beginner to gas
and interrupt hooking I failed to see the *generality* of using the alias.
> and (b) how do
> you get people to read that, instead of posting the same questions all
> over again.
Now you are asking ;). But seriously, I have yet to see a post or a query
pertaining to a isr that bombed because %ds was used. Of course I haven't
been long on this ng, so I might be easily mistaken.
> There should be a tutorial on writing interrupt handlers.
It would take some deep tutorial writing to beat Sec 18 of FAQ, but I
would be grateful if somebody did.
> Barring that, anybody who wants to futz with hardware interrupts, needs to
> take a very good lookat the few handlers built into DJGPP (the keyboard
> handler for generating SIGINT on ^C and the timer handler for profiling).
> If they do, they will see the DS alias used all over the place.
Could you point me to the pertinent files please. I would be very
interested.
- Raw text -