From: omycle@gmail.com (Li Haifeng)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Node creation For real time devices
Date: Fri, 20 Apr 2012 22:26:40 +0800 [thread overview]
Message-ID: <CAFNq8R6Hwr0VyEJt64tqyL-fqrt2YwaScBn2DsoRgf9UDFnxpg@mail.gmail.com> (raw)
In-Reply-To: <CAB6A5-C5RXpx5g6wgXQRX5VUR-Dp7SmVbeNBzHXSZQ7dvtEyrg@mail.gmail.com>
A good question.
When a driver is probed, corresponding device file will be created in
sysfs or devfs.
Maybe you can take a look at this link: http://lwn.net/Articles/330985/
Regards,
Haifeng Li
? 2012?4?20? ??10:04?manty kuma <mantykuma@gmail.com> ???
> Hi Philipp,
>
> The flow you mentioned is something which I was not aware of. I would like
> to see it happening in code.
>
> My Queries are as follows:
>
> 1) " The kernel then creates an uevent and notifies the userspace part of
> udev (udevd) through a netlink socket. " - What are the corresponding files
> that i need to check? If the question is too abstract, kindly explain me
> with respect to any sample Bus.
>
> 2) "The uevent is received by udevd and now udev can check for rules to add
> the device node to /dev" - Again the same thing. I would like to see it
> inside the code. Please help me in looking at the real code.
>
> Thanks again Philipp for your valuable answer.
>
> Regards,
> -Manty
>
> On Fri, Apr 20, 2012 at 7:24 PM, Philipp Ittershagen
> <p.ittershagen@googlemail.com> wrote:
>>
>> Hi Manty!
>>
>> On Fri, Apr 20, 2012 at 3:29 PM, manty kuma <mantykuma@gmail.com> wrote:
>> > Hi,
>> >
>> > I want to know how a node is created when a hardware is connected to the
>> > system.
>> >
>> > Information that I know :
>> > When a hardware is connected to the system, the device name is compared
>> > with
>> > the driver name, if it matches, then probe is called.
>> >
>> > Info i wish to know:
>> > At which point is the node created and who is creating it(In other
>> > words, i
>> > want to know where is mknod happening)?
>> >
>> > This one thing is bugging my mind from so many months. Please tell me
>> > programatically where is this happening. I will be very thankful.
>>
>> Please correct me if I'm wrong, my understanding is this:
>>
>> The hardware is connected and the corresponding subsystem or bus will
>> be notified (i.e. by interrupt of the device). The kernel then creates
>> an uevent and notifies the userspace part of udev (udevd) through a
>> netlink socket. The uevent is received by udevd and now udev can check
>> for rules to add the device node to /dev. That's when the creation and
>> naming of the device node happens.
>>
>>
>> Greetings,
>>
>> Philipp
>
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
next prev parent reply other threads:[~2012-04-20 14:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-20 13:29 Node creation For real time devices manty kuma
2012-04-20 13:54 ` Philipp Ittershagen
2012-04-20 14:04 ` manty kuma
2012-04-20 14:26 ` Li Haifeng [this message]
2012-04-20 14:42 ` Philipp Ittershagen
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=CAFNq8R6Hwr0VyEJt64tqyL-fqrt2YwaScBn2DsoRgf9UDFnxpg@mail.gmail.com \
--to=omycle@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).