Best way to access USB Floppy

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.
User avatar
Muazzam
Member
Member
Posts: 543
Joined: Mon Jun 16, 2014 5:59 am
Location: Shahpur, Layyah, Pakistan

Best way to access USB Floppy

Post by Muazzam »

In your opinion, What is the "Best" and also "Easy" way to access USB floppies in protected mode?.
1. Drop protected mode access disks and re-enter protected mode.
2. With virtual 8086 mode.
3. Writing real USB driver.
or another way?
How your operating system access it?
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: Best way to access USB Floppy

Post by Combuster »

4. None of the above.

For floppies, the easiest and possibly also the best way is to just load everything from the floppy into memory before leaving the bootloader in the first place.

By the time you actually need to get to writing to a floppy, you can write a proper driver.
"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
iansjack
Member
Member
Posts: 4707
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Best way to access USB Floppy

Post by iansjack »

TBH I think it's more effort than it is worth to support floppies in a modern operating system. I can't remember the last time I used one on a real computer; in fact none of my computers has a floppy drive. They really are yesterday's technology.
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Re: Best way to access USB Floppy

Post by Brynet-Inc »

USB floppy drives typically show up as regular Mass Storage devices. I know some of them also support LS-120/SuperDisk media as well.

If you can find them, ATAPI LS-120 drives support 1.44M floppies as well and are useful for testing your ATAPI code with something other than DVD/CDROM devices.
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
Muazzam
Member
Member
Posts: 543
Joined: Mon Jun 16, 2014 5:59 am
Location: Shahpur, Layyah, Pakistan

Re: Best way to access USB Floppy

Post by Muazzam »

I am not talking about real floppies I'm just talking about USB flash drives emulated as floppies.
djmauretto
Member
Member
Posts: 116
Joined: Wed Oct 22, 2008 2:21 am
Location: Roma,Italy

Re: Best way to access USB Floppy

Post by djmauretto »

Writing real USB driver. :wink:
User avatar
Muazzam
Member
Member
Posts: 543
Joined: Mon Jun 16, 2014 5:59 am
Location: Shahpur, Layyah, Pakistan

Re: Best way to access USB Floppy

Post by Muazzam »

djmauretto wrote:Writing real USB driver. :wink:
But it is impossible for me.
User avatar
SoLDMG
Member
Member
Posts: 96
Joined: Wed Jul 23, 2014 8:00 am
Location: The Netherlands
Contact:

Re: Best way to access USB Floppy

Post by SoLDMG »

Then don't use a USB drive.
My post is up there, not down here.
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: Best way to access USB Floppy

Post by Combuster »

muazzam wrote:But it is impossible for me.
Then use something exist- oh wait, you can't because you didn't write that yourself either :twisted:

(But seriously, it's more often than not wrong to use the word "impossible")
"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
iansjack
Member
Member
Posts: 4707
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Best way to access USB Floppy

Post by iansjack »

While the difficult takes time, the impossible just takes a little longer
The pragmatic solution is to use devices that you can support.
Antti
Member
Member
Posts: 923
Joined: Thu Jul 05, 2012 5:12 am
Location: Finland

Re: Best way to access USB Floppy

Post by Antti »

If you boot from a USB stick (BIOS booting), emulated as a floppy disk (e.g. 1.44 MB), you need to use the "INT 0x13, AH=0x02, Read Sectors" service at least once.
User avatar
Muazzam
Member
Member
Posts: 543
Joined: Mon Jun 16, 2014 5:59 am
Location: Shahpur, Layyah, Pakistan

Re: Best way to access USB Floppy (about dex-os)

Post by Muazzam »

Have you ever seen dex-os? This is my favorite hobby OS. How dex-os access USB-Flash-Drives or USB floppies?
User avatar
iansjack
Member
Member
Posts: 4707
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Best way to access USB Floppy

Post by iansjack »

How dex-os access USB-Flash-Drives or USB floppies?
Why not look at the source code and see?
User avatar
Muazzam
Member
Member
Posts: 543
Joined: Mon Jun 16, 2014 5:59 am
Location: Shahpur, Layyah, Pakistan

Re: Best way to access USB Floppy

Post by Muazzam »

iansjack wrote: Why not look at the source code and see?
Dex-OS code is not very readable. And also I am not good at reading code written by others.
User avatar
iansjack
Member
Member
Posts: 4707
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Best way to access USB Floppy

Post by iansjack »

muazzam wrote:
iansjack wrote: Why not look at the source code and see?
Dex-OS code is not very readable. And also I am not good at reading code written by others.
Even well-written assembler code can be difficult to follow, and very few people seem to produce well-written code. This is one of the reasons that higher-level languages were developed and sensible programmers use them rather than assembler. But if you are determined that assembler is the only true path to follow then you really need to concentrate on improving your skills at reading other people's code, well or badly written. (You should also take the opportunity to study many processors, not just the x86 family.)

Treat this as an opportunity to develop those skills and, as a bonus, learn about programming USB devices.
Post Reply