Mail Archives: djgpp/1999/10/07/11:22:48
On 6 Oct 99, at 11:08, Johnny Chan <jchan AT paclink DOT net> wrote:
> Do you know how to raise a software interrupt in DJGPP?
> I had setted the interrupt vector, now I want to try
> to test it within my program, Does DJGPP has any
> function to raise a 32bit interrupt?
> --jC
>
> >>-----Original Message-----
> >>From: Prashant TR [mailto:prashant_news AT yahoo DOT com]
> >>Sent: Wednesday, October 06, 1999 5:33 AM
> >>To: djgpp AT delorie DOT com
> >>Cc: Martin_Czamai AT peak-service DOT com
> >>Subject: Re: deriving the interrupt vector
> >>
> >>
> >>
> >>
> >>--- Martin Czamai <Martin_Czamai AT peak-service DOT com>
> >>wrote:
> >>> Hi all again,
> >>>
> >>> who can tell me how to derive the interrupt vector,
> >>> when I've got the
> >>> interrupt request line (interrupt level) of a
> >>> interrupt controller?
> >>>
> >>
> >>Hi Martin,
> >>
> >>I didn't quite get what you mean. Anyway, I assume
> >>you're asking me how to catch IRQs 0-15.
> >>
> >>The __dpmi_version_ret function gives you the PIC
> >>mater amd slave base interrupts.
> >>
> >>This means that if you want to hook IRQ0-7, you'll
> >>need to hook up interrupt vector=pic_master_base+IRQ
> >>no. This applies for IRQs 0-7.
> >>
> >>For IRQs 8-15, you'll need to hook up
> >>interrupt=pic_slave_base+IRQ no.
> >>
> >>Normally, IRQ0-7=interrupt 8h-0fh
> >> IRQ8-15=interrupt 70h-78h
> >>
> >>Use _go32_dpmi_set_protected_mode_interrupt_vector.
> >>
> >>Is this more or less what you're looking for ?
> >>
> >>----
> >>Prashant TR
> >>http://www.members.tripod.com/prashant_tr/
Dear Johnny,
The int86 and int86x functions can be used to simulate a software interrupt.
You can find these in the libc reference with examples and details.
Here's the syntax-
#include <dos.h>
int int86(int ivec, union REGS *in, union REGS *out);
And here's a example.
union REGS r;
r.x.ax = 0x0100;
r.h.dl = 'c';
int86(0x21, &r, &r);
In int86x you can also pass the segment registers(ES,DS ...etc)
through and additional SREGS structure.
The above are the easiest but you might also want to check out the
_go32_dpmi_simulate_int function.
Hope this helps!
Bye.
Kalum S <kalum AT myflat DOT com>
- Raw text -