I stumbled upon a problem when trying to get Qemu to boot my homebrew kernel image. For certain sizes of floppy image files, the (still homebrew) bootloader failed to load the kernel properly.
After quite a bit of searching, I believe I pinned the problem down to the fact that Qemu tries to adjust the geometry of the floppy to the size of the image file. The kernel loaded fine when the floppy geometry was determined to be "1.44 MB 3"1/2 floppy disk (2 h 80 t 18 s) rw", while it failed miserably when it was detected as "880 kB 5"1/4 floppy disk (2 h 80 t 11 s) rw". (The change was triggered by a tiny change in file-size.) I expected Qemu to emulate the 1.44 MB standard geometry regardless, so this was quite surprising. I'd like to suggest that it would be better to base the floppy geometry on user configuration rather than auto-detection, because this can cause surprising behaviour and confusion. However, when I tried to take this variable floppy geometry into account in my bootloader, by using the in 13,8 BIOS service, it didn't work. This service reports 15 sectors/track rather than 11 as stated above. Also, when I read the floppy (using in 13,2), it behaves consistently with 11 sectors/track. So I'm unable to write a bootloader that works with Qemu. This appears to me to be a bug in Qemu, although I am no expert in how these BIOS services are supposed to work. Regards, -- Frode Vatvedt Fjeld