Mail Archives: djgpp/2000/06/23/01:25:03
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 -