How USB got detected when we plug it in
I am running Ubuntu in VM:- https://www.youtube.com/watch?v=O19mv1pe76M (How to setup on Mac m1)
When we plug in our USB, ever thought what happens. Well, whenever we connect devices like USB in our PCI slot (Peripheral component interface) it gets detected in kernel space by the device controller which doesn't depend on the driver existence.
Although, default drivers exist in most of the linux distros. After plugging the device, hardware controller driver do detect the USB and it translates the low level information for the higher layers adhering to the USB protocol.
This information is detected and passed towards generic USB core layer(usbcore) in kernel layer which completes the device detection.
These controller drivers are typically coming from these categories:-
- EHCI (Enhanced Host Controller Interface) for USB 2.0.
- XHCI (eXtensible Host Controller Interface) for USB 3.0 and later.
- OHCI (Open Host Controller Interface) for older USB 1.1 systems.
- UHCI (Universal Host Controller Interface) for certain USB 1.1 implementations.
Let's go in some more depth, how information is detected and retrieved
resources:-
https://sysplay.github.io/books/LinuxDrivers/book/Content/Part11.html
https://docs.kernel.org/driver-api/usb/writing_usb_driver.html
SOCIAL SHARE CARD GENERATOR