Uh oh!
There was an error while loading. Please reload this page.
Add hidraw backend for FreeBSD - #730
Conversation
aokblast
commented
Mar 27, 2025
Currently, some stuff like the Report Descriptor parser and error registry routine are copied from Linux and I think they are platform independent. Can we create a common directory or hidraw directory in code then put them inside? Have tested by the hidtest program. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
49a7a62 to
6e7a25aCompareaokblast
commented
Mar 27, 2025
Thanks for @Youw your review:). Then, What is your opinion about this?
|
I thinjk that is a good idea, but I don't think it really is nesessary to do so in scope of this PR. |
mcuee
commented
Mar 28, 2025
Nice. This will address the following issue. |
aokblast
commented
Mar 28, 2025
Oops. I forget we have udev-devd stuff. Maybe we should use udev also? |
Youw
commented
Mar 28, 2025
I lost context here. What for? Seem like you have all the functionality implemented already. Aren't you? |
aokblast
commented
Mar 29, 2025
Yes, all functionality is fully implemented. I am just thinking if we should use libudev make hidapi more portable. |
First test under FreeBSD 14.1 Release, under a physical machine (Chuwi mini PC, Intel J4125 CPU, 8GB RAM, 256GB SSD) There are a few compiler warnings. |
aokblast
commented
Mar 30, 2025
Fix it:). Forget to fix the warning. |
mcuee
commented
Mar 30, 2025
Somehow hidtest-hidraw will seg fault with the Microchip Simple HID example. |
mcuee
commented
Mar 30, 2025
Thanks. The compiler warnings are gone. The Segfault issue is still there though. |
aokblast
commented
May 23, 2026
Thanks! Hope we can merge this patch ASAP:). |
mcuee
commented
May 24, 2026
Going back to the Generic HID PIC FW example (Full Speed USB device), there are no issues. |
mcuee
commented
May 24, 2026
Going to the original Generic PIC FW (unmodified, from Jan Axelson, Full Speed USB device) with two bytes reoort, it also works. |
mcuee
commented
May 24, 2026
Please re-review as well. Thanks. |
BTW, somehow your ISO image only works under VirtualBox VMs, I could not install it under an Intel N100 mini PC, not so sure about the reason (kernel panic). Therefore I cannot test it under physical machine as of now. Just FYI only. Now I am lazy to build FreeBSD using source code. I only did that a few times when HPS was developing the new FreeBSD USB Stack many years ago. |
aokblast
commented
May 27, 2026
Hi, is there any crash log? |
Let me capture the crash log over the weekend. I will also compare with FreeBSD 16.0-Current Snapshot. I have a few Chuwi Herobox mini PCs running Linux and BSDs. All of them have 8GB RAM. Each has the original 256GB SSD and one more SATA SSD (128GB or 256GB). Intel N4500 Mini PC -- OpenBSD 7.8 (will upgrade to 7.9 later) and NetBSD 10.1 I will kill the two Arch Based Linux distros (not really using them much) and install FreeBSD/OpenBSD. |
cederom
commented
May 28, 2026
For quick testing I recommend VENTOY [1] it provides USB BOOT menu supporting MBR/GPT/BIOS/UEFI where you can choose ISO from the same pendrive to boot. So you can have multiple images on the same bootable pendrive.. and you can use it for storage as well :-) Please let me know if there is anything to test on FreeBSD 14 :-) I can also boot of 15 or 16 if needed :-) |
wulf7
commented
May 28, 2026
There is a known hardware bug in Alder Lake processors. See https://lists.freebsd.org/archives/freebsd-current/2025-January/006984.html |
mcuee
commented
May 29, 2026
Sorry I made a mistake, it is not kernel panic, rather the system does not recognize the USB Flash Disk as bootable at all. I tried the latest snapshot (FreeBSD-16.0-CURRENT-amd64-20260525-490c53e9353f-286096-disc1.iso) and the issue is the same, tested with two USB Flash disks. Then I tested OpenBSD 7.9 release and it is able to boot (but then it does not recognize the wired and wireless network adapter).
Interesting. |
aokblast
commented
May 30, 2026
Is it possible to choose EFI file from your UEFI? |
mcuee
commented
May 31, 2026
Using Ventoy and then I can do that. Interesting findings -- now FreeBSD 15.0 Release and OpenBSD 7.9 can boot and I have installed them to the second SATA SSDs of the two Intel N100 Mini PCs. Somehow I need to use HTTP install. For the FreeBSD 16.0-Current images (your version or the snapshot version), both will fail to boot. All in all, looks like the issue is related to file system corruption. Screen photo taken from my mobile phone. ![]() |
Assisted-by: codex:gpt-5
Youw
commented
Jul 30, 2026
I've used gpt5.6-sol and found a number of issues with this implementation. |
Resolve the build-system conflicts with current master, fix the FreeBSD backend review findings, and add comprehensive native-backend CI including installed CMake export consumers. Assisted-by: codex:gpt-5 Assisted-by: claude-code:claude-fable-5
Use explicit zeroing for FreeBSD ioctl structures and keep parser locals outside cleanup jumps so the warnings-as-errors C++ CI build succeeds. Assisted-by: codex:gpt-5
Youw
commented
Jul 30, 2026
Codex updated the PR branch and pushed a186873:
Validation completed locally across Autotools, CMake shared/static, Meson, pkg-config, and installed export consumers. All PR checks are now green, including the native FreeBSD job and AppVeyor. Generated by Codex (GPT-5). |
Now someone could test and tell if there anything else left to fix - that would be helpful to move this forward. |
mcuee
commented
Jul 30, 2026
Yes I will test over the weekend. |
mcuee
commented
Jul 30, 2026
mcuee
commented
Aug 7, 2026
Sorry I was busy. I will try to do it this weekend or next week. |

FreeBSD support hidraw in Kernel from 13.0.
By using libusb only, we can only see the HID device from usb. To address this, we implement hidraw backend for FreeBSD.
Just like Linux use libudev to handle usb specified HID stuff (like Manufacture), we use libusb to handle it.
Sponsored-by: FreeBSD Foundation
Related to #274
Fixes#543
Assisted-by: codex:gpt-5