access pci from user space

Dominik Meyer mr42 at spamt.net
Fri Mar 18 06:20:13 MST 2005


Hi,

* Wim Vanderbauwhede <wim at motherearth.org> [050308 10:49] wrote:
>Hi,
>
>Your mail was not lost.

Thanks for your answer.

> (...)
>#define readb(addr) (*(volatile unsigned char *) (addr))
> (...)
>#define writeb(b,addr) ((*(volatile unsigned char *) (addr)) = (b))
> (...)
>The "volatile" keyword is important, as it tells the compiler not to try anything fancy for that memory location, no optmisations etc.
>
>If you have an OS with a filesystem, you can try to use the /dev block devices.
>
>You can find the actual memory values for pci from /proc/pci (cat /proc/pci)

I know that functions, but i'ts the same behaviour.

I tried out my test program on my powerbook's firewire pci controller and
it worked fine.

The "Bus Error" ocurred, because the airport device wasn't initialized
by the kernel, so i wrote a little fake kernel module for the airport
extreme to initialize the device with pci_enable_device(). After that
there was no "Bus Error", but my whole kernel froze, when i tried to
access the memory region of the airport extreme. I'm sure that the
fake module i wrote didn't cause this crash.

Dominik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.terrasoftsolutions.com/pipermail/mol-general/attachments/20050318/7460eb80/attachment.bin


More information about the mol-general mailing list