Mapping a device to a specific memory location

Hi,

I’m trying to map to a device at a specific memory location (0xD0000) on
an ISA bus by calling mmap with the “PROT_FIXED” flag. The mapping
appears to be successful, but I still can’t communicate with the device.

I saw in the QNX Knowledge Base Reference No.: QNX.000000744 about
linking above that specific location (with cc -@address), but I was
unclear about the specifics of that. Would the @address be where I want
my stack to begin? Is there any further information on the -@ flag for
the cc command?

Thanks,
Eric

I forgot to ask: would I want to open the “Physical” in shmem or should I
create a new ‘file’?
Thanks again,
Eric

Eric wrote:

Hi,

I’m trying to map to a device at a specific memory location (0xD0000) on
an ISA bus by calling mmap with the “PROT_FIXED” flag. The mapping
appears to be successful, but I still can’t communicate with the device.

I saw in the QNX Knowledge Base Reference No.: QNX.000000744 about
linking above that specific location (with cc -@address), but I was
unclear about the specifics of that. Would the @address be where I want
my stack to begin? Is there any further information on the -@ flag for
the cc command?

Thanks,
Eric

Eric <Eric.Simon@gsfc.nasa.gov> wrote:

I’m trying to map to a device at a specific memory location (0xD0000) on
an ISA bus by calling mmap with the “PROT_FIXED” flag. The mapping
appears to be successful, but I still can’t communicate with the device.

Is the device memory mappable? Perhaps you need to look at using
inpw() or inp*() related functions (and their outp*() counterparts)
for doing input/ouput communications to the device.

I saw in the QNX Knowledge Base Reference No.: QNX.000000744 about
linking above that specific location (with cc -@address), but I was
unclear about the specifics of that. Would the @address be where I want
my stack to begin? Is there any further information on the -@ flag for
the cc command?

I don’t believe that the KB entry is what you’re looking for.

-Adam

Eric <Eric.Simon@gsfc.nasa.gov> wrote:

Hi,

I’m trying to map to a device at a specific memory location (0xD0000) on
an ISA bus by calling mmap with the “PROT_FIXED” flag. The mapping
appears to be successful, but I still can’t communicate with the device.

You don’t want PROT_FIXED – that says you know what virtual address
in your process you want to specify.

Can you post your actual shm_open() and mmap() calls?


I saw in the QNX Knowledge Base Reference No.: QNX.000000744 about
linking above that specific location (with cc -@address), but I was
unclear about the specifics of that. Would the @address be where I want
my stack to begin? Is there any further information on the -@ flag for
the cc command?

In general, you don’t want to use this.

-David

QNX Training Services
dagibbs@qnx.com