flat assembler
Message board for the users of flat assembler.

Index > Heap > Technologically challenged USB devices

Author
Thread Post new topic Reply to topic
Mike Gonta



Joined: 26 Dec 2010
Posts: 238
Location: the-ideom
Mike Gonta
Interesting cart before the horse devices.

Image
USB Floppy Disk Drive Emulator
Quote:
The USB Floppy product sold by PLR Electronics is a floppy disk drive emulator; emulator meaning it tries
to act the same way as a normal floppy disk drive would act, but it is not a 100% perfect emulation
because a USB stick is not exactly like a floppy disk.

_________________
Mike Gonta
the-ideom - now you know how to compile

https://mikegonta.com


Last edited by Mike Gonta on 12 Jan 2011, 21:41; edited 9 times in total
Post 06 Jan 2011, 03:05
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 2915
Location: [RSP+8*5]
bitRAKE
It seems like a nice replacement for a real floppy drive. Luckily, I no longer maintain legacy systems. Very Happy Floppy disks are so hard to find locally and are quite costly when seen. Not to mention how drive alignment drifts over time.
Post 06 Jan 2011, 04:53
View user's profile Send private message Visit poster's website Reply with quote
Mike Gonta



Joined: 26 Dec 2010
Posts: 238
Location: the-ideom
Mike Gonta
bitRAKE wrote:
It seems like a nice replacement for a real floppy drive.
Especially for all those lamenting the demise of the floppy disk for OS development.
Of course it's not a general solution for USB flash drive booting now that USB Booting Secrets is out.

_________________
Mike Gonta
the-ideom - now you know how to compile

https://mikegonta.com
Post 06 Jan 2011, 23:43
View user's profile Send private message Visit poster's website Reply with quote
Alphonso



Joined: 16 Jan 2007
Posts: 294
Alphonso
USB flash drives can emulate a floppy / CDROM, although most of mine are MBR type, am I missing something?

(Maybe I'm looking but not seeing Smile)
Post 07 Jan 2011, 08:14
View user's profile Send private message Reply with quote
Mike Gonta



Joined: 26 Dec 2010
Posts: 238
Location: the-ideom
Mike Gonta
Alphonso wrote:
USB flash drives can emulate a floppy / CDROM, although most of mine are MBR type, am I missing something?
Yes, the big picture!
Technically, the ordinary regular USB flash drive only emulates a block device.
A block device is like a floppy drive or hard drive, with a packet (historically referred to as a sector) interface. For example
you can not read or write only a single byte from these devices, it has to be a sector.
It's the BIOS which determines how the flash drive will appear, either as floppy or hard drive emulation. This means that the
same flash drive with the same file system image will be emulated differently on different PC's. In fact, on some PC's the
same file system image on for example a 1Gb drive will be emulated as floppy while on a 8 Gb drive will be emulated as
hard drive. When it comes to USB booting everything boots, the problem is that if the flash drive is formatted FAT16/FAT32
and the BIOS is using floppy emulation, access to the flash drive via int 13h will not work.
Keep in mind that FAT12 does not mean floppy disk, historically there existed non partitioned FAT12 formatted hard drives.
This is why I am recommending the FAT12 image on USB flash drive for OS development, it can boot and run from any PC
which can boot from a USB flash drive, just like a floppy disk (does) did.

_________________
Mike Gonta
the-ideom - now you know how to compile

https://mikegonta.com
Post 07 Jan 2011, 12:25
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4237
Location: 2018
edfed
it doen't only emulates block devices, it is a block device from the point of view of the "USB specifications".

effectivelly, accesses to the device via int13h is not warranted, some PCs do, other don't, then, don't try build something universal on this.


and fat32 don't mean no floppy drive too.

my aspire one (Pc3) boots on my 4GB usb pen, and it is recognised by win98's msdos as a floppy drive:

Code:
Microsoft(R) Windows 98
   (C)Copyright Microsoft Corp 1981-1998.

A:\>fasmd
    


to make a usb pen bootable under win98, it is very easy, just format the drive, with system file copy, and it's done.

after, just put your files, edit autoexec.bat, to initialise as you want, and it's done.

or

use int13h to write sectors as on floppy or hdd.

win98 is not dead.
Post 07 Jan 2011, 14:28
View user's profile Send private message Visit poster's website Reply with quote
Mike Gonta



Joined: 26 Dec 2010
Posts: 238
Location: the-ideom
Mike Gonta
edfed wrote:
effectivelly, accesses to the device via int13h is not warranted, some PCs do, other don't, then, don't try build something universal on this.
Any PC that can boot from USB (with a standard AT BIOS - even EFI emulates the AT BIOS) universally can access
the flash drive via int 13h. Otherwise what would be the point of booting from the flash drive if drivers which can't
fit in the boot sector would be required to load drivers?
edfed wrote:
and fat32 don't mean no floppy drive too.
There is no such thing as a FAT32 floppy disk. Even though current versions of Windows will not format a standard flash drive as
FAT12, Windows will still allow access to a FAT12 imaged flash drive as FAT12, and will not recognize it as A: or B:, but only
as a removable hard drive.
edfed wrote:
win98 is not dead.
Sometimes even rusty tools are better than nothing.

EDIT: Qualified standard flash drive as opposed to specialty flash drive such as HP USB Floppy Drive Key or Netac OnlyDisk.

_________________
Mike Gonta
the-ideom - now you know how to compile

https://mikegonta.com


Last edited by Mike Gonta on 12 Jan 2011, 10:47; edited 5 times in total
Post 07 Jan 2011, 14:55
View user's profile Send private message Visit poster's website Reply with quote
Alphonso



Joined: 16 Jan 2007
Posts: 294
Alphonso
Mike Gonta wrote:
For example
you can not read or write only a single byte from these devices, it has to be a sector.
As far as I remember you needed to write 512 bytes a time to the floppy. Maybe you mean the flash drive has a bigger block size than 512 bytes. I think if your using usb then the interface is emulated anyway so why not the flash drive too. IIRC some tricks could be done with real floppy drives such as synchronizing with the index mark but TBH it's all a bit of a vague memory for me.

Mike Gonta wrote:
Even though current versions of Windows will not format a flash drive as FAT12, Windows will still allow access to a FAT12 imaged flash drive as FAT12, and will not recognize it as A: or B:, but only as a removable hard drive.
I thought it did, I will have to check but here is my flash drive shown in Windows with emulated 3.5" 1.44MB floppy, 512B/sector, 80 tracks, 2 heads, 18 sectors/track for a total of 2880 sectors. The rest of the space on the flash drive is used as a 2nd LUN removable drive.

EDIT: Vista formatted it as FAT12 and replaced the boot sector with MSDOS5.0


Description:
Filesize: 16.07 KB
Viewed: 3621 Time(s)

boot.png


Description:
Filesize: 19.02 KB
Viewed: 3624 Time(s)

flop.png


Post 07 Jan 2011, 16:19
View user's profile Send private message Reply with quote
Mike Gonta



Joined: 26 Dec 2010
Posts: 238
Location: the-ideom
Mike Gonta
Alphonso wrote:
here is my flash drive shown in Windows with emulated 3.5" 1.44MB floppy, 512B/sector, 80 tracks, 2 heads, 18 sectors/track for a total of 2880 sectors.
I hadn't considered that obvious setup - Vista/Win7 with no physical floppy drive.
Alphonso wrote:
The rest of the space on the flash drive is used as a 2nd LUN removable drive.
Does Vista recognize the rest of the flash drive as a second drive?
What is the size of the flash drive?
What does the drive look like in "Disk Management"?
What does:
Code:
dd --list    
show?

_________________
Mike Gonta
the-ideom - now you know how to compile

https://mikegonta.com
Post 07 Jan 2011, 17:16
View user's profile Send private message Visit poster's website Reply with quote
Alphonso



Joined: 16 Jan 2007
Posts: 294
Alphonso
Yes the rest of the flash drive is recognized as a 980.7MiB removable drive.

It's a 1GB flash drive.

Disk Management does not show the floppy, only the removable LUN as a physical Disk, Removable 981MB Online with one FAT 981MB primary partition.

dd --list

...
\\.\Volume{8b973dba-1a6e-11e0-9158-806e6f6e6963}\
link to \\?\Device\Floppy0
removeable media
Mounted on \\.\a:


NT Block Device Objects
\\?\Device\CdRom0
size is 2147483647 bytes
\\?\Device\Floppy0
3.5, 1.44MB, 512 bytes/sector. Block size = 512
size is 1474560 bytes
...
Post 07 Jan 2011, 17:47
View user's profile Send private message Reply with quote
Alphonso



Joined: 16 Jan 2007
Posts: 294
Alphonso
Mike Gonta wrote:
Even though WinXP will not format a flash drive as
FAT12, WinXP will still allow access to a FAT12 imaged flash drive as FAT12, and will not recognize it as A: or B:, but only
as a removable hard drive.


I did not try formating but get pretty much the same on XP...


Description:
Filesize: 21.48 KB
Viewed: 3563 Time(s)

flopxp.png


Post 08 Jan 2011, 18:25
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.