Page 1 of 1
USB Floppy Issues
Posted: Mon Jan 03, 2011 12:56 pm
by Karlosoft
Hi, I need to boot my os on a newer pc without the floppy support in order to test the multiprocessor code I wrote. The problem is that the first stage bootloader which works on the floppy drive, is loaded from this harddisk/floppy USB but it never copies the second stage in memory. Have I to make something particular in order to make it work?
I'm using the int 0x13 with ah,2 to read sectors isn't it right?
Re: USB Floppy Issues
Posted: Mon Jan 03, 2011 1:06 pm
by Tosi
No, as far as I know that only works with floppy drives. I don't write much real mode code so I don't know exactly or not, but...
You will have to either find a BIOS interrupt which can read a USB drive, or write your own USB driver into the bootloader.
Re: USB Floppy Issues
Posted: Mon Jan 03, 2011 1:31 pm
by Combuster
If you use FAT, Floppies are FAT12, sticks are FAT16/32, and you generally need a separate bootloader for either (although if you're really good you might be able to put code for all three in the same 512 bytes).
In any case, an USB device is treated differently depending on BIOS - start with adding a BPB if you have none, and check whether it is emulated as a HD or FDD (look at the DL register), and whether the emulated CHS is what you expect.
Re: USB Floppy Issues
Posted: Mon Jan 03, 2011 2:48 pm
by M2004
Karlosoft: Maybe this can help you a bit?
http://board.flatassembler.net/topic.php?t=12389
Regards
Mac2004
Re: USB Floppy Issues
Posted: Mon Jan 03, 2011 4:23 pm
by Karlosoft
What is the difference between an emulating floppy and an emulating hard disk?
I used the dd tool to copy the floppy image on the usb stick so it should be formatted fat12 (windows recognized it like a FAT12 1,4Mb floppy)
No but that link seems to be interesting
Re: USB Floppy Issues
Posted: Mon Jan 03, 2011 4:39 pm
by Combuster
Floppies normally don't do LBA, whereas it is the best option for harddisks. Also, it means your BPB does not match the physical characteristics of the medium: sector 1 head 1 track 0 does not need to be the 19th sector but is just as likely to be the 64th.
Re: USB Floppy Issues
Posted: Mon Jan 03, 2011 4:56 pm
by Karlosoft
I see. I'll try to solve the problem in this way, thank you