Towards Secure System Graphics: Arcan and OpenBSD
It&#x27;s true that a bunch of the Linux infrastructure for handling things is more painful than the equivalent OpenBSD infrastructure - the thing that&#x27;s ignored here is that a bunch of the reason for the difference in complexity is that OpenBSD isn&#x27;t trying to solve as many problems. Picking the backlight case since it&#x27;s one I&#x27;m familiar with[1] - there are three different broad ways that a backlight can be presented to the OS. There&#x27;s the standard ACPI mechanism, which can be loosely associated with a display under a limited number of circumstances. There&#x27;s platform-specific mechanisms, which usually can&#x27;t be meaningfully associated with a display. Finally, there&#x27;s backlight control that&#x27;s handled through the GPU directly.<p>Where the GPU has backlight control registers, these will usually work and so there&#x27;s an incentive to always use them - except for systems where the firmware expects to be able to drive the backlight (for instance, cases where hitting the backlight control buttons triggers system management interrupts that then cause the firmware to write to the same registers, or firmware-controlled ambient light sensors), which then results in the hardware state and the firmware state being out of sync and the brightness jumping about in an unpredictable way. And even on systems where using the GPU registers <i>is</i> the right thing to do, one dual-GPU systems where the iGPU is hooked up to the screen then you need to use its backlight control registers even if you&#x27;re rendering on the dGPU. And on dual-GPU Apples, you need to ignore the GPU registers because the backlight is controlled by the gmux and hitting the GPU registers can fuck things up in amazingly hilarious ways.<p>If you ignore all these problems then you end up with a simpler interface, and it probably works for a decent percentage of use cases. The same applies to input (things like libratbag exist to apply a level of abstraction to more complicated mouse-style input devices, which you can ignore if you don&#x27;t care), and to a whole bunch of things if you don&#x27;t need to care about multiseat.<p>(The discussion about security doesn&#x27;t match my experience of working with the Linux graphics community - patches and even new drivers have been rejected based on their security impact, even if they add new functionality)<p>[1] I wrote libbacklight