Question about hardware access under QNX and Neutrino

Hello -

I have a few questions about how to access hardware directly
from applications running under QNX or Neutrino on PowerPC
platform (which uses memory mapped I/O).

For RTOS such as Vxworks which uses flat memory model, i was
told that you can just access the hardware directly, let’s say
that you have a UART with physical address at 0x3f8, by doing
this:

char c = *( (char *) 0x3f8);

and this will return the value in register 0x3f8. Is it possible
to do the same for QNX and Neutrino. If not, can you explain how
the UART can be accessed?

TIA,
Hoang


Sent via Deja.com http://www.deja.com/
Before you buy.

In article <8nmmm1$d21$1@nnrp1.deja.com>, hoang@my-deja.com says…

Hello -

I have a few questions about how to access hardware directly
from applications running under QNX or Neutrino on PowerPC
platform (which uses memory mapped I/O).

For RTOS such as Vxworks which uses flat memory model, i was
told that you can just access the hardware directly, let’s say
that you have a UART with physical address at 0x3f8, by doing
this:

char c = *( (char *) 0x3f8);
and this will return the value in register 0x3f8. Is it possible
to do the same for QNX and Neutrino.

Yes … after calling mmap_dev_io() your statement above looks like

c = in8(0x3f8); // it’s portable to all other processor platforms!

(This work only for Neutrino … don’t forgett the ThreadCtl() for IO privity)

If not, can you explain how the UART can be accessed?

The best way to deal with the UART is to use the standard library calls
e.g. tc…() and just open, read, write,close …

Regards

Armin

<hoang@my-deja.com> wrote in message news:8nmmm1$d21$1@nnrp1.deja.com

Hello -

I have a few questions about how to access hardware directly
from applications running under QNX or Neutrino on PowerPC
platform (which uses memory mapped I/O).

QNX(4) does not run on PowerPC. Only Neutrino
support the PowerPC.

PowerPC and x86 are vey different when it comes down to
IO. x86 have a different set of instruction (and address space_
to handle IO.

Things are much more elegant and simple on PowerPC!
(Actually they could be made as simple, but for compatibility
reason IO are still used). Under PowerPC there is no such
thing as IO, everything is in standard memory space!

There is two way to do that. One is to map
physical memory using mmap(), (check the doc)

The other is to use mmap_device_io with
in*() and out*().

The mmap_device_io has the advantage of making
the code portable on x86!

I got this from reading. I never played with a PowerPC, yet :wink:



For RTOS such as Vxworks which uses flat memory model, i was
told that you can just access the hardware directly, let’s say
that you have a UART with physical address at 0x3f8, by doing
this:

char c = *( (char *) 0x3f8);

and this will return the value in register 0x3f8. Is it possible
to do the same for QNX and Neutrino. If not, can you explain how
the UART can be accessed?

TIA,
Hoang


Sent via Deja.com > http://www.deja.com/
Before you buy.