Page 1 of 1
[SOLVED] How can I implement HID protocol ?
Posted: Sat Aug 07, 2021 10:33 am
by Rukog
I do not want to deal with in or out because I do not on Windows, I setup data structure and call a bunch of functions to initialize HID protocol and thus being able to talk to my keyboard or any USB devices.
https://www.codeproject.com/Articles/12 ... -using-HID
Re: How can I implement HID protocol ?
Posted: Sat Aug 07, 2021 10:46 am
by Klakap
Re: How can I implement HID protocol ?
Posted: Sat Aug 07, 2021 11:01 am
by Rukog
I know everything about this already, it doesn't say how can I do that in a non Windows environment.
Update:
My current research is at
https://en.wikipedia.org/wiki/Ioctl
https://docs.microsoft.com/en-us/window ... eiocontrol
https://elixir.bootlin.com/linux/latest ... octl.c#L24
Maybe it's all about that, the IOCTL thing
Re: How can I implement HID protocol ?
Posted: Sat Aug 07, 2021 11:46 am
by Klakap
I apologize, but I do not understand how is this connected with OS development. Shouldn’t this be in General Programming? If you want to parse HID, you need to have written USB driver as first. HID parsing comes when you receive HID protocol from USB device.
Re: How can I implement HID protocol ?
Posted: Sat Aug 07, 2021 11:51 am
by Rukog
Klakap wrote:I apologize, but I do not understand how is this connected with OS development. Shouldn’t this be in General Programming? If you want to parse HID, you need to have written USB driver as first. HID parsing comes when you receive HID protocol from USB device.
It is, same as
viewtopic.php?f=1&t=49913
Both of those requests are aiming to handle device communication for further implementation inside an OS.
The USB driver handle HID protocol, it's its nature, a driver is written to offer a gate of communication between PC and device, thus HID protocol for USBD.
What I've wrote is a driver, a user land driver but still a driver, but for windows:
https://www.codeproject.com/Articles/12 ... -using-HID
Now I want to write an equivalent driver as the one above for my own OS.
Re: How can I implement HID protocol ?
Posted: Sat Aug 07, 2021 12:00 pm
by Klakap
HID protocol is not about communicating with USB devices. Communication with USB devices is doing through USB controllers OHCI/UHCI/EHCI/xHCI. When you can communicate with USB device, you can found that it is Human Interface Device, and parse HID protocol to found how you can use data which is device sending to you.
Re: How can I implement HID protocol ?
Posted: Sat Aug 07, 2021 12:08 pm
by Rukog
Klakap wrote:... through USB controllers OHCI/UHCI/EHCI/xHCI ...
All of these are related to the PCI thing ?
Re: How can I implement HID protocol ?
Posted: Sat Aug 07, 2021 12:10 pm
by Klakap
Yes, from PCI you read base address of ports of these controllers. But do not be worry about PCI, writing driver for it is not hard thing.
Re: How can I implement HID protocol ?
Posted: Sat Aug 07, 2021 12:13 pm
by Rukog
Klakap wrote:Yes, from PCI you read base address of ports of these controllers. But do not be worry about PCI, writing driver for it is not hard thing.
Ok thanks, I will take a look on that thing lol
Re: How can I implement HID protocol ?
Posted: Sat Aug 07, 2021 12:20 pm
by Klakap
In fact, if you want to have from your operation system something more than simply showing something to screen, you have to write PCI driver. In PCI is connected everything, hard disk, CDROM, sound card, USB controllers, network cards...
Re: How can I implement HID protocol ?
Posted: Sat Aug 14, 2021 5:15 am
by Rukog
Why is it so hard to get the PCI Firmware Specification PDF
https://pcisig.com/firmware-wg-pci-firm ... change-bar
Have to be an org or smth to be able to dl that stuff, it's not the same song for USB spec
https://usb.org/hid
I have to search for that like I would do for a torrent lol
(I found it btw, not sure I can share the link here)
Re: [SOLVED] How can I implement HID protocol ?
Posted: Sat Aug 14, 2021 6:39 am
by nexos
No, don't share it
. There is book on the internet called PCI systems architecture that the publishers made as a free PDF. You could try using that