From: Tim R. <ti...@pr...> - 2022-02-24 23:01:38
|
David Grayson wrote: > libusb is meant to be run in user space, not the kernel. It uses > system calls to talk to the kernel and tell the kernel what kind of > I/O it wants to perform on the USB devices connected to the system. > The kernel needs to have its own sophisticated USB drivers in order to > handle those requests from libusb. It would take those requests and > figure out how to pass them on to the USB controller devices in your > computer. I don't know much about the lower-level interfaces used by > USB controllers, but I've heard keywords like UHCI and XHCI. This is good advice. If you want your operating system to be more than a toy, then you will have to have host controller drivers: EHCI for USB 2, and XHCI for USB 3. They are complicated, but there are a few samples on the internet. Above that, you need a USB hub driver to manage collections of devices. Above that, you put drivers for the various pre-defined device classes, like HID (mouse and keyboard), storage (for USB disks), audio, video, etc. HOWEVER, if this is just a toy for you to play with, USB HID devices have a special "boot mode" that allow them to operate in a much simpler environment. That's how your BIOS can understand your keyboard and mouse. The BIOS does not have a full USB stack by any means. -- Tim Roberts, ti...@pr... Providenza & Boekelheide, Inc. |