Code location in kernel responsible for probing devices attached/detached
Linux - Embedded & Single-board computerThis forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Code location in kernel responsible for probing devices attached/detached
Hi,
Where are the code in the kernel responsible for probing devices attached/detached to the ports in the board/PC? Is that code uses event driven method to probe that devices ie) by means of any interrupt like mechanisms?
Where are the code in the kernel responsible for probing devices attached/detached to the ports in the board/PC? Is that code uses event driven method to probe that devices ie) by means of any interrupt like mechanisms?
udev is a device manager for the Linux kernel. As the successor of devfsd and hotplug, udev primarily manages device nodes in the /dev directory. At the same time, udev also handles all user space events raised while hardware devices are added into the system or removed from it, including firmware loading as required by certain devices.
Upto my knowledge the udev uses the environment variables and values supplied by \sbin\hotplug utility which was called after the device was detected to be attached/detached and a kobject was added by Linux device model code. But I like to know the platform specific code location which detects the voltage level changes in the pin and calls the subsequent function calls to calling hotplug utility.
Upto my knowledge the udev uses the environment variables and values supplied by \sbin\hotplug utility which was called after the device was detected to be attached/detached and a kobject was added by Linux device model code. But I like to know the platform specific code location which detects the voltage level changes in the pin and calls the subsequent function calls to calling hotplug utility.
Please reply!
You missed this;
Quote:
The system gets calls from the kernel via netlink socket. Earlier versions used hotplug, adding a link to themselves in /etc/hotplug.d/default with this purpose.
udev is a generic kernel device manager. It runs as a daemon on a Linux system and listens (via netlink socket) to uevents the kernel sends out if a new device is initialized or a device is removed from the system. The system provides a set of rules that match against exported values of the event and properties of the discovered device. A matching rule will possibly name and create a device node and run configured programs to set up and configure the device.
udev rules can match on properties like the kernel subsystem, the kernel device name, the physical location of the device, or properties like the device's serial number. Rules can also request information from external programs to name a device or specify a custom name that will always be the same, regardless of the order devices are discovered by the system.
In the past a common way to use udev on Linux systems was to let it send events through a socket to HAL, which would perform further device-specific actions. For example, HAL would notify other software running on the system that the new hardware had arrived by issuing a broadcast message on the D-BusIPC system to all interested processes. In this way, desktops such as GNOME or K Desktop Environment 3 could start the file browser to browse the file systems of newly attached USB flash drives and SD cards.[3]
By the middle of 2011 HAL had been deprecated by most Linux distributions as well as by the KDE, GNOME[4] and XFCE[5] desktop environments, among others. The functionality previously embodied in HAL has been integrated into udev itself, or moved to separate software such as udisks and upower.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.