I have written my own OS to detect how many drives present on my computer. But I had some difficulties with hyper-v. I found that I added the DVD disk in hyper-v. However, when I was brutal forcefully probing how many disks exist. It turns out that the DVD disk is not present.
The same problem is with ReactOS. When ReactOS tries to fetch first several bits from the CD disk by using ATA, it runs into the issue of IO1_INITIALIZATION_FAILED.
Here is my configuration:
IDE 0: CD myos.iso, Drive testvm.vhd
Here is the number of devices that I have on this virtual machine:
disk number: 0x0 (floppy disk 1)
disk number: 0x1 (floppy disk 2)
disk number: 0x80 (hard drive)
If it's correctly running, it should show another drive with number 0xE0. I have tested this on Qemu, it turns out to be correct. However, I do not know why it does not work on hyper-V. I will test VirtualBox next. My guess would be that hyper-v has some protection mechanism to prevent a CD being written. But it does not exempt a disk being not present in the system.