delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/10/09:45:18

From: Andrew Crabtree <andrewc AT typhoon DOT rose DOT hp DOT com>
Message-Id: <199703101430.AA263944228@typhoon.rose.hp.com>
Subject: Re: RMCB Help
To: giva AT bgnett DOT no (Gisle Vanem)
Date: Mon, 10 Mar 1997 6:30:28 PST
Cc: djgpp AT delorie DOT com
In-Reply-To: <199703100821.IAA17465@bryggen.bgnett.no>; from "Gisle Vanem" at Mar 10, 97 8:21 am

>  ...
> > __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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019