Nasm usb driver

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
MikyBart
Posts: 16
Joined: Tue Sep 03, 2024 9:21 am
Libera.chat IRC: MikyBart

Nasm usb driver

Post by MikyBart »

Hi all. I'm probably asking a bit too much. Has anyone developed a simple usb driver (any version) in nasm assembly?

:D :D :D
User avatar
BenLunt
Member
Member
Posts: 941
Joined: Sat Nov 22, 2014 6:33 pm
Location: USA
Contact:

Re: Nasm usb driver

Post by BenLunt »

Hi,

I highly suggest that you do not write a USB driver in assembly. The code can get quite complex and a single error, syntax or otherwise, will be very difficult to find.

On that note though, quite a while ago I did write a simple example in assembly to find a UHCI device.

https://www.fysnet.net/usb.htm

Please note that it does very little error checking, has a lot of assumptions, and was for information purposes only.

Ben
- https://www.fysnet.net/osdesign_book_series.htm
User avatar
GoingNuts
Posts: 2
Joined: Fri Jun 17, 2022 7:36 pm
Libera.chat IRC: GoingNuts

Re: Nasm usb driver

Post by GoingNuts »

I've just started off with usb keyboard driver and got as far as getting device and configuration descriptors but got stuck on several fronts here as I'm running my o/s in virtualbox under windows 11 which generates 2 different results compared to vmware pro; ie: set_configuration is acknowledged in vmware but not in virtualbox. Another issue is both interfaces (for keyboard & mouse) in vmware's configuration descriptor only give Classcode=3 but Subclass and Protocol are 0x00 and on top of all that both vms only allow 1 msi interrupt compared to 8 on baremetal. Yea... a bit of hassle for now.
Post Reply