Work on an xHCI driver implementation

Fri Oct 16 2020

One of the most essential devices in a modern computer is the USB controller. While Lemon OS has gotten by using PS/2 emulation on input devices and relying on the OS to be on an internal storage devices, these both have various problems from dodgy PS/2 emulation to it being an absolute pain to have to copy the files to disk when testing on real hardware. Support for USB human input devices and mass storage would be a major improvement.

Through supporting xHCI (eXtended Host Controller Interface) Lemon will be able to access both USB 3 and USB 2 devices on any computer with a compatible controller.

Implementing xHCI has been a bumpy ride so far with the implementation varying across various VMs and chipsets. So far the Lemon OS xHCI driver is very limited and cannot do more than check for connected devices and check for which ports are USB 2 and USB 3.

[INFO]    [XHCI] Initializing protocol "USB ", Version: 02.00, Port Range: 1-9
[INFO]    [XHCI] Initializing protocol "USB ", Version: 03.00, Port Range: 9-15
[INFO]    [XHCI] Interface version: 0x100, Page size: 1, Operational registers offset: 0x80, Runtime registers offset: 0x2000, Doorbell registers offset: 0x3000
[INFO]    [XHCI] MaxSlots: 0x20, Max Scratchpad Buffers: 0x0
[INFO]    Port 1 is enabled!