All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Porter <mporter@kernel.crashing.org>
To: scarayol@assystembrime.com
Cc: linuxppc-embedded@ozlabs.org
Subject: Re: R?f. : Re: Read in /dev/port with Segmentation Fault
Date: Thu, 9 Jun 2005 07:58:28 -0700	[thread overview]
Message-ID: <20050609075828.A7242@cox.net> (raw)
In-Reply-To: <OFD05D82FF.63484065-ONC125701B.00332983@brime.fr>; from scarayol@assystembrime.com on Thu, Jun 09, 2005 at 11:30:53AM +0200

On Thu, Jun 09, 2005 at 11:30:53AM +0200, scarayol@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

      reply	other threads:[~2005-06-09 14:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-09  9:30 Réf. : Re: Read in /dev/port with Segmentation Fault scarayol
2005-06-09 14:58 ` Matt Porter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050609075828.A7242@cox.net \
    --to=mporter@kernel.crashing.org \
    --cc=linuxppc-embedded@ozlabs.org \
    --cc=scarayol@assystembrime.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.