From: gmate.amit@gmail.com (Kumar amit mehta)
To: kernelnewbies@lists.kernelnewbies.org
Subject:
Date: Mon, 15 Oct 2012 04:12:36 -0700 [thread overview]
Message-ID: <20121015111236.GA5832@gmail.com> (raw)
In-Reply-To: <CAKzXvN-VUncJOiqkrdotKJRc4R6OxpbdzKL5JxnLyWnO_JnsHA@mail.gmail.com>
On Mon, Oct 15, 2012 at 04:23:59PM +0530, Niroj Pokhrel wrote:
> Thank Matthias!!!
> I have tried using printk . What I really want to do now is to implement
> the methods I have written by calling from the user space. Like I want to
> read or write to the character devices via user space.
>
Did you register your callbacks for read and write in your char driver ?
If yes, then you can write and read(given you have methods for write and read
for your char driver), through 'echo', 'cat' etc of your char device through
fs nodes(under /dev). I'm guessing that you've exported your device under /dev
file system.
-Amit
> On Mon, Oct 15, 2012 at 3:49 PM, Matthias Brugger <
> matthias.bgg at googlemail.com> wrote:
>
> > Hi,
> >
> >
> > On 10/15/2012 11:24 AM, Niroj Pokhrel wrote:
> >
> >> Hi,
> >> I'm new to linux and kernel . I'm ongoing with the linux device drivers.
> >> I've followed the the book LDD but i'm lost about how to call my
> >> driver's specific method from the user space.
> >> Eg: if have developed a character device and inserted the module then
> >> how can i make sure that when I read or write that it implement the
> >> functions via the methods i have implemented in my module.
> >>
> >
> > the most easy way would be to put some printk output in your read/write
> > functions of your driver. So with cat/echo from userspace you should be
> > able to verify your implementation.
> >
> > Regards,
> > Matthias
next prev parent reply other threads:[~2012-10-15 11:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-15 9:24 No subject Niroj Pokhrel
2012-10-15 10:19 ` Matthias Brugger
2012-10-15 10:53 ` Niroj Pokhrel
2012-10-15 11:12 ` Kumar amit mehta [this message]
2012-10-15 11:20 ` Javier Martinez Canillas
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=20121015111236.GA5832@gmail.com \
--to=gmate.amit@gmail.com \
--cc=kernelnewbies@lists.kernelnewbies.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 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.