Mail Archives: djgpp/2002/03/06/00:17:47
Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> wrote in message news:<Pine DOT SUN DOT 3 DOT 91 DOT 1020305122716 DOT 19973C-100000 AT is>...
> On 5 Mar 2002, IeperNaum wrote:
>
> > i tried to build the sample tsr, and it worked. then i changed the
> > interrupt from int 8 to 2f, modified the int2f handler to make the
> > program beep.
> >
> > but it did not work.
>
> Int 2Fh is a software interrupt, not a hardware interrupt. Software
> interrupts are not reflected to protected-mode handlers (says the DPMI
> spec), so you need either to hook them in real mode or to use real-mode
> callbacks, as explained in section 18.9 of the DJGPP FAQ list.
thanks for the info.
now i was able to make it call the handler.
another question. i am currently working on a network redirector
project. so i need to hook int 2f. but now i have a problem. i read on
this group that DJGPP has no provision for interrupt chaining in real
mode. how can i work things out.
i tried to use _go32_dpmi_simulate_fcall_iret() but it did not work.
i will greatly appreciate any help.
thanks.
<code excerpt>
_go32_dpmi_seginfo old_vector;
void int2f(_go32_dpmi_registers* r)
{
printf("INT 2F Invoked r->h.ah = %X\r\n", r->h.ah);
if (r->h.ah != 0x11)
{
printf("Do Control\r\n", r->h.ah);
//other processing here return;
}
r->x.ss = NULL;
r->x.sp = NULL;
r->x.flags = NULL;
r->x.cs = old_vector.rm_segment;
r->x.ip = old_vector.rm_offset;
_go32_dpmi_simulate_fcall_iret(r);
}
int main(int argc, char* argv[])
{
__dpmi_regs r;
_go32_dpmi_seginfo info;
_go32_dpmi_get_real_mode_interrupt_vector(0x2f, &old_vector);
info.pm_offset = (unsigned long)int2f;
_go32_dpmi_allocate_real_mode_callback_iret(&info, &g_r);
_go32_dpmi_set_real_mode_interrupt_vector(0x2f, &info);
r.x.ax = 0x252F;
r.x.ds = info.rm_segment;
r.x.dx = info.rm_offset;
__dpmi_int(0x21, &r);
_write(2,"Installing TSR\r\n",16);
//__djgpp_exception_toggle(); // Only needed if exceptions linked
r.x.ax = 0x3100;
r.x.dx = 256 / 16; // paragraphs
__dpmi_int(0x21, &r);
printf("Hey\n");
_go32_dpmi_set_real_mode_interrupt_vector(0x2f, &old_vector);
_go32_dpmi_free_real_mode_callback(&info);
}
- Raw text -