USB Human Interface Devices Wiki Page

All about the OSDev Wiki. Discussions about the organization and general structure of articles and how to use the wiki. Request changes here if you don't know how to use the wiki.
Post Reply
User avatar
BrightLight
Member
Member
Posts: 901
Joined: Sat Dec 27, 2014 9:11 am
Location: Maadi, Cairo, Egypt
Contact:

USB Human Interface Devices Wiki Page

Post by BrightLight »

Hi.

Since this forum has helped me so much in many ways through the years, I figured I owe the OSDev community a contribution for something it actually is missing. So I wrote on the USB Human Interface Devices Wiki page some general information on HID devices, and some information specific to USB mice. I figured that information and tips on USB seem to be quite rare on the internet, and so since I am working on USB myself, I figured why not leave something on the Wiki that might help someone in the future?

Anyway, could someone proof-read it, and check for any errors I might have overlooked or anything unclear I stated? Thanks!
Last edited by BrightLight on Mon May 22, 2017 9:06 am, edited 1 time in total.
You know your OS is advanced when you stop using the Intel programming guide as a reference.
no92
Member
Member
Posts: 306
Joined: Wed Oct 30, 2013 1:57 pm
Libera.chat IRC: no92
Location: Germany
Contact:

Re: USB Human Interface Devices Wiki Page

Post by no92 »

I have no idea about the technicalities of USB, so all I'm seeing is the style of the article. I must admit that I like what I see so far.

Three minor nitpicky-ish complaints: the page title should be USB Human Interface Devices, not USB Human Input Devices. Also, writing '...' in a wiki article is a style slip up. Lastly, while I wouldn't mind leaving it as it is, the wiki style guide requires the 'Keep reading' section to be named 'See also', with the subheaders 'Articles' for other wiki pages, 'Threads' for forum threads and 'External Links' for everything else.

Otherwise, great contribution.
User avatar
SpyderTL
Member
Member
Posts: 1074
Joined: Sun Sep 19, 2010 10:05 pm

Re: USB Human Interface Devices Wiki Page

Post by SpyderTL »

Agreed. This page looks good.

After you finish the keyboard section, we're also gonna need a game pad section. I've been working on game pad HID stuff off and on for a while, so if nothing else, I should be able to add some more detail before too long.

It may deserve its own page, though, since the report structure is not fixed.

But, yeah, good work. Thanks.
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
User avatar
BrightLight
Member
Member
Posts: 901
Joined: Sat Dec 27, 2014 9:11 am
Location: Maadi, Cairo, Egypt
Contact:

Re: USB Human Interface Devices Wiki Page

Post by BrightLight »

no92 wrote:the page title should be USB Human Interface Devices, not USB Human Input Devices.
I overlooked this. I made a page called USB Human Interface Devices, and the USB Human Input Devices is simply a redirect page.
You know your OS is advanced when you stop using the Intel programming guide as a reference.
Korona
Member
Member
Posts: 999
Joined: Thu May 17, 2007 1:27 pm
Contact:

Re: USB Human Interface Devices Wiki Page

Post by Korona »

Its always nice to see additions to the wiki :)

One thing that should probably be clarified is that the report formats that you describe only apply to the keyboard and mouse boot protocols and that generic HID devices communicate their report format via the report descriptor.

I saw that you linked your own implementation of the spec. I have a generic report descriptor parser that I might link once it is polished.
managarm: Microkernel-based OS capable of running a Wayland desktop (Discord: https://discord.gg/7WB6Ur3). My OS-dev projects: [mlibc: Portable C library for managarm, qword, Linux, Sigma, ...] [LAI: AML interpreter] [xbstrap: Build system for OS distributions].
User avatar
BenLunt
Member
Member
Posts: 935
Joined: Sat Nov 22, 2014 6:33 pm
Location: USA
Contact:

Re: USB Human Interface Devices Wiki Page

Post by BenLunt »

I was also going to mention that the report you describe may only apply to the Boot Protocol and the driver should parse the HID Descriptor report to retrieve the exact format of the report. (The Boot Protocol was included so that a boot application didn't have to include a parser just to be able to boot the system. A lot of thought and engineering went into the USB, I am completely impressed by the years of work that went/goes into it.)

If you plan to document how to parse the HID descriptor, this could take a whole new page.

Just to clarify, it is not the device attached that will emulate a PS/2 device, but the UHCI/OHCI/EHCI/xHCI controller that does so. You probably meant that, it just sounds like it could be either way.

One of the things I have planned for a future edition of my book is a great more detail on HID devices. I currently show how to parse a Mouse and Keyboard HID descriptor, but plan to go into much more detail.

It is a lot of work, so thank you for efforts on the Wiki. I am sure it will help many.

Ben
User avatar
BrightLight
Member
Member
Posts: 901
Joined: Sat Dec 27, 2014 9:11 am
Location: Maadi, Cairo, Egypt
Contact:

Re: USB Human Interface Devices Wiki Page

Post by BrightLight »

I've clarified the difference between the boot protocol and the report protocol and how to distinguish between them, and clarified that the report structures I define are usable with the boot protocol only. Hopefully I can write something on USB keyboards sometime this week or next week. If someone here has an opensource USB HID implementation, feel free to link it in the "external links" section. :)
You know your OS is advanced when you stop using the Intel programming guide as a reference.
palmsa
Posts: 1
Joined: Sun Jun 04, 2017 8:46 am
Location: UK
Contact:

Re: USB Human Interface Devices Wiki Page

Post by palmsa »

This article looks very good and was written fully professional. Thanks for sharing and letting know that page like this exists somewhere on web.
To want to, is to be able to.
User avatar
BrightLight
Member
Member
Posts: 901
Joined: Sat Dec 27, 2014 9:11 am
Location: Maadi, Cairo, Egypt
Contact:

Re: USB Human Interface Devices Wiki Page

Post by BrightLight »

palmsa wrote:This article looks very good and was written fully professional. Thanks for sharing and letting know that page like this exists somewhere on web.
I'm happy to help. :)

About this article, I wrote about USB keyboards, and maybe someone could help me proof-read it, or point out anything unclear?
You know your OS is advanced when you stop using the Intel programming guide as a reference.
Post Reply