delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/09/23:36:49

Date: Mon, 10 Mar 1997 17:23:17 +1200
From: Bill Currie <billc AT blackmagic DOT tait DOT co DOT nz>
Subject: Re: RMCB Help
To: andrewc AT rosemail DOT rose DOT hp DOT com
Cc: djgpp <djgpp AT delorie DOT com>
Reply-to: billc AT blackmagic DOT tait DOT co DOT nz
Message-id: <33239AC5.7564@blackmagic.tait.co.nz>
Organization: Tait Electronics NZ
MIME-version: 1.0
References: <970310005204_71223 DOT 3315_GHL95-2 AT CompuServe DOT COM>

Andrew Crabtree wrote:
> 
> Hello -
> 
> I've been trying (without much success) to interface with a packet driver.  I
> have certain routines working - I can find the packet driver, get the hardware
> MAC address, and transmit packets.  Most of my early problems appear to be
> because of Win 95.  The packet driver only transmits in plain old Dos.  Anyway,
> my callback routines are crashing pretty hard.  I am not using the go-32
> routines, but instead the __dpmi ones.  Also, I originally zeroed out es and di
> on entry
> 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.
> 
> Here is the output from GDB when my program runs.
> 
> gdb iolping.exe
> <gdb intro>
> (gdb) b ARPPacketHandler
> Breakpoint 1 at 0x1553: file iolping.c, line 29
> (gdb) r
> Starting program ...
> <my printfs>
> Breakpoint 1, ARPPacketHandler() at iolping.c:39
> 
> Page Fault cr2=1018b000 in RMCB at eip=ae5dd flags=3202
> eax=2 ebx=27a2 ecx=9e8 edx=0 esi=13b20 edi=18b000
> ebp=11fa84 esp=11da74 es=a7 ds=bf es=af fs=cf gs=bf ss=af error=0006
> 
> ----------------------------------------------------------------------
> 
> So, its hitting my breakpoint and then crashing and dumping me back to a dos
> prompt.
> 
> The abridged version of my code is below, it should have all of the relevant
> stuff.
> 
> Thanks in advance for any help

You don't seem to have locked the memory touched by your callback.  The
reason you are crashing under dos is cwsdpmi detects unlocked memory
when inside a hardware interrupt and spits the dummy (otherwise dos
itself could barf).

Check the faq (where you got djgpp) for details on locking memory.

Bill
-- 
Leave others their otherness.

- Raw text -


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