io_uring Internals
A slide deck I made recently, covering some internal implementation details of io_uring. Click the slides above to navigate, or open directly here.
Building a Minimal Linux Filesystem
Last time, we covered how to set up a development environment with the latest kernel using QEMU. But after trying it for a while, I found it wasn’t very convenient. More often than not, I just need to run a single program (like a unit test), and the full environment built in the previous article makes this process more complicated. This article introduces a simpler approach. A simple script is all it takes to build a complete runtime environment....
Running the Latest Kernel on QEMU
Recently, I’ve been spending my spare time on a systems programming project. Before long I ran into a problem: using the latest kernel features isn’t exactly easy. Most distributions lag behind the latest kernel releases, and I’m not bold enough to risk upgrading the kernel on my only Linux machine (using the installkernel command). So I needed a way to set up a development environment with a newer kernel while keeping my system safe....
Build a Container from Scratch with Namespaces
Container technology is built on three Linux kernel features: Namespaces, Cgroups, and Unionfs. They provide logical resource isolation, physical resource limits, and container filesystems, respectively. Among these, Namespaces are the most critical. They implement isolation — the most essential aspect of virtualization. Even without Cgroups and with an alternative to Unionfs, you can still achieve much of what a container does, as long as you have Namespaces. So in this article, we’ll try to build a simple container using Namespaces....
Linux Users and Users in Containers
The era of multi-user operating systems is long over. People today generally don’t share computing resources by having multiple users log into the same OS — we have better virtualization technology for that. But users still serve a purpose, the most important being permission isolation. There’s a lot to say on this topic, but we’ll focus on just the most critical points. Containers introduce additional quirks around users, which we’ll also discuss....
Which Parameter Type Should I Use?
In this article, we’ll discuss a small but practical question: when should you use each kind of function parameter type? Classifying Parameters Suppose we have a type T (to keep things simple, T here is not a generic type parameter). How many ways are there to pass a parameter of this type to a function? Let’s break it down: Qualifier: const-qualified or not Reference category: by value, by lvalue reference, by rvalue reference Based on this classification, we get exactly 5 parameter types:...