delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/09/10/09:44:32

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
Message-ID: <04b501c4973c$429a31d0$0600000a@broadpark.no>
From: "Gisle Vanem" <giva AT bgnett DOT no>
To: <djgpp AT delorie DOT com>
References: <chrpjm$r73$1 AT s5 DOT feed DOT news DOT oleane DOT net>
Subject: Re: physical adress of int
Date: Fri, 10 Sep 2004 15:44:14 +0200
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
Reply-To: djgpp AT delorie DOT com

"philippe meynard" wrote:

> I want to know a physical adress of my int variable, it's for my ethernet
> board
> for his initialisation.

First you use DPMI function 6 to get the segment *linear* base
address. If paging is not in effect, something like this should work:

#define VIRT_TO_LINEAR(addr)  ((unsigned long)(addr) + _virtual_base)

unsigned long _virtual_base = 0;
 __dpmi_get_segment_base_address (_my_ds(), &_virtual_base);

You can probably use CWSDPR0.EXE to avoid paging.

--gv

- Raw text -


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