Remix.run Logo
rwmj 4 days ago

It's true that qemu doesn't aim for fidelity. (Despite the name, qemu isn't exactly an emulator!) The development efforts upstream are almost all about getting modern OSes to work well, and quite often the OS is aware that it's running on qemu and adjusts itself - most notably with the installation of virtio drivers, but also in smaller ways. The Linux kernel has over 1000 references to QEMU in its source code.

Also if you look at qemu's device emulation, that's usually "done" when it can run modern operating systems. Qemu doesn't try hard to emulate the entire IDE or SCSI command set in every detail, or every aspect of old hardware.

Another thing is that qemu is not cycle-accurate at all. Instruction and device timings will be wildly different from real hardware, especially if using TCG.

jacquesm 4 days ago | parent | next [-]

Yes, so I noticed... but: good to put all those old skills to use again. I'm having a lot of fun just struggling, if that makes any sense. And there is progress, I just booted the whole thing for the first time from 'floppy' (an image). The harddrive device driver is still giving me pain but I'm pretty sure I'm very close to making it work. The CHS emulation seems to be broken beyond repair so I'll just move the whole thing to LBA can call it a day.

My development system is a ramdisk right now and that feels a bit scary.

sebazzz 3 days ago | parent | prev [-]

That suggests also that QEmu isn’t the right software when fiddling with raw x86 assembly to write an OS (qemu is the recommendation of oswiki though).

So what is? One would need software supporting debugging. VirtualBox supports that I think, but I don’t know if that works if it runs on top of Hyper-V - which is enabled by default in Windows due to some security features (and I don’t want to disable that anyway).

AshamedCaptain 3 days ago | parent [-]

> That suggests also that QEmu isn’t the right software when fiddling with raw x86 assembly to write an OS (qemu is the recommendation of oswiki though).

It is the right software. It's not even debatable: qemu is the one most used for OS development by an order of magnitude difference or more.