R?f. : Re: Read in /dev/port with Segmentation Fault
Matt Porter
mporter at kernel.crashing.org
Fri Jun 10 00:58:28 EST 2005
On Thu, Jun 09, 2005 at 11:30:53AM +0200, scarayol at assystembrime.com wrote:
>
> Matt,
>
> then what is the use of /dev/port driver file ? When i do "cat /dev/port"
> on the standard console, i have also a segmentation fault.
Well, it's of no use on PPC. It's an x86-specific driver. It is simply
an alternative method to access x86 I/O ports. This is a hardware
construct that simply does not exist on PPC.
> Another question, if i use mmap to map physical addresses of I/O registers,
> could i dereference the pointer on virtual adresse to access data or should
> i use read/write on the file descriptor ?
Yes you can dereference, that's the point of mmaping I/O into userspace.
You may want to read Linux Device Drivers (either hardcopy or free
version online) for more details. If you google around you'll find
countless examples of people doing simple userspace driver work via
mmaped regs...those might help as a guideline.
-Matt
More information about the Linuxppc-embedded
mailing list