USB Floppy Issues

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
Karlosoft
Member
Member
Posts: 277
Joined: Thu Feb 14, 2008 10:46 am
Location: Italy
Contact:

USB Floppy Issues

Post 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?
Tosi
Member
Member
Posts: 255
Joined: Tue Jun 15, 2010 9:27 am
Location: Flyover State, United States
Contact:

Re: USB Floppy Issues

Post 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.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: USB Floppy Issues

Post 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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
M2004
Member
Member
Posts: 65
Joined: Sun Mar 07, 2010 2:12 am

Re: USB Floppy Issues

Post by M2004 »

Karlosoft: Maybe this can help you a bit?

http://board.flatassembler.net/topic.php?t=12389

Regards
Mac2004
User avatar
Karlosoft
Member
Member
Posts: 277
Joined: Thu Feb 14, 2008 10:46 am
Location: Italy
Contact:

Re: USB Floppy Issues

Post 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
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: USB Floppy Issues

Post 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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Karlosoft
Member
Member
Posts: 277
Joined: Thu Feb 14, 2008 10:46 am
Location: Italy
Contact:

Re: USB Floppy Issues

Post by Karlosoft »

I see. I'll try to solve the problem in this way, thank you
Post Reply