Does anyone have the idea about Writing XHCI Driver using pascal? lazarus / 21-General ---------------------------------------------------------------------- TYDQ · 2025-04-22 13:56 My full repository is on https://github.com/TYDQSoft/UEFIPascalOS. These days I code an XHCI Driver for my kernel,however,this XHCI Driver(usb.pas) is errorous when I trying to receive the data from my XHCI Driver. Does anyone have the idea edit this XHCI driver(usb.pas)?If you have any problem about these errorous driver source code,I will solve it within 2 days. The usb.pas is too large to place in this topic,So I provide github link for you to look up. ---------------------------------------------------------------------- WayneSherman · 2025-04-24 22:58 Did you compare your code to the xHCI spec?  See 4.2 Host Controller Initialization here: https://www.intel.com/content/www/us/en/content- details/625472/extensible-host-controller-interface-for-universal- serial-bus-xhci-requirements-specification.html Is the PCIe bus initialized properly? Are you detecting the xHCI controller on the PCIe bus? Did you compare your code with some working xHCI drivers? XHCI driver in Linux: https://github.com/torvalds/linux/blob/master/drivers/usb/host/xhci- pci.c https://github.com/torvalds/linux/blob/master/drivers/usb/host/xhci.c https://github.com/torvalds/linux/tree/master/drivers/usb/host XHCI driver in Tianocore UEFI firmware: https://github.com/tianocore/edk2/tree/master/MdeModulePkg/Bus/Pci/Xhc iDxe USB XHCI driver tutorial: https://www.reddit.com/r/osdev/comments/1k3vn9p/xhci_driver_tutorial_s eries/ https://www.youtube.com/playlist?list=PLATP7rOKo3E82tBnMp90B4zejpWeAKl xn "Learn how to write a USB xHCI driver from scratch. This series walks through the xHCI specification, explains data structures and register- level interactions, and shows how to build a robust, interrupt-driven USB 3.0 host controller driver step by step." [EDIT] This repo is for the XHCI tutorial above: https://github.com/FlareCoding/stellux-xhci-tutorial/tree/setup-0 This one has the full driver from stellux OS: https://github.com/FlareCoding/StelluxOS/tree/master/kernel/src/driver s/usb/xhci Also, if you running under UEFI, it looks like that provides a higher level interface for USB: https://uefi.org/specs/UEFI/2.11/17_Protocols_USB_Support.html ---------------------------------------------------------------------- TYDQ · 2025-04-27 07:45 Quote from: WayneSherman on April 25, 2025, 12:58:19 amDid you compare your code to the xHCI spec?  See 4.2 Host Controller Initialization here: https://www.intel.com/content/www/us/en/content- details/625472/extensible-host-controller-interface-for-universal- serial-bus-xhci-requirements-specification.html Is the PCIe bus initialized properly? Are you detecting the xHCI controller on the PCIe bus? Did you compare your code with some working xHCI drivers? XHCI driver in Linux: https://github.com/torvalds/linux/blob/master/drivers/usb/host/xhci- pci.c https://github.com/torvalds/linux/blob/master/drivers/usb/host/xhci.c https://github.com/torvalds/linux/tree/master/drivers/usb/host XHCI driver in Tianocore UEFI firmware: https://github.com/tianocore/edk2/tree/master/MdeModulePkg/Bus/Pci/Xhc iDxe USB XHCI driver tutorial: https://www.reddit.com/r/osdev/comments/1k3vn9p/xhci_driver_tutorial_s eries/ https://www.youtube.com/playlist?list=PLATP7rOKo3E82tBnMp90B4zejpWeAKl xn "Learn how to write a USB xHCI driver from scratch. This series walks through the xHCI specification, explains data structures and register- level interactions, and shows how to build a robust, interrupt-driven USB 3.0 host controller driver step by step." [EDIT] This repo is for the XHCI tutorial above: https://github.com/FlareCoding/stellux-xhci-tutorial/tree/setup-0 This one has the full driver from stellux OS: https://github.com/FlareCoding/StelluxOS/tree/master/kernel/src/driver s/usb/xhci Also, if you running under UEFI, it looks like that provides a higher level interface for USB: https://uefi.org/specs/UEFI/2.11/17_Protocols_USB_Support.html Ok,Thank you for giving me the documentation,I have exitbootservices() and UEFI BootServices does not function.