# What takes place when a USB drive is connected in?

What is the circulation of USB occasions from bit room to customer room? I get a popup on my desktop computer when I connect in a USB drive - - what is the series of occasions that leads from identifying the new USB drive to placing it and also revealing that popup?

0
2019-05-13 03:11:28
Source Share

I'm not entirely certain with this yet, so take it with a grain of salt and also even more study.

It begins with the kernel hotplug subsystem. After a tool is arrangement, it either calls whatever userspace program is arrangement to take care of hotplug occasions (if one was set by echo hotplug_handler > /proc/sys/kernel/hotplug) or sends out an information package over the kobject_uevent netlink outlet. When the kernel releases the hotplug trainer, it establishes some setting variables. When the kernel sends out a datapacket, it consists of key = value sets. If you intend to, you can arrangement a manuscript that simply logs the setting and also set it up as the trainer (out your manufacturing system, certainly - an examination arrangement).

Generally, udev is arrangement as the trainer, and also it will certainly have numerous regulations arrangement concerning just how to take care of occasions. From there, it can release various other programs that do various other points (like concern dbus messages). These udev regulations are very depending on the certain circulation of passion.

There is a great deal of details in this thread where a person is attempting to write some documents - note the first message is not exact ; maintain analysis.

0
2019-05-17 15:43:06
Source

This is handed by udev on modern-day Linux systems. The udev daemon began with the system will certainly look in /etc/udev/rules.d and also /lib/udev/rules.d and also will certainly run coordinating regulations for bit occasions. Putting a USB drive will certainly cause an occasion, udev will certainly look for a matching regulation and also will certainly execute it.

The regulations themselves will certainly establish what your system does. In recent times, udev has actually connected to HAL, which would certainly signal applications using DBUS. This strategy is currently out-of-date for a linked udev remedy, which I assume will certainly entail udevd connecting using dbus straight, or using dbus - send .

You can check the tasks of udev using udevadm monitor.

0
2019-05-17 08:10:11
Source