delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/09/10/11:15:27

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: "philippe meynard" <philippe DOT meynard AT vendeeconcept DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: physical adress of int
Date: Fri, 10 Sep 2004 17:14:10 +0200
Organization: Guest of France Telecom's news reading service
Lines: 48
Message-ID: <chsgc3$390$1@s5.feed.news.oleane.net>
References: <chrpjm$r73$1 AT s5 DOT feed DOT news DOT oleane DOT net> <04b501c4973c$429a31d0$0600000a AT broadpark DOT no>
NNTP-Posting-Host: 62.161.106.155
X-Trace: s5.feed.news.oleane.net 1094829251 3360 62.161.106.155 (10 Sep 2004 15:14:11 GMT)
X-Complaints-To: abuse AT oleane DOT net
NNTP-Posting-Date: Fri, 10 Sep 2004 15:14:11 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I don't want the linear address but the physical address of my varaible
see the code i wante used

typedef signed int s32;
s32 str[6], *volatile self_test_results;
PortSeltTest=1;
SCBPort=8;

ioaddr = my base address board ethernet (intel etheexpress),here 0xe400

/* Perform a system self-test. */
  self_test_results = (s32*) ((((long) str) + 15) & ~0xf);
  self_test_results[0] = 0;
  self_test_results[1] = -1;
  outl(VIRT_TO_PHYSADR(self_test_results) | PortSelfTest, ioaddr + SCBPort);
  do {
   udelay(10);
  } while (self_test_results[1] == -1  &&  --boguscnt >= 0);


your solution is not good

an idea
Thanks

"Gisle Vanem" <giva AT bgnett DOT no> a écrit dans le message de news:
04b501c4973c$429a31d0$0600000a AT broadpark DOT no...
> "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