Date: Mon, 3 Apr 2000 11:13:59 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Andrew Hakman cc: djgpp AT delorie DOT com Subject: Re: Page Fault with IPX Library and 387 Emulation In-Reply-To: <38E831CB.8FBD6111@hotmail.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Mon, 3 Apr 2000, Andrew Hakman wrote: > Now that I got 387 emulation working, I get the following page fault > (only when the program is run on a computer that requires 387 emulation > - run the exact same exe on a 486 and it runs great!): > > Page Fault cr2=10000002 in RMCB at eip=0; flags=3006 eax=0 ebx=4f ecx=0 > edx=34868 esi=3ebbc edi=34808 ebp=7 esp=c4044 cs=2b ds=b7 es=b7 fs=b7 > gs=b7 ss=b7 error=0004 The cr2 value is the address where the Page Fault happened. It means that the program tried to dereference a NULL pointer (value of 2 instead of zero, actually). Since this happens only under emulation, I suspect that the IPX library uses the DS selector inside some interrupt handler. The problem with that is that the FP emulator works by triggering an exception, which it does by invalidating the DS selector. So any interrupt handler should use the alias selector stored in the __djgpp_ds_alias variable instead of DS. The alias selector points to the same memory, but it is always valid.