delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/01/28/07:35:05

Date: Sun, 28 Jan 1996 13:49:21 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: James Tsillas <jtsilla AT ccs DOT neu DOT edu>
Cc: djgpp AT delorie DOT com
Subject: Re: Issues with nearptr's.

On 26 Jan 1996, James Tsillas wrote:

> I'd like to use nearptr's to access physical memory currently occupied
> by video hardware. SOunds pretty simple, no? Well, I've read rumours
> that there are dangers involved in setting the NEARPTR flag in my crt0
> flags. One problem I have noticed is that when running under gdb, gdb
> crashes when I use this flag and try to print out large data structures.

This isn't necessarily a ``feature'' of the nearptr flag, it might be a 
bug in the start-up code.  Please provide the details (stack trace and/or 
anything else which is printed on the screen when the debugger crashes, 
the version of DJGPP and gdb you are using, etc.).

> Are there any other possible issues? What's really going on in there?

What's going on is this.  For nearptr access to be possible, a certain
selector is defined so that using that selector you can access *any*
address in the virtual address space.  That means that memory protection
(which normally allows you to access only a certain range of addresses) is
effectively disabled, and a buggy program can make all kinds of damage,
like trashing your hard disk (if you write over the DOS code). 

- Raw text -


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