mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Basic rundown of udev?
@ 2009-04-16 20:39 John Moser
  2009-04-16 21:07 ` Kay Sievers
  0 siblings, 1 reply; 2+ messages in thread
From: John Moser @ 2009-04-16 20:39 UTC (permalink / raw)
  To: linux-kernel

I'm currently reading through umm... udevd.c for udev-141.  Trying to
figure out how this thing works.

Anyone care to give me a brief map?  It would help.  I'm just trying
to figure out how udev talks to the kernel-- i.e. what facilities
would I have to implement to re-implement the kernel side of udev,
let's say if I was to run udevd as-is on Darwin or NetBSD or
something.  How does it talk to the kernel?  And if you know off the
top of your head, which source files (and functions?) am I looking at
here?

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Basic rundown of udev?
  2009-04-16 20:39 Basic rundown of udev? John Moser
@ 2009-04-16 21:07 ` Kay Sievers
  0 siblings, 0 replies; 2+ messages in thread
From: Kay Sievers @ 2009-04-16 21:07 UTC (permalink / raw)
  To: John Moser; +Cc: linux-kernel

On Thu, Apr 16, 2009 at 22:39, John Moser <john.r.moser@gmail.com> wrote:
> I'm currently reading through umm... udevd.c for udev-141.  Trying to
> figure out how this thing works.

Udev stuff is usually handled at linux-hotplug@vger.kernel.org.

> Anyone care to give me a brief map?  It would help.  I'm just trying
> to figure out how udev talks to the kernel

Udev just listens to broadcasted events from the kernel.

Just run:
  udevadm monitor --kernel --env
and
  strace udevadm monitor --kernel
and you see what's going on.

> -- i.e. will what facilities
> would I have to implement to re-implement the kernel side of udev,
> let's say if I was to run udevd as-is on Darwin or NetBSD or
> something.

Udev uses the Linux kernel device tree exported by sysfs. It offers
simplified access to the internal device structures in the kernel. Not
sure what other platforms do here.

> How does it talk to the kernel?  And if you know off the
> top of your head, which source files (and functions?) am I looking at
> here?

The kernel sends the needed events from: lib/kobject_uevent.c, but
that does not include the driver core, which is in drivers/base/*, and
the exported device tree filesystem at fs/sysfs/*.

Good luck,
Kay

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-04-16 21:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-16 20:39 Basic rundown of udev? John Moser
2009-04-16 21:07 ` Kay Sievers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®