Rabbithole: Shell Pipelines

In prepping for the next part of my OS journey (writing an init system!), I found a need to add pipelining to my shell. This entry is a quick jaunt into how that works. All the code we break down here can be found here. What actually is a pipe? Before we talk about a pipeline, it’s useful to know what a pipe is. Fundementally, a pipe is two File Descriptors (read: files, yes it’s a bit more complicated but bear with me), where what is written to one end of the pipe is readable in the other....

February 27, 2024 · 8 min

Rabbithole: A weird CPIO discrepancy

We learnt previously that an initramfs in Linux is a “CPIO archive”, so I set out to write something that can read and write them, in order to learn more about the format. What I found was an interesting discrepancy between how GNU cpio and the Linux Kernel parse CPIO files. It seems pretty innocuous, but I thought I’d document it for posterity. The CPIO header CPIO is an exceedingly simple format....

December 28, 2023 · 3 min