Dragonfly BSD on Macbook Air 2017 (Part 2)

Dragonfly BSD on a Macbook Air (Part 2)


Short update on trackpad support. 0x05ac:0x0291 is supported by the wsp driver in FreeBSD. Sascha Wildner has been kind enough to get it merged into master.

I ended up putting Xubuntu back on my macbook, just to give me something I could continue using while looking at the trackpad problem. If you found this page looking for “trackpad” “dragonfly bsd” “macbook” - the problem I had was this: on random occasions, random button presses would fire. This was true both in X11 and on the console. Debug output from moused showed that it was seeing these button press events from the device.

A helpful person on the mailing list recommended I try FreeBSD to see if the issue persisted there. Trying -CURRENT, which will become 13 at the time of writing, I observed the issue in X11, but not on the console. FreeBSD, unlike Dragonfly BSD, provides two drivers for Macbook touchpads - wsp and atp. The former for contemporary devices, the latter for older devices.

FreeBSD and Dragonfly BSD are two distinct operating systems, but given Dragonfly BSD originally diverged from FreeBSD, there’s plenty shared code and co-operation between the two. With that, I expected someone had attempted to port the wsp driver, and went about looking for mention of it on mailing lists or blogs. My search eventually brought me to this patch, bringing in both atp and wsp.

I’d built Dragonfly BSD from source before, but only to upgrade. I was also thrown off when the patch failed to apply, although I shouldn’t have been given the patch was ~3 years old. Flicking through the wiki, and figuring out how to write a new kernel module, I yanked the wsp code from the patch and introduced it to my tree by hand. There’s probably a better way to do that, and I’ll learn it at some point I’m sure.

Having built the kernel and restarted, I was cautiously happy to find /dev/wsp0. Starting moused to provide /dev/sysmouse from /dev/wsp0, I was cautiously ecstatic to not see ghost clicks. Starting xfce, I was relieved to find that not only did the cursor work, not send arbitrary clicks - it also had two-finger-right-click and two-finger-scrolling.

There’s still some outstanding niggles. Keyboard backlight doesn’t work, although I don’t use it. Function keys also don’t report themselves as anything other than F1-F12, so I’ve had to script around the keys I care about using intel_backlight and mixer. I’d also like to see wsp upstreamed, but I don’t have the knowledge to do that, and my impression from the mailing list is that not all Macbooks have this problem, so I don’t know how specificly useful this patch it.