delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/06/23/01:25:03

Date: Fri, 23 Jun 2000 08:24:15 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: djgpp AT delorie DOT com
Subject: Re: DJGPP and Mapping physical memory from a PCI device
In-Reply-To: <0267080a.1f42dce3@usw-ex0102-084.remarq.com>
Message-ID: <Pine.SUN.3.91.1000623082054.4583D-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Thu, 22 Jun 2000, Ali wrote:

> I am wondering what is the use of the Selector here.

The DPMI server creates the selector to allow you access to the memory 
to which you mapped the device.

> If I want
> to access the mapped physical memory, couldn't I just use
> 
> mapMemory(PciBase,sizeof(REGISTERS),&Selector,&Adapter);
> /* and then just */
> Adapter=0; /*would set the first memory location */

No, you can't do this.  You need to use _farpeek* and _farpoke* functions 
to access the device, because it is not part the usual data DJGPP segment 
(whose selector is loaded into the DS register).  That's why the DPMI 
server returns a selector to you.

I believe the FAQ explains this.

> BTW, when I try this I get a segmentation error.

As expected.

- Raw text -


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