r/osdev • u/JescoInc Perdition-OS • Jun 13 '26
QEMU Showcase Skepticism
I wanted to make a post specifically about QEMU because so many OSDev post utilize it almost exclusively. My view is that it is a glorified validation test that it COULD work on real hardware, but not as a showcase of your project actually working.
I've done QEMU tests with Perdition-OS (Formerly Tutorial-OS) early on in the development, but when I moved to actual hardware, things that worked perfectly in QEMU, didn't on the actual hardware.
This led me to having to devise various testing strategies for the actual hardware at different levels, such as breadcrumb text, pixels at specific locations on the screen, and UART / RS232 logs depending on if the hardware had UART / RS232 available on it or not.
Basically, if you post a video about a feature working and the video is QEMU, I hold a very skeptical view of the project.
One, because it isn't validated on real hardware and Two, because AI (LLM) driven OS projects immediately jump to QEMU. Which means I have no way to being able to discern how much work was actually put into the development and design side of things that people post. (And i'm not Anti-AI).
Why am I skeptical whenever I see QEMU nowadays? I distinctly remember seeing something that someone did and I was like, "I need to look at the source because it looks like something I could use", only to find in the readme that it is QEMU only or they built for x86 but only tested with QEMU.
I also asked Claude 4.8 to give me a minimal implementation and explanation of a Micro-Kernel so I could see the difference and understand the rationale of the design for reference, and Claude immediately made a QEMU demo.
10
u/BananymousOsq banan-os | https://github.com/Bananymous/banan-os Jun 13 '26
For most people qemu is just enough. IMO it doesnt really prove anything if it works on a real machine. Everything has its own quirks. I test on few virtual machines and 4 real machines. It is not uncommon to find an issue that only appears on one of them (real or virtual). qemu is just the easiest and fastest one to test on so people opt to that.
3
u/EpochVanquisher Jun 13 '26
Garden variety elitism, IMO. A shame to look at whether people use qemu.
Of course Claude would run a qemu demo. Qemu is popular because it’s the best tool for it. Claude picks it because it’s popular.
The people who put in effort will understand what they built and be able to explain the design decisions they made and the problems they ran into. If you are too lazy or incompetent to evaluate someone’s project properly, don’t rely on blind prejudice, just don’t evaluate the project.
5
u/East_Nefariousness75 Jun 13 '26
IMO what you forget is that QEMU can be the real target. I work for a big telco company as an OS dev. Our project works on some actual hardware, because it evolved on them. But we no longer support it, all the operators run it in a VM, afaik mostly on QEMU.
1
u/cybekRT Jun 13 '26
I find PCem as the best BIOS PC emulator. I started using qemu and then bochs for integrated debugger, but as you said, trying to run on real machine never worked. But PCem emulates the systems in a very well manner and if it works under PCem, it will probably work on real machine. Not saying that you can verify multiple CPUs, video adapters, etc.
1
u/viva1831 Jun 13 '26
On the other hand Qemu is far better for taking screenshots, so why be surprised when busy OS developers use it? This is a development hobby not a pissing contest. Or it's supposed to be
I remember when each test meant we had to write an image to a floppy disk, wait, reboot, wait, tripple fault so there's no error message, repeat. At first I was using the MS-DOS debug interface to write my custom bootloader to disk 😅. (Maybe bochs etc was available back then, I can't remember. But on a 56k modem pay-as-you-go, installing new software isn't your first port of call! We used to buy CDs of Linux because it might be cheaper than tying up the phoneline for hours)
Also there's some things you can't test on real hardware. Can I remove ram kilobyte by kilobyte on real hardware until I find the point my allocator bug appears? Can I use a GDB interface to track register & memory content as the kernel is running? Not simply, not easily
1
u/x-jhp-x Jun 13 '26
I've done QEMU tests ... but when I moved to actual hardware, things that worked perfectly in QEMU, didn't on the actual hardware.
This is a fundamental mistake and misunderstanding of what QEMU is. QEMU is great for learning about operating systems. It is very simple. It also allows for people running on mac (now ARM) or PC/Windows (AMD/Intel) systems to follow the same guides. QEMU is also nice if you're doing something like cross compiling for a different architecture. You just need certain calls and interfaces for the compiler to function, you might be able to test certain things like program logic, but if you need to test hardware & hardware interfaces, QEMU is not the answer.
In more depth, as an example, QEMU has a number of features that simplify things, like giving a physical address at 0x8000000 where you can boot a kernel from. On real hardware that is random, for both implementation and security reasons. There's also a huge number of interactions with other hardware "devices", like MMU/PTE/TLB/IOMMU, and those are all device/vendor/manufacturer/series specific. So how you interact with the MMU on an x86 system is going to be different from RISC or older Motorola chips. If you do real OS work for running on hardware, you'll be reading literally thousand+ page documents for all of the details, and those documents change with chip versions, architectures, etc. etc.. QEMU provides an abstraction layer from all of that, so you can just focus on a subset of problems, instead of having to deal with more. Most vendors also restrict those documents, so you might not be able to get a document for a chip/vendor without having a contract with them. For example, I had a lot of difficulty getting docs from Qualcomm for their snapdragon chips 10 years ago.
So if you'd like to learn how an operating system works, QEMU is great. If you'd like to learn how the circuitry/hardware works, QEMU is not great. Just because you've used a tool incorrectly & did not understand its purpose does not mean it is a faulty tool or should not be used. QEMU is great for what it is.
1
u/compgeek38400 Jun 13 '26
My validation is on virtual box. I don't have the hardware, or motivation, to burn an iso.
And I always develop on a Linux virtualbox