Resizing Partitions on Linux

Sometimes, you need to resize your partitions on Linux. And this may not be as easy as you think…

When I installed Debian on my work computer a few months ago, the wizard suggested creating 2 separate partitions: one for root (with the OS itself), another for home (with my personal data). Alas! The suggested sizes (that I naively accepted) were highly unsuitable and a month later, the root partition (only 40 GB) was full. I had to resize them. It turns out that now, 5 months later, the home is full (I really generate a lot of data for my current project). It’s time to resize my partitions again but this time I will keep track of the entire procedure in this article. Who knows when I will have to resize them one more time…

CMake on STM32 | Episode 8: building with Docker

CMake on STM32 | Episode 8: building with Docker

In this episode, we will use Docker to set up and manage our build environment.

The embedded world doesn’t always embrace the latest software development techniques. I acknowledged this in the previous episode about unit tests. Four years ago, when I started this series, I was totally unaware of Docker for instance. Since then, I have used it for non-embedded projects and I think it could have solved some issues I encountered in the past. I would like to share my experience and demonstrate that it can perfectly fit in an MCU project.

CMake on STM32 | Episode 7: unit tests

CMake on STM32 | Episode 7: unit tests

It’s been almost four years, and it’s about time to revive this series on CMake and STM32 (or MCUs in general, STM32 just serves as a tangible example).

Funny enough, I’m not working with microcontrollers anymore… This is a very recent change in my professional career, even if I think I will probably work again with MCUs sooner or later. However, I still use CMake to build C++ projects! The real reason to resume this series is my desire to write an article about Docker for builds. In 2020, I had never used Docker at all. Today, I use it very often, and I’m convinced it could have solved some build and environment issues back then.

vtables under the surface | Episode 3 - How virtual functions are actually called

In this episode, we will see how invoking a virtual function in C++ translates into assembly instructions. We will see how our class instance is constructed and how it relates to the vtable. Then, we will see how this vtable is used to call the appropriate function.

If you have actually built the project and analyzed the binary in the previous episode, don’t forget to remove the -fno-rtti option and to rebuild the project. I will use this binary as a reference here.

vtables under the surface | Episode 2 - ELF files

In this episode, we will explore what vtables mean in terms of bytes within ELF files.

Build Output

On Linux, GCC produces ELF files as the result of the compilation process. In our project, the file is a.out, and we can use the file command to get details about it:

$ file a.out 
a.out: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=a87e1cb2356338a14f1a9aa2fef85fb7036bee65, for GNU/Linux 3.2.0, not stripped

If the compiler has generated vtables for Base and Derived, there must be corresponding symbols and bytes in the binary.