From: David G. <dav...@gm...> - 2022-02-24 20:10:52
|
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. If you want to make things easy for users, you could design your kernel so that the userspace interface for its USB drivers is identical to the Linux interface, so that libusb, libusbp, and similar libraries do not need to be rewritten/ported for your OS. --David Grayson On Thu, Feb 24, 2022 at 10:26 AM Lonnie Cumberland <lo...@ou...> wrote: > Hi All, > > Hope that everyone is doing well. > > I am working on an x86_64 OS development (actually an upgrade from an > older development) in which it basically has the kernel and I am just now > getting the Newlib clib ported over to it. > > The system has some basic drivers and simple functionality already and > boots up well. > > The problem is that the I/O coding for the keyboard and mouse were based > upon PS2 and most newer systems now have USB keyboards and mouse interfaces. > > In my research, I have come across LibUSB as a viable cross platform > library that may be what I need. > > The other catch is that I am also learning about modern OS development > along the way and am wondering if someone might be able to give me some > information or some simple example on how libusb could be used to determine > if a PS2 or USB keyboard was attached and then use that code. > > My development system has a USB keyboard (real hardware) but in testing in > QEMU it can emulate PS2 and run fine in there, but not on the real hardware. > > Any thoughts or suggestions would be greatly appreciated. > > Best Regards, > Lonnie > Email: Lon...@Ou... > _______________________________________________ > libusb-devel mailing list > lib...@li... > https://lists.sourceforge.net/lists/listinfo/libusb-devel > |