سؤال

I have read that driver core sends uevents through netlink from sysfs to udev or some daemons which are listening to it and thenafter corresponding driver is recongnised by udev and loads it. But how this sysfs entries are created corresponding to a device which is hotplugged? .

Thanks in advance for your response.

هل كانت مفيدة؟

المحلول

Drivers create the sysfs entries when they initialize with the major/minor number that they've either gotten or hard coded to use. The file 'uevent' file in each of those device folder allow the daemon to cause the events to be sent in through the netlink socket.

A value of "add" being written into the 'uevent' file will cause all the add events to get generated and thus you can udev or whatever daemon is running (with the appropriate privileges) can create the /dev entries.

Look at this pending hotplug.txt file to see how that works.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top