Réf. : Re: Read in /dev/port with Segmentation Fault

scarayol at assystembrime.com scarayol at assystembrime.com
Thu Jun 9 19:30:53 EST 2005


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.

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 ?

Best regards.

Sophie CARAYOL




                                                                                                                                                    
                    Matt Porter                                                                                                                     
                    <mporter at kernel.cra        Pour :  scarayol at assystembrime.com                                                                   
                    shing.org>                 cc :    linuxppc-embedded at ozlabs.org                                                                 
                                               Objet :      Re: Read in /dev/port with Segmentation Fault                                           
                    09/06/05 11:12                                                                                                                  
                                                                                                                                                    
                                                                                                                                                    



On Thu, Jun 09, 2005 at 09:30:43AM +0200, scarayol at assystembrime.com wrote:
> Hi all,
>
> I want to access to IO ports on a MPC885. The iopl() is not implemented,
in
> my distribution, to use inw() outw().
> So I use /dev/port. It works for open("/dev/port",..) and lseek() but
when
> i do a read()  i have a segmentation fault. I gave all the right to
> /dev/port
> Does anybody have an idea ?

You are trying to use x86-specific interfaces to x86-specific IO space.
By "IO ports" you must mean memory mapped I/O registers since you are
on PPC. From userspace, use mmap() to map physical address space to a
user virtual address range.

-Matt







More information about the Linuxppc-embedded mailing list