delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/09/27/09:33:47

Date: Mon, 27 Sep 1999 09:56:37 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Prashant TR <prashant_news AT yahoo DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Ext. mem(Protected Mode problem)
In-Reply-To: <19990927032752.3245.rocketmail@web1402.mail.yahoo.com>
Message-ID: <Pine.SUN.3.91.990927095602.8548M-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Sun, 26 Sep 1999, Prashant TR wrote:

> int _ctr0_startup_flags = _CRT0_FLAG_NEARPTR;

This is wrong: you are eliminating all the other bits in
_crt0_startup_flags.  (Also, the above line has a typo.)  Please use
the code example in the FAQ as your starting point.

>  printf("%s\n", (__djgpp_nearptr_enable()) ? "Enabled"
> : "Disabled");

What does this print when you run the program?

>  x = (char *)(__djgpp_conventional_base);
>  f = x[0x1000000];             // Both these don't seem to work.

What does ``don't seem to work'' mean?

In this snippet, f should get the value of the byte at the linear
address 16MB.  But that linear address might not be mapped to any
physical address.  If you want to get to the 16MB physical address,
you need to use the technique of section 18.7 of the FAQ to map the
range of physical addresses you want to access into your logical
address space.

>  _farpeekl(_dos_ds, 0x1000000); // Accessing 16MB

This won't work: __djgpp_nearptr_enable only enlarges the limit of the
DS selector.  The _dos_ds selector is not changed.

- Raw text -


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