delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/11/10/06:19:02

Xref: news-dnh.mv.net comp.os.msdos.djgpp:3149
Path: news-dnh.mv.net!mv!news.sprintlink.net!newsfeed.internetmci.com!news.sesqui.net!rice!news!sandmann
From: Charles Sandmann <sandmann AT clio DOT rice DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: FInding when an address is illegal
Date: Thu, 09 Nov 1995 16:48:58 CST
Organization: Rice University, Houston, Texas
Lines: 17
References: <DHs1C9 DOT D6o AT jade DOT mv DOT net>
Reply-To: sandmann AT clio DOT rice DOT edu
Nntp-Posting-Host: clio.rice.edu
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Dj-Gateway: from newsgroup comp.os.msdos.djgpp

>   just now, they both ran through without faulting. Why?

I expect it depends on if you are running under DPMI or not.  V1.x 
without DPMI catches and faults addresses less than 4096, but does not
signal an error with DPMI.

V2.x (which is DPMI only) will catch and fault addresses less than 4096
if you are running under a DPMI with DPMI 1.0 extensions (ie CWSDPMI or
386MAX 7) - unless you set a flag to allow these accesses.  Under Windows
and most other DPMI providers you will not catch these addresses.

>   (3) If the variable `p' contains a Gnu C/C++ pointer value, how can the
> program find whether it is a valid address WITHOUT causing an error exit?

That's not an easy question, since you can set the protection on pages to
cause faults, and also set the limits on descriptors to cause faults.  It's
probably easier to just handle it with signals.

- Raw text -


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