public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ben Collins <bcollins@debian.org>
To: David San?n Baena <davidsanan@teleline.es>
Cc: linux-kernel@vger.kernel.org
Subject: Re: how to access user space memory from kernel.
Date: Mon, 11 Nov 2002 17:59:42 -0500	[thread overview]
Message-ID: <20021111225942.GB522@phunnypharm.org> (raw)
In-Reply-To: <00df01c289d3$52969420$6e9afea9@anabel>

On Mon, Nov 11, 2002 at 11:40:19PM +0100, David San?n Baena wrote:
> Hi. I need to access to user space memory from a kernel module. This module
> is not a driver, so I would like how can i write and read from/to a variable
> in a user application from my kernel module?
> At first I thought I could do that with shared memory (shmget, shmat...),
> but in that is not possible in a kernel module. So I have thought to do it
> with copy_from_user and copy_to_user, but i don't know how to do it exactly,
> basically how to know where to write or read in the user var...
> Any suggestion???
> Thanks in advance

The user space application will have to make a call to the driver
somehow. Usually this is in the way of an ioctl() on a device that the
driver has made available to use space. The arguments passed across the
ioctl are known to your kernel module and userspace app. You could pass
a pointer to the kernel module which would be userspace memory that the
driver could copy_to_user some data to.

-- 
Debian     - http://www.debian.org/
Linux 1394 - http://www.linux1394.org/
Subversion - http://subversion.tigris.org/
Deqo       - http://www.deqo.com/

  reply	other threads:[~2002-11-11 22:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-11 22:40 how to access user space memory from kernel David Sanán Baena
2002-11-11 22:59 ` Ben Collins [this message]
2002-11-12  1:46   ` Livio Baldini Soares

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=20021111225942.GB522@phunnypharm.org \
    --to=bcollins@debian.org \
    --cc=davidsanan@teleline.es \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox