Date: Fri, 23 Jun 2000 08:24:15 +0300 (IDT) From: Eli Zaretskii 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: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Precedence: bulk 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.