home | hardware | software | misc | about | rss

OpenBSD on the 2020 M1 MacBook Air

28-Apr-2022

The 2020 M1 MacBook Air, running OpenBSD 7.1 -current

Year: 2020

CPU: 4 3.2 GHz Firestorm cores, 4 2.0 GHz Icestorm cores (arm64)

Graphics: 7 core 1.28 GHz integrated Apple GPU

RAM: 8 GB integrated 4266 MHz

Storage: 256 GB integrated (yes this too) NVMe Apple AP0256

"But can it run Chrome?": yes

dmesg

Because I hate myself, I buy Apple hardware solely to run OpenBSD on it. I was following the ongoing work to get OpenBSD running on Apple's new arm64 M1 SoCs and decided to give it a try on the 2020 M1 MacBook Air.

First, the Air itself. It's thin, it's not as lightweight as it looks, and it feels very well made. The 2560x1600 Retina display is very good. It includes "True Tone" technology according to Apple, which does...absolutely nothing as far as I can tell. It looks like every other Retina display. While it is crisp, and colors are accurate, it's noticeably behind the 9th Gen X1 Carbon's 4k HDR, and this is very apparent when they are side by side. Gone are the days when "Retina" meant you were getting the best display on the market. Now it's just better than almost all the displays out there.

The keyboard is bad. Typing feels like stabbing your fingers onto a plastic sheet laid over styrofoam. Internet-people told me this new "Magic" keyboard is a major improvement, and they are right in that the previous butterfly keyboards were even worse (remove the styrofoam and you have the butterfly experience). But travel is still too short and feedback is not really satisfying. At least the Air doesn't have the Touch bar like my previous MacBook Pro had, so you do get real function keys. Fumbling with a Touch bar to PXE boot a server over a duct-taped IPMI KVM connection might be a fun spectator sport, but it's not fun to be the participant.

Performance is where this starts to make sense. You get eight physical cores, four of which run at 3.2 GHz, while the other four run at 2.0 GHz. RAM is quick too, running at 4266 MHz and is integrated into the SoC. TDP for this whole thing is pretty low at 15 watts, so battery life is excellent, even though performance is faster than the i7-1165G7 in my X1 Carbon. It is also fanless, and thus completely silent with no coil whine either.

I didn't really play around much with macOS. Installing OpenBSD is fairly simple. From macOS, open a terminal and grab the Asahi Linux installer and run it. This will resize your macOS installation to create free space, install a stub MacOS installation onto that, which will be used to load u-boot. The Asahi installer will offer to either install Asahi Linux automatically, or create just a UEFI partition here, onto which you can install OpenBSD. This is the option you want.

You do need to follow the Asahi installer's instructions regarding how to shut down and restart to finish the stub macOS setup. These things are, quite frankly, an absolute pain to dual boot once you understand what is actually going on. Fortunately the Asahi folks have done an admirable job sorting this out, and it works smoothly, though I don't really want to know how the sausage is made.

You'll need a USB with OpenBSD's arm64 miniroot dd'd to it. Once you get to the actual OpenBSD installation, it's familiar. You can choose "whole disk" during partitioning without harming your macOS installation. I thought briefly about adding an encrypted softraid partition for /home, but because of the macOS partitions, EFI gubbins, etc, there are a lot of partitions detected by the ramdisk, and disklabel won't let you make anymore. If you want to do some custom partitioning scheme, you might need to remove some of the OpenBSD default partitions to appease disklabel.

OpenBSD support once you have it installed is actually quite good considering how early this is as of 7.1. CPU frequency can be controlled with apmd, and will downclock to 600 MHz under battery power. Battery life is somewhere around 10 hours at full brightness, with wifi. Wifi itself on the Broadcom BCM4378 is supported by bwfm, and works very well, even offering AC speeds. Overall system performance, except for graphics, is extremely quick. I'm impressed.

There are some things that don't work yet. There is no GPU acceleration. Fortunately, the CPUs are fast enough that X11 still works well with sofware rendering. You will see some sluggishness scrolling in Chromium or Firefox though. Chromium performs miles ahead of Firefox in my testing, and I'm not exactly sure why. There's no way to control the display backlight brightness (as far as I know). Sound does not work, though playing a video in Chromium is so slow that it's not going to be a fun time anyway. There is no suspend or resume support.

It's usable for me as a daily driver right now, despite these drawbacks, but I don't ask for much, so your mileage may vary. The only graphical application I use is Chromium, which works well enough that I can do what I want to do, with the exception of YouTube. I did find some tweaks that made things nicer. The trackpad can be made more usable by setting it to tap-to-click. Just add this line to /etc/wsconsctl.conf:


mouse.tp.tapping=1,3,2

You may also want to increase the cursor speed, as it is rather slow in OpenBSD. xinput can do that, and I have the following in ~/.xsession:


xinput set-prop "/dev/wsmouse0" "Device Accel Constant Deceleration" 0.5

Scaling in X11 is at its best on this display at 2x, for my terrible eyes. I set this in ~/.xsession like so:


export GDK_SCALE=2.0
export QT_SCALE_FACTOR=2.0

That's all I have found necessary. Everything else works exactly as you would expect from OpenBSD. Many thanks to the Asahi team for putting together their installer, and to the OpenBSD devs for making it work on this hardware.