Assembly Code Snippet: Use section flags if you need custom section names

GNU ld Discards Section Containing Code – Section Flags are Important for ELF Files

Update: Since I published this article, I gained more knowledge from own research and hints from others. I adjusted the blog post. Thanks for the help! When it comes to low-level systems engineering and producing binaries, such as firmware or kernels, dealing with linkers and especially linker scripts feels like the end boss in a video game. Only very little (good) documentation can be found on the Web. This blog post is the Read more…

Create a Bootable Image for a Custom Kernel with GRUB as Bootloader for Legacy x86 Boot (e.g. Multiboot2 Kernel)

In this blog post, I want to show you how you can boot your custom (i.e., self developed, non-linux) kernel with GRUB 2 in a legacy x86 boot flow. The tutorial is focused on Linux as build environment. A working example can be found on my GitHub. Introduction When you are an OS developer/low-level hacker and write your own kernels, you need a setup to boot your software stack (i.e., kernel and user Read more…

Screeshot: Live Audio Visualization of Waveform (original vs lowpass filter)

Live Audio Visualization With Rust in a GUI Window

In early 2021 I had a closer look into several aspects of digital signal processing (DSP), including lowpass filters, frequency spectrum analysis, and audio visualization. I used Rust to experiment with this. The Rust ecosystem didn’t offer simple-to-use libraries for my use cases back then, or at least they were not easy to find. While I learned more about the topic, I created multiple crates, with the hope they may be helpful to Read more…

Direct Systemcalls to Linux from Rust Code (x86_64)

What I show in this blog post is nothing new or unique, but it is something I wish someone would have shown me in this simplicity in my second or third semester at university. In this post, I briefly explain how you can talk to Linux without the libc or the Rust standard library (which uses libc behind the scenes most probably). Furthermore, I give you pointers to the corresponding syscall code in Read more…

Screenshot of Sourcecode

Minimal GRUB Configuration To Boot A Multiboot2 Kernel With Boot Modules

TLDR: for Multiboot2 you use module2 and for Multiboot1 module in GRUB config files. One of my projects of the last months was to build a prototype setup for kernels written in Rust. The kernel is Multiboot2-compliant and boots on x86_64 with UEFI as firmware. To test everything, I create a standalone GRUB in a directory, which contains the kernel (an 64-bit ELF) and a minimal grub.conf. The “standalone GRUB” is a regular Read more…

Adding and Using Files To/From the GRUB Memdisk (GRUB Standalone)

TLDR: GRUB can reference internal files via the volume specifier (memdisk), similar to external drives (hd0). GRUB has an undocumented but really convenient feature to include files/images (e.g., bootable kernels) directly into the GRUB installation itself. If you use $ grub-mkstandalone to store GRUB on a USB stick or a QEMU volume for example, you can bundle GRUB as EFI-application together with a configuration and payload/files. These files can be stored in the Read more…