-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to add USB support? #1304
Comments
https://wiki.osdev.org/Pci has a fair bit of information on how to work with PCI. The pci-types crate can be useful too for interacting with the PCI configuration space. |
https://docs.rs/usb-device/latest/usb_device/device/index.html // Create the device-specific USB peripheral driver. The exact name and arguments are device Example looks like this from usb_device crate. Is it possible to pass something in here? If i have to use pci-types crate then give an example of how i would use it? |
You did have to implement the
This is what Redox OS uses: https://gitlab.redox-os.org/redox-os/drivers/-/blob/master/pcid/src/main.rs?ref_type=heads It is fairly messy IMO and it has to deal with the PCI interfacing running in a different process from the actual PCI drivers. Hermit may be a better learning source: https://github.com/hermit-os/kernel/blob/main/src/arch/x86_64/kernel/pci.rs |
Well USB depends on xHCI, so that needs to be set up first. Here's an example of that. |
Thank you for the links, I'm starting to understand why the guide went with PS/2 keyboard support. |
Did you figure it out in the end? I am currently developing a FAT32 driver and it would be nice to have disk support to actually see if it works |
Love the blog, finished the PS/2 keyboard support.
Also gone through 3rd edition of what you have so far.
I really want to attempt USB support for keyboard but it seems challenging.
Looked at several USB libraries already.
usb-device crate seems to assume that i already have an object of UsbBus,
some examples for micro-controllers seems to get this from HAL crates, i did not find anything for x86 architecture.
Tried to ask around in the rust discord,
Was pointed to xhci, and then from there was told that i needed to initialize PCI.
I don't really know where to continue or what crate to use from here.
Would you be able to point me in the right direction and give an overview of which parts here would need to be implemented by me and which parts i could just take from existing crates?
The text was updated successfully, but these errors were encountered: