How to Find Out if a Binary Runs Inside QEMU

In the previous blog post we talked about how to use QEMUs debugcon feature. To do this responsibly, we should only do this if the binary runs in fact inside QEMU. To find this out, one can use the cpuid instruction. It gives us a lot of information about our environment including information about the CPU brand name or if we run inside a hypervisor. This instruction is specific for the x86-platform. It Read more…

How to Use QEMUs “debugcon”-Feature (and Write to a File)

QEMU is a hypervisor often used for low-level OS/kernel development and testing. Especially when you write your own OS/kernel, things can get really hard and difficult to debug. Furthermore, there are not many debug capabilities in the sense, that you can’t write to files or screen in early phases of the boot process due to the lack of an initialized environment with drivers etc. For this case, QEMU has a featured called debugcon. Read more…

Rust: setTimeout and setInterval as in Javascript with “tokio” as Runtime

Even though I’m working with Rust for over 2.5 years now, I unfortunately never made a deep dive into the async/await/future-world. But I started using tokio a few days ago and a few questions came up. Tokio is a runtime for executing futures, great! For this, tokio needs some kind of “tasks” or “lightweight userland threads”, okay. To schedule N tasks across M cores, tokio need some kind of event loop,.. so.. similar Read more…

How-To: Compile EDK2/OVMF From Source on Linux [2021]

EDK2 is a development environment to create firmware implementations that follows the UEFI specification. It is part of tianocore project. which is the reference implemenation for UEFI. Multiple “packages”, which are the sources to build tianocore for different platforms (x86, ARM, QEMU), are located inside the git repository of “EDK2”. OVMF, which stands for Open Virtual Machine Firmware, is one of these packages. It enables UEFI inside virtual machines, like in QEMU environments. Read more…

Frequency Spectrum obtained using my Rust lib (original signal: sine waves at 50, 1000 and 3777 Hz with a little bit of clipping, which results in the noise in the signal)

Frequency Spectrum Analysis with FFT in Rust (library spectrum-analyzer)

One week ago FFT (Fast Fourier Transformation) and frequency spectrum analysis were still a mysterium to me. Because I have a long time planned side project (live beat detection to music) and had some time, I started to make a deep dive into digital signal processing (DSP), including lowpass filters and especially frequency spectrum analysis using FFT. I was a little bit shocked/disappointed by the lack of good ressources and easy to understand Read more…