Page 1 of 2
Best way to access USB Floppy
Posted: Tue Sep 30, 2014 7:44 am
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?
Re: Best way to access USB Floppy
Posted: Tue Sep 30, 2014 9:48 am
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.
Re: Best way to access USB Floppy
Posted: Tue Sep 30, 2014 9:53 am
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.
Re: Best way to access USB Floppy
Posted: Tue Sep 30, 2014 7:14 pm
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.
Re: Best way to access USB Floppy
Posted: Wed Oct 01, 2014 12:40 am
by Muazzam
I am not talking about real floppies I'm just talking about USB flash drives emulated as floppies.
Re: Best way to access USB Floppy
Posted: Wed Oct 01, 2014 12:43 am
by djmauretto
Writing real USB driver.
Re: Best way to access USB Floppy
Posted: Wed Oct 01, 2014 1:03 am
by Muazzam
djmauretto wrote:Writing real USB driver.
But it is impossible for me.
Re: Best way to access USB Floppy
Posted: Wed Oct 01, 2014 2:05 am
by SoLDMG
Then don't use a USB drive.
Re: Best way to access USB Floppy
Posted: Wed Oct 01, 2014 2:22 am
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
(But seriously, it's more often than not wrong to use the word "impossible")
Re: Best way to access USB Floppy
Posted: Wed Oct 01, 2014 2:43 am
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.
Re: Best way to access USB Floppy
Posted: Wed Oct 01, 2014 2:50 am
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.
Re: Best way to access USB Floppy (about dex-os)
Posted: Wed Oct 01, 2014 4:05 am
by Muazzam
Have you ever seen dex-os? This is my favorite hobby OS. How dex-os access USB-Flash-Drives or USB floppies?
Re: Best way to access USB Floppy
Posted: Wed Oct 01, 2014 4:23 am
by iansjack
How dex-os access USB-Flash-Drives or USB floppies?
Why not look at the source code and see?
Re: Best way to access USB Floppy
Posted: Wed Oct 01, 2014 5:51 am
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.
Re: Best way to access USB Floppy
Posted: Wed Oct 01, 2014 6:17 am
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.