RSSAmplifier

Blog

Mikhail Gusarov

dottedmag.netRSS feed ↗20 posts

Latest posts

Cheap design

In the physical world, making things has two costs: design and fabrication. Design is drawing up the part. Fabrication is producing it. Both are expensive, so physical things are made from standard parts: bolts, beams, extrusions, brackets. You accept the overhead of fasteners and adapters because custom fabrication costs too much. 3D printing made fabrication cheap. Now a built-to-purpose bracket…

From Trials to Trinkets: How Modern Star Wars Reflects a Culture of Instant Gratification

In the original Star Wars films, becoming a Jedi was not a matter of birthright or convenience. It was a long, painful journey — one marked by discipline, failure, and sacrifice. Luke Skywalker trained in isolation with Yoda, wrestled with self-doubt, and nearly succumbed to the dark side. Even Anakin, for all his natural power, couldn’t bypass the Order’s rigorous structure without consequence.…

How to add a new feature to Wayland?

The Wayland development process is often quite frustrating for application developers. When they discover missing functionality in Wayland and try to request it they often find series of closed bugs and discussions in development channels that go nowhere. I’ll try to demystify the process a bit and explain the reasons why this is happening and how to avoid it. So read on if you’d like…

Systems are sticky

A friend of mine has observed that pedestrian crossings in Cyprus still use buttons of British design, despite Cyprus having been independent from the UK for 64 years now. That’s not surprising: systems are very sticky. Pedestrian crossing buttons are a part of Cyprus’s road traffic control system, consisting most obviously of traffic lights and push buttons, as well as underground…

Kludge design pattern

Kludge Kludge allows one to quickly implement a requested change with no regard for long-term maintainability of the codebase. Also Known As Band-Aid Crutch Motivation There is a codebase that does not lend itself to the requested change: either because the codebase is not in a good shape, or because the deadline is looming, or because the programmer is unfamiliar with the code. Applicability The…

JSON+RPC

JSON+RPC is a RPC over HTTP with JSON as a serialization format. Don’t confuse it with JSON-RPC! They are as different as as DVD+R and DVD-R. UPD: Now with a website!

Klipper: BTT EBB36 debug print over serial

Debugging Klipper communication with a MCU is not trivial: Klipper has debug commands, but these commands use the same communication protocol that might need to be debugged. My Klipper branch adds debug_print function that outputs text to the serial port for STM32G0B1 MCU. The board I was debugging is BTT EBB36 . It does not have a serial port header, so I had to reuse a couple of probe pins:

Why does libvirt support only 14 hot-plugged PCIe devices on x86-64?

See the discussion of this blog post on Hacker News You might have used libvirt , a Linux daemon that provides an abstraction and management layer for virtualization software. This daemon allows you to submit an XML file containing a description of a VM, disk image or network. libvirt is then able to configure, start it and keep it running. There is a peculiar limitation in VMs started by libvirt…

PCI basics

PCI is a bus: there is a number of wires, PCI devices (targets in PCI parlance) connected to these wires, a protocol how to make it all work and PCI host controller that arbitrates bus access and provides interface for CPU to talk to the devices. Multiple buses There is a limited amount of devices that can be addressed on a single PCI bus, so PCI can be extended by bridges : a PCI-PCI bridge…

DE/compositor development notes - DRM properties and atomic interface

As explained in DRM pipeline , DRM is configured by setting up framebuffers, CRTCs, planes, connectors and encoders. Framebuffers have their own API discussed in DRM framebuffers . All other objects are configured through atomic interface, named thus as it provides an operation to apply a number of changes in atomic (all or none) manner 1 . Objects In atomic interface, DRM is configured through…

DE/compositor development notes - DRM pixel formats and modifiers

Display controller needs to know how data in framebuffer is laid out to know how to interpret it. This is indicated by pixel format and optional modifier. There are lots of formats and modifiers specified in drm/drm_fourcc.h . Formats are four-letter codes, modifiers are 32-bit integers. Pixel formats typically specify how one pixel is laid out: single-planar/multi-planar layout, order of…

DE/compositor development notes - DRM framebuffers

Display controller pipeline takes framebuffers as input. Framebuffer in DRM is a raster picture. Graphics display hardware is very particular about location and layout of that memory, and the details vary significantly between cards, so DRM provides some common functionality and leaves the rest to drivers. A framebuffer consists of: a chunk of memory (may be several chunks for pictures that are…

DE/compositor development notes - DRM pipeline

Once compositor has obtained the control over graphics hardware, it needs to find out what’s available for use. DRM exposes display controllers using the following objects: framebuffers, planes, CRTCs, connectors and encoders. Framebuffers Framebuffer is a bunch of pixels in memory with metadata (size, pixel format, memory layout). Framebuffers are typically an output of rendering, either…

Codenames

Codenames are useful. Whenever we develop software we invent names. Tons of names. VCS repository names, directory names, executable names, package names, class names, function names, configuration file names, database names, usernames. The list goes on. A natural impulse is to use your product’s name in these names. After all, if you are developing X it makes sense to name things after X.…

DE/compositor development notes - DRM operations - resource sharing

Graphics hardware might need to be shared by the compositor and applications. Compositor is in charge of display controller as a final arbiter of what goes to screen (except leasing, see below), but applications need access to rendering functionality. Several compositors need to share hardware too. Giving application access to the rendering Application (actually, usually Mesa on behalf of…

DE/compositor development notes - DRM operations - capabilites

What can compositor do with DRM devices once it has found them? These devices respond to a number of ioctl s. All DRM devices respond to a set of common ioctl s that cover display controller functionality, and there are driver-specific ioctl s used chiefly by Mesa for rendering operations. In addition, kernel writes data to open DRM file descriptors whenever an event happened and userspace has…

DE/compositor development notes - Linux VT

Before drawing any visuals on screen, the compositor must ensure it owns the screen it wishes to draw on. If it doesn’t, the results won’t look good, as multiple processes or the kernel may draw over the compositor’s output 1 . In Linux, VT subsystem draws terminals across multiple screens attached to computer 2 , so the compositor needs to cooperate with it. The VT subsystem…

DE/compositor development notes - Linux DRM devices

To draw on the screen, the compositor needs to communicate with the display controller and GPU 1 2 . Linux exposes them to userspace via DRM subsystem 3 , which presents them as character devices in /dev/dri 4 5 . There could be one or two devices per display controller or GPU 6 : there is always a device named card<N> that accepts all requests for controlling the display (KMS 7 ) and rendering…

DE/compositor development notes - introduction

This blog post initiates a series on implementation of a new desktop environment . The posts are not intended as comprehensvie documentation of the topics. They serve as working notes for me to ensure my understanding of the topics. I limit the scope of the posts in the following ways: I only describe Linux. I am not currently focused on portability. I only describe modern Linux. Historical…

Dependencies

Why are dependencies useful? Quick prototyping Bugs are someone else&rsquo;s concern Reverse engineering is someone else&rsquo;s concern Complicated algorithms and cryptography are someone else&rsquo;s concern Security-critical code testing is someone else&rsquo;s concern Why are dependencies problematic? Balooning build times Balooning build graph (hence tools slow down) Someone else&rsquo;s…