Page 1 of 1

Emulate floppy drive, accessed through BIOS API

Posted: Sun Apr 05, 2009 2:58 pm
by Walling
I have an idea, where I need to emulate floppy access, ie. no floppy exists, but the content of a floppy disc is loaded in memory. I want to boot that virtual floppy disc. I can enter (un)real mode and load the first sector at 7C00, but I somehow need to intervene, when the MBR starts calling the BIOS API to load more sectors.

A have a vague idea of looking up interrupt 0x13 in the IVT, replacing it with my own ISR that intercepts requests about my virtual floppy drive (fx. drive number 0) and just forwards other requests. Is this the best approach? The downside is that I have to re-create much of the BIOS API, both the standard way and extended. It might not be a big deal. A subtle problem is if I reply "true" as to supporting the 13h Extensions. The virtual floppy kernel assumes this goes for both floppy and hard disc. It works for the floppy, because I intercept the requests and reply, but when it requests to read the hard disc I forward the request to the BIOS that does not have the 13h Extensions... bang.

Edit: Another subtle problem is where to place the ISR and virtual floppy content. It can be overwritten by the booting kernel at any time. It should possibly stay until it is no longer needed by the virtual floppy MBR/bootloader.