Date: Tue, 20 May 1997 14:25:41 -0400 (EDT) From: "Art S. Kagel" To: Bowers Cc: djgpp AT delorie DOT com Subject: Re: segmentation errors In-Reply-To: <3380EF49.6B04@ntplx.net> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk 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