I am writing a bootloader for x86. At some point, at the beginning of the boot, I need to load some sectors from my boot disk into memory. I do this with interrupt 0x13 (ah = 02), and when I try it on my virtual machine, it works like a charm. However, when I write the image to a USB drive, the machine does not boot, and I attached it to the sector boot instructions, it is obvious that my USB drive is not disk 0 (Floppy A), so reading is not performed.
How to determine which drive was used to boot?
Thanks!
Guido source share