Re: how is a device detected

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 23, 2010 at 3:07 AM, Yuchen Liao <lycdragon@xxxxxxxxx> wrote:
> AFAIK, in the device_add() function (in driver/base/core.c), kernel will
> invoke "device_create_file()" function to create the "uevent" file;
> (The kobj is also added in this device_add() function by invoke
> kobject_add() function)
> In user space, the udevd is listening the NETLINK_KOBJECT_EVENT to get the
> "uevent" event. Then it will find a match udev rule under the
> /etc/udev/rules.d/. It will make changes according to the rule(Like create
> the device file under /dev).
> Every device when it is register, it will create a uevent file(by this way,
> can trigger a hotplug event), can write a "add" or "remove" command to add
> or remove a device.
> When starting computer, kernel will register a lot of devices, but the
> udev(in user space) is not start. After it start, it will scan the sysfs, to
> get all the uevent file, and write "add" into it. In this way, the event
> been triggered.
> ----
> I'm not so sure that I'm right. Please correct me if there is anything
> wrong. Thank you~
Hi thanks your explanation was very good.
 I have been doing some research on this aspect and replying you after
so many days it is helpful.
What I came across was some thing known as pci-core for PCI devices
and USB core for USB devices.
So that is one thing I surely want to understand.
My objective by this exercise is to be able to write a kernel which is
working on bare metal.(I just want a small set of code which can work)
So I want to understand it more.If some one has more thoughts here
then share it please.

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ




[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux