Mail Archives: djgpp/1997/03/10/09:45:18
> ...
> > __dpmi_allocate_real_mode_callback(&ARPPacketHandler,&arpRegs,&arpSeg)
>
> OTOH, this function requires that ARPPacketHandler() returns with a "retf".
> Instead I would use:
>
> _go32_dpmi_seginfo rm_cb;
>
> rm_cb.pm_offset = (unsigned long) &ARPPacketHandler;
> _go32_dpmi_allocate_real_mode_callback_retf (&rm_cb,&arpRegs);
>
> Look at the info page for this function for an example.
Originally I was using the go-32 functions, but after reading from the
faq and some of Eli's posts I decided the the dpmi ones were preferred
for djgpp v2.x. I couldn't get the go-32 functions working either. I
checked my dpmi reference and it doesn't specify whether the callback has
a retf or and iret but my assumption was a retf (anybody?).
>
> > /* es:di - pointer to our function */
> > regs.x.es = arpSeg.segment;
> > regs.x.di = arpSeg.offset16;
> ^^
> This would become:
> regs.x.es = rm_cb.rm_segment;
> regs.d.edi = rm_cb.rm_offset;
> ^^
>
> It's safer to fill all 32-bits; One never knows if the packet-driver
> ignores high-words or not.
>
> Gisle V.
Actually, in this case I do know. I have the source for the packet driver
in front of me, and it doesn't see 32 bit registers.
I didn't think in general real mode programs (old ones
I mean) use instructions that access the full extended registers. All
of the calls I've done to dpmi_int (this and other programs) has never
zeroed out the upper bytes and I've never had problems.
Andrew
- Raw text -