www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/20/14:26:11

Date: Tue, 20 May 1997 14:25:41 -0400 (EDT)
From: "Art S. Kagel" <kagel AT ns1 DOT bloomberg DOT com>
To: Bowers <bowrsfam AT ntplx DOT net>
Cc: djgpp AT delorie DOT com
Subject: Re: segmentation errors
In-Reply-To: <3380EF49.6B04@ntplx.net>
Message-Id: <Pine.D-G.3.91.970520142023.20897B-100000@dg1>
Mime-Version: 1.0

On Mon, 19 May 1997, Bowers wrote:

> Hello,
> 
> whenever I program anything using DJGPP, I always get some sort of
> segmentation error.  How do I aviod this, and what exactly is a
> segmentation error?
> 

A segmentation error indicates that you have attempted to write to memory 
which your process does not own.  Usually it is a write to an address 
outside of your current address space due to a runaway pointer or array 
index.  It may also be due to your code trying to write to a hardware 
address which has not been mapped from its real-mode address into your 
vitual memory space.  Remember that DJGPP is a protected mode/virtual 
memory compiler and that DOS and hardware addresses (such as video memory 
and interrupt controller addresses and DOS tables) are not available as 
direct addresses.  You either have to address these using 'near 
pointers', use the access routines supplied in DJGPP, or cause these 
addresses to be mapped into your address space.  Please read the FAQ for 
further details this is a subject which is covered in detail there and in 
various places in the info files.

Art S. Kagel, kagel AT bloomberg DOT com

- Raw text -


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