delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2009/06/15/17:34:05

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: vivekian <vivekaseeja AT gmail DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Different values for __djgpp_base_address
Date: Mon, 15 Jun 2009 14:30:08 -0700 (PDT)
Organization: http://groups.google.com
Lines: 23
Message-ID: <cef0fb43-1056-4fa2-940f-a4769610fd86@x29g2000prf.googlegroups.com>
NNTP-Posting-Host: 216.228.112.21
Mime-Version: 1.0
X-Trace: posting.google.com 1245101408 597 127.0.0.1 (15 Jun 2009 21:30:08 GMT)
X-Complaints-To: groups-abuse AT google DOT com
NNTP-Posting-Date: Mon, 15 Jun 2009 21:30:08 +0000 (UTC)
Complaints-To: groups-abuse AT google DOT com
Injection-Info: x29g2000prf.googlegroups.com; posting-host=216.228.112.21;
posting-account=NuDGggkAAABxXNmP359BcUUuu6Cz2ymy
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US)
AppleWebKit/530.5 (KHTML, like Gecko) Chrome/2.0.172.31 Safari/530.5,gzip(gfe),gzip(gfe)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hi,

A part of a program I am writing requires me to convert Physical to
Virtual addresses.
The code is :

void * PhysicalToVirtual(unsigned int PhysicalAddress)
{
   return (unsigned char *)(unsigned int)(PhysicalAddress -
__djgpp_base_address);
}

For some reason __djgpp_base_address reads as 0x100000000 which does
not look right, since dereferencing virtual addresses is throwing
segmentation faults.
It shows a value of 0x00311000 as part of another working program
which is good.

Can the value of  __djgpp_base_address change on the same system ?
Is there something I am missing here ?

thanks in advance,
vivekian

- Raw text -


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