A fellow member of this forum asked me a few questions (via PM) and it got me to check some of my code with QEMU. My code works on real hardware, Bochs, and VirtualBox, but not on QEMU. So I went looking. Come to find out, unless I am mistaken, QEMU returns 0x70 (No CDROM inserted) every time for the (cd-rom) MODE SENSE command.
For reference, see Line 866, Line 885, and Line 904.
Since my code uses the MODE SENSE command to detect if a disk is inserted and what type of disk it is, I am out of luck with QEMU.
For example, a value of 0x10 or 0x18 would be a normal return.
Code: Select all
MEDIA_TYPE_CDR10 = 0x10, // Door closed / caddy inserted, medium type (CD-R) size unknown
MEDIA_TYPE_CDR18 = 0x18, // 80 mm CD-ROM (CD-R) Hybrid disc (Photo CD), door closed or caddy inserted
MEDIA_TYPE_NO_DISC = 0x70, // 70h Door closed, no disc present
I would think that QEMU would "patch" this byte at the end of the call, but apparently it does not.
I am wondering, what other ways do you know to detect if a disc is inserted and possibly what type? Currently, I am only concerned with the inserted status.
Thanks,
Ben
- http://www.fysnet.net/osdesign_book_series.htm