Date: Mon, 10 Mar 1997 08:21:39 GMT Message-Id: <199703100821.IAA17465@bryggen.bgnett.no> From: Gisle Vanem To: djgpp AT delorie DOT com Cc: giva AT bbb DOT no Subject: Re: RMCB Help Andrew Crabtree <71223 DOT 3315 AT CompuServe DOT COM> wrote: > ..into the ARP handler, and that crashed too ( I'm just trying to verify it gets > to my routine OK). It sometimes reports the page fault, and sometimes just > exits without any message. If no arps go out (I'm controlling them fron a > traffic generator) then no problems. ... > __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. > /* 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.