Skip to content

Piero Bosio Social Web Site Personale Logo Fediverso

Social Forum federato con il resto del mondo. Non contano le istanze, contano le persone

Linux Hotplug Events Explained

Uncategorized
1 1 5
  • Linux Hotplug Events Explained

    There was a time when Linux was much simpler. You’d load a driver, it would find your device at boot up, or it wouldn’t. That was it. Now, though, people plug and unplug USB devices all the time and expect the system to react appropriately. [Arcanenibble] explains all “the gory details” about what really happens when you plug or unplug a device.

    You might think, “Oh, libusb handles that.” But, of course, it doesn’t do the actual work. In fact, there are two possible backends: netlink or udev. However, the libusb developers strongly recommend udev. Turns out, udev also depends on netlink underneath, so if you use udev, you are sort of using netlink anyway.

    If netlink sounds familiar, it is a generic BSD-socket-like API the kernel can use to send notifications to userspace. The post shows example code for listening to kernel event messages via netlink, just like udev does.

    When udev sees a device add message from netlink, it resends a related udev message using… netlink! Turns out, netlink can send messages between two userspace programs, not just between the kernel and userspace. That means that the code to read udev events isn’t much different from the netlink example.

    The next hoop is the udev event format. It uses a version number, but it seems stable at version 0xfeedcafe. Part of the structure contains a hash code that allows a bloom filter to quickly weed out uninteresting events, at least most of the time.

    The post documents much of the obscure inner workings of USB hotplug events. However, there are some security nuances that aren’t clear. If you can explain them, we bet [Arcanenibble] would like to hear from you.

    If you like digging into the Linux kernel and its friends, you might want to try creating kernel modules. If you get overwhelmed trying to read the kernel source, maybe go back a few versions.


    hackaday.com/2026/03/06/linux-…


Gli ultimi otto messaggi ricevuti dalla Federazione
Post suggeriti
  • 0 Votes
    1 Posts
    0 Views
    Compagnie petrolifere Usa al presidente: “Probabile che la crisi peggiori"Repubblica #Iran #Usa #petrolio
  • Ho una fame nervosa che sto per urlare.

    Uncategorized
    2
    0 Votes
    2 Posts
    0 Views
    @Zambunny lavati i denti, sentirsi la bocca fresca può far passare la voglia di sporcarlaSe non funziona mangia il dentifricio 😅
  • 0 Votes
    1 Posts
    1 Views
    Benvenuto Peter, speriamo che te ne torni a casa in fretta... e magari freddo.
  • Gli LLM sono una forza opposta ai social media?

    Uncategorized
    7
    0 Votes
    7 Posts
    2 Views
    @mau @aitech la domanda, per l'umano, nasce sempre da un modo di sentirsi vivere in un mondo quando i profili di mondo che incontra suscitano sorpresa, spaesamento, curiosità... Un fenomeno estraneo a una macchina che, in quanto tale, non ha né mondo né contesto.La domanda "come mai la mela cade da un albero?" me la faccio perché ho una precomprensione pratica, tacita e vissuta di cosa significa stare vicino, sopra o sotto un albero, da solo o con altri, con delle sensazioni, dei bisogni, delle aspettative... A partire da quella domanda, se allestisco un esperimento per trovare una risposta non è l'apparato sperimentale che mi fornisce una risposta ma il mio modo di riflettere sulle eventuali invarianze che il dispositivo allestito mi restituisce.Esiste una interessante ricerca che mostra come la rimozione delle virgolette, un tempo impiegate nella ricerca sulla IA dai primi ricercatori quando parlavano di "intelligenza" o "apprendimento" ecc..., sia stata una precisa operazione di manipolazione che con la ricerca non aveva nulla a che vedere.Secondo me è importante, quando scriviamo su un social o generiamo testi destinati a non esperti, che ci si sforzi di non dare per scontati significati nei termini che usiamo e se possibile usare le virgolette in riferimento a termini che pertengono l'umano.Non sarebbe male tenere sempre presente che, nonostante la fascinazione costruita dalle narrative, quando interagiamo con un calcolatore stiamo interagendo con un insieme di porte logiche gestite dall'algebra di Boole, cioè con dei meccanismi come quelli in figura.