How to use `gcc_multi` with a specific GCC version in nixpkgs?

I recently came across the problem that pkgs.gcc_multi comes with gcc in version 12 but I needed version 11. While nixpkgs exports gcc in multiple versions (pkgs.gcc, pkgs.gcc11, pkgs.gcc12, pkgs.gcc13), pkgs.gcc_multi is only exported once, backed with the version coming from pkgs.gcc. However, using another, specific gcc version is fairly simple. In <nixpkgs at NixOS 23.11>/pkgs/top-level/all-packages.nix we can find gcc_multi. This is aliased to pkgs.wrapCCMulti gcc (function call), which is defined in the Read more…

Introducing PhipsBoot – My x86 Relocatable Bootloader

Today, I’d like to introduce you to PhipsBoot. 🎉 I started working on it in September 2023 or so, but polished it just recently. A lot of knowledge from my previous blog post about x86 Kernel Development & Relocatable Binaries went into this project. PhipsBoot is a relocatable x86_64 bootloader written in Rust and assembly that loads a kernel into 64-bit mode. It abstracts a lot of boot-related x86_64 complexity away. It is Read more…

Screenshot: PhipsBoot Output

x86 Kernel Development & Relocatable Binaries – What I learned about Toolchains and Relocatable Code

This post is roughly a summary of the obscure knowledge I learned about toolchains and relocatable code in the last couple of years by studying the code of the microkernels NOVA and Hedron, my professional hands-on experience with kernel development, and several learning projects. I present some of the “hard and not obvious” properties of producing kernel binaries, information that only stands “between the lines” in existing projects, and topics I didn’t find Read more…

Where to find the official GNU ld and linker script documentation?

This is another post in the series of stuff I wish I knew when I started studying in 2015. So, dear past me, here you go. The very short answer is that all GNU binutils documentation, which GNU ld is part of, is hosted at sourceware.org/binutils. One also finds the documentation of the linker script language (as part of GNU ld), GNU as (gas) and GNU BFD library (libbfd), including more binutils there. Read more…

Live Linux: lsblk output From the Live Linux, you can now access and modify all your drives/partitions. In this case, /dev/nvme0n1p3 is the root partition of the installed Linux system.

What is a Live Linux, Where do I get it?

In my mission on making things easily googleable and helping others, I have a new blog post for you today. From time to time, one needs to boot into a Live Linux (also “Linux Live system”) to repair things that can’t be repaired from a running Linux system, to test a new Linux distribution, or to update the partition scheme of your system’s main drive. But I think that with the existing guides Read more…

I switched to another NixOS Configuration and deleted my main user

… Now I can’t log in and my system is broken. This is what essentially happened to me recently 😄. Luckily, I was able to fix my system. But let’s go through what happened step by step. Disclaimer: This guide is not meant for absolute Linux beginners. To follow the guide, you need to understand the basics of NixOS, how to work with a shell, and how to mount partitions. Also, this guide Read more…