Discussion:
USB stick boot like a floppy
(too old to reply)
T. Ment
2020-05-08 03:41:53 UTC
Permalink
My 1.44MB floppy drives are old and dying. I have USB, but most tools
format a USB stick like a hard drive, and then it boots as C: or D:. I
want it to boot like a floppy, as A: or B:

I couldn't find a USB format tool for that, so I hacked a floppy boot
sector. With much trial and error I got one working. It defines a 15MB
floppy, just under the FAT12 limit. Sectors per track is still 18, but
heads is now 64. Sectors per cluster is 8 instead of 1. Total sectors
changed from 2880 to 32520. That leaves a few unused clusters for the
limit of FAT12, and you could fiddle with it to max it out, but I was
happy to get one working, and didn't bother.

Below is the method I used to initialize the USB stick sector 0. After
that you still must boot into DOS and format it. It works on some PCs
but not all. If DOS format reports any bad sectors, it didn't work and
you must try a different PC.

Once formatted correctly, it will boot as the A: drive. One PC of mine
required USB-ZIP in the BIOS setup instead of USB-FDD.


??? is the usb stick device name

dd bs=4k count=5000 if=/dev/zero of=/dev/???
dd if=sector0 of=/dev/???

sector0 dump:

000000 eb 3c 90 4d 53 44 4f 53 35 2e 30 00 02 08 01 00
000010 02 f0 00 08 7f f0 0c 00 12 00 40 00 00 00 00 00
000020 00 00 00 00 00 00 29 f1 18 6a 36 44 4f 53 36 32
000030 32 20 20 20 20 20 46 41 54 31 32 20 20 20 fa 33
000040 c0 8e d0 bc 00 7c 16 07 bb 78 00 36 c5 37 1e 56
000050 16 53 bf 3e 7c b9 0b 00 fc f3 a4 06 1f c6 45 fe
000060 0f 8b 0e 18 7c 88 4d f9 89 47 02 c7 07 3e 7c fb
000070 cd 13 72 79 33 c0 39 06 13 7c 74 08 8b 0e 13 7c
000080 89 0e 20 7c a0 10 7c f7 26 16 7c 03 06 1c 7c 13
000090 16 1e 7c 03 06 0e 7c 83 d2 00 a3 50 7c 89 16 52
0000a0 7c a3 49 7c 89 16 4b 7c b8 20 00 f7 26 11 7c 8b
0000b0 1e 0b 7c 03 c3 48 f7 f3 01 06 49 7c 83 16 4b 7c
0000c0 00 bb 00 05 8b 16 52 7c a1 50 7c e8 92 00 72 1d
0000d0 b0 01 e8 ac 00 72 16 8b fb b9 0b 00 be e6 7d f3
0000e0 a6 75 0a 8d 7f 20 b9 0b 00 f3 a6 74 18 be 9e 7d
0000f0 e8 5f 00 33 c0 cd 16 5e 1f 8f 04 8f 44 02 cd 19
000100 58 58 58 eb e8 8b 47 1a 48 48 8a 1e 0d 7c 32 ff
000110 f7 e3 03 06 49 7c 13 16 4b 7c bb 00 07 b9 03 00
000120 50 52 51 e8 3a 00 72 d8 b0 01 e8 54 00 59 5a 58
000130 72 bb 05 01 00 83 d2 00 03 1e 0b 7c e2 e2 8a 2e
000140 15 7c 8a 16 24 7c 8b 1e 49 7c a1 4b 7c ea 00 00
000150 70 00 ac 0a c0 74 29 b4 0e bb 07 00 cd 10 eb f2
000160 3b 16 18 7c 73 19 f7 36 18 7c fe c2 88 16 4f 7c
000170 33 d2 f7 36 1a 7c 88 16 25 7c a3 4d 7c f8 c3 f9
000180 c3 b4 02 8b 16 4d 7c b1 06 d2 e6 0a 36 4f 7c 8b
000190 ca 86 e9 8a 16 24 7c 8a 36 25 7c cd 13 c3 0d 0a
0001a0 4e 6f 6e 2d 53 79 73 74 65 6d 20 64 69 73 6b 20
0001b0 6f 72 20 64 69 73 6b 20 65 72 72 6f 72 0d 0a 52
0001c0 65 70 6c 61 63 65 20 61 6e 64 20 70 72 65 73 73
0001d0 20 61 6e 79 20 6b 65 79 20 77 68 65 6e 20 72 65
0001e0 61 64 79 0d 0a 00 49 4f 20 20 20 20 20 20 53 59
0001f0 53 4d 53 44 4f 53 20 20 20 53 59 53 00 00 55 aa
000200
wolfgang kern
2020-05-08 06:38:28 UTC
Permalink
On 08.05.2020 05:41, T. Ment wrote:

[about...]
Post by T. Ment
Once formatted correctly, it will boot as the A: drive. One PC of mine
required USB-ZIP in the BIOS setup instead of USB-FDD.
interesting, which tool did you use for editing an USB-stick ?
and wasn't any pre-formatting to 512 byte sectors required ?
__
wolfgang

I see "DOS 5.0" but the rest is too blurred for my old worn eyes
but I'll keep it to view it with my extreme large zoom ...
Post by T. Ment
??? is the usb stick device name
dd bs=4k count=5000 if=/dev/zero of=/dev/???
dd if=sector0 of=/dev/???
000000 eb 3c 90 4d 53 44 4f 53 35 2e 30 00 02 08 01 00
000010 02 f0 00 08 7f f0 0c 00 12 00 40 00 00 00 00 00
000020 00 00 00 00 00 00 29 f1 18 6a 36 44 4f 53 36 32
000030 32 20 20 20 20 20 46 41 54 31 32 20 20 20 fa 33
000040 c0 8e d0 bc 00 7c 16 07 bb 78 00 36 c5 37 1e 56
000050 16 53 bf 3e 7c b9 0b 00 fc f3 a4 06 1f c6 45 fe
000060 0f 8b 0e 18 7c 88 4d f9 89 47 02 c7 07 3e 7c fb
000070 cd 13 72 79 33 c0 39 06 13 7c 74 08 8b 0e 13 7c
000080 89 0e 20 7c a0 10 7c f7 26 16 7c 03 06 1c 7c 13
000090 16 1e 7c 03 06 0e 7c 83 d2 00 a3 50 7c 89 16 52
0000a0 7c a3 49 7c 89 16 4b 7c b8 20 00 f7 26 11 7c 8b
0000b0 1e 0b 7c 03 c3 48 f7 f3 01 06 49 7c 83 16 4b 7c
0000c0 00 bb 00 05 8b 16 52 7c a1 50 7c e8 92 00 72 1d
0000d0 b0 01 e8 ac 00 72 16 8b fb b9 0b 00 be e6 7d f3
0000e0 a6 75 0a 8d 7f 20 b9 0b 00 f3 a6 74 18 be 9e 7d
0000f0 e8 5f 00 33 c0 cd 16 5e 1f 8f 04 8f 44 02 cd 19
000100 58 58 58 eb e8 8b 47 1a 48 48 8a 1e 0d 7c 32 ff
000110 f7 e3 03 06 49 7c 13 16 4b 7c bb 00 07 b9 03 00
000120 50 52 51 e8 3a 00 72 d8 b0 01 e8 54 00 59 5a 58
000130 72 bb 05 01 00 83 d2 00 03 1e 0b 7c e2 e2 8a 2e
000140 15 7c 8a 16 24 7c 8b 1e 49 7c a1 4b 7c ea 00 00
000150 70 00 ac 0a c0 74 29 b4 0e bb 07 00 cd 10 eb f2
000160 3b 16 18 7c 73 19 f7 36 18 7c fe c2 88 16 4f 7c
000170 33 d2 f7 36 1a 7c 88 16 25 7c a3 4d 7c f8 c3 f9
000180 c3 b4 02 8b 16 4d 7c b1 06 d2 e6 0a 36 4f 7c 8b
000190 ca 86 e9 8a 16 24 7c 8a 36 25 7c cd 13 c3 0d 0a
0001a0 4e 6f 6e 2d 53 79 73 74 65 6d 20 64 69 73 6b 20
0001b0 6f 72 20 64 69 73 6b 20 65 72 72 6f 72 0d 0a 52
0001c0 65 70 6c 61 63 65 20 61 6e 64 20 70 72 65 73 73
0001d0 20 61 6e 79 20 6b 65 79 20 77 68 65 6e 20 72 65
0001e0 61 64 79 0d 0a 00 49 4f 20 20 20 20 20 20 53 59
0001f0 53 4d 53 44 4f 53 20 20 20 53 59 53 00 00 55 aa
000200
T. Ment
2020-05-08 12:12:44 UTC
Permalink
Post by wolfgang kern
Post by T. Ment
Once formatted correctly, it will boot as the A: drive. One PC of mine
required USB-ZIP in the BIOS setup instead of USB-FDD.
interesting, which tool did you use for editing an USB-stick ?
First, I formatted a real floppy disk in DOS 6.22. Then I used Norton
Commander to copy the floppy disk to a 1.44 image file. Then I booted
linux and used dd to copy the first 512 bytes to another file named
sec0. Then I copied that to new0. Then I used linux vbindiff to edit
both 512 byte files and poke the bytes in new0. It shows what changes
you made. Good tool. Then I used dd to copy new0 to the USB stick.
Post by wolfgang kern
and wasn't any pre-formatting to 512 byte sectors required ?
The dd commands I posted define the format of the USB stick. Like a
floppy, there is no partition table, just a sector 0. DOS understands
that to be a floppy and formats it accordingly. In a PC with a real
floppy drive, the USB looks like a B: drive, so in DOS:

format b: /u /s

gives a bootable USB stick. Then you reboot and fiddle with BIOS setup
to make it boot from USB. Then BIOS will swap A: and B: so that it boots
as an A: drive and the real floppy is now B:. Also works in a PC with no
floppy, but then you don't see any B: drive, only A:.

The DOS format command did not work in all PCs I tested. But once it did
work in one PC, the USB stick booted in the PC where it failed to format
correctly. Just a BIOS problem it seems. Same DOS 6.22 on both PCs.
Post by wolfgang kern
I see "DOS 5.0" but the rest is too blurred for my old worn eyes
but I'll keep it to view it with my extreme large zoom ...
"DOS 5.0" is how DOS 6.22 formats a real floppy disk. It's the OEM field
in sector 0. Any value may work, but I didn't try that.
Kerr-Mudd,John
2020-05-08 12:30:27 UTC
Permalink
Post by T. Ment
Post by wolfgang kern
Post by T. Ment
Once formatted correctly, it will boot as the A: drive. One PC of mine
required USB-ZIP in the BIOS setup instead of USB-FDD.
interesting, which tool did you use for editing an USB-stick ?
First, I formatted a real floppy disk in DOS 6.22. Then I used Norton
Commander to copy the floppy disk to a 1.44 image file. Then I booted
linux and used dd to copy the first 512 bytes to another file named
sec0. Then I copied that to new0. Then I used linux vbindiff to edit
both 512 byte files and poke the bytes in new0. It shows what changes
you made. Good tool. Then I used dd to copy new0 to the USB stick.
Post by wolfgang kern
and wasn't any pre-formatting to 512 byte sectors required ?
The dd commands I posted define the format of the USB stick. Like a
floppy, there is no partition table, just a sector 0. DOS understands
that to be a floppy and formats it accordingly. In a PC with a real
format b: /u /s
gives a bootable USB stick. Then you reboot and fiddle with BIOS setup
to make it boot from USB. Then BIOS will swap A: and B: so that it boots
as an A: drive and the real floppy is now B:. Also works in a PC with no
floppy, but then you don't see any B: drive, only A:.
The DOS format command did not work in all PCs I tested. But once it did
work in one PC, the USB stick booted in the PC where it failed to format
correctly. Just a BIOS problem it seems. Same DOS 6.22 on both PCs.
Post by wolfgang kern
I see "DOS 5.0" but the rest is too blurred for my old worn eyes
but I'll keep it to view it with my extreme large zoom ...
"DOS 5.0" is how DOS 6.22 formats a real floppy disk. It's the OEM field
in sector 0. Any value may work, but I didn't try that.
I used to collect boot sectors Way Back When; but I didn't get many (a
dozen?) Some were quite basic with just enough code to display "This
isn't a boot disk" or somesuch message.
--
Bah, and indeed, Humbug.
Wildman
2020-05-08 15:19:55 UTC
Permalink
Post by Kerr-Mudd,John
I used to collect boot sectors Way Back When; but I didn't get many (a
dozen?) Some were quite basic with just enough code to display "This
isn't a boot disk" or somesuch message.
Here is my boot sector collection, if you are interested.
I have them from 12 different DOS brands with different
sized discs. More than a hundred total.

Dropbox link:
https://www.dropbox.com/s/5t6ukp6dn4tfqpd/bootsect.rar?dl=0

Direct download:
https://www.dropbox.com/s/5t6ukp6dn4tfqpd/bootsect.rar?dl=1
--
<Wildman> GNU/Linux user #557453
"There are only 10 types of people in the world...
those who understand Binary and those who don't."
-Spike
Kerr-Mudd,John
2020-05-09 10:52:11 UTC
Permalink
Post by Wildman
Post by Kerr-Mudd,John
I used to collect boot sectors Way Back When; but I didn't get many (a
dozen?) Some were quite basic with just enough code to display "This
isn't a boot disk" or somesuch message.
Here is my boot sector collection, if you are interested.
I have them from 12 different DOS brands with different
sized discs. More than a hundred total.
https://www.dropbox.com/s/5t6ukp6dn4tfqpd/bootsect.rar?dl=0
https://www.dropbox.com/s/5t6ukp6dn4tfqpd/bootsect.rar?dl=1
Cheers for that nostalgia! I think mine were just the incremental MS DOS
& NT; but maybe 1 or 2 from install disks. I think "stoned" was on the
list for my bootsector id prog.
--
Bah, and indeed, Humbug.
Wildman
2020-05-09 15:16:39 UTC
Permalink
Post by Kerr-Mudd,John
Post by Wildman
Post by Kerr-Mudd,John
I used to collect boot sectors Way Back When; but I didn't get many (a
dozen?) Some were quite basic with just enough code to display "This
isn't a boot disk" or somesuch message.
Here is my boot sector collection, if you are interested.
I have them from 12 different DOS brands with different
sized discs. More than a hundred total.
https://www.dropbox.com/s/5t6ukp6dn4tfqpd/bootsect.rar?dl=0
https://www.dropbox.com/s/5t6ukp6dn4tfqpd/bootsect.rar?dl=1
Cheers for that nostalgia! I think mine were just the incremental MS DOS
& NT; but maybe 1 or 2 from install disks. I think "stoned" was on the
list for my bootsector id prog.
I used WinImage to extrace the boot sectors from
the actual discs or images.
--
<Wildman> GNU/Linux user #557453
The cow died so I don't need your bull!
Wildman
2020-05-09 15:19:40 UTC
Permalink
Post by Wildman
I used WinImage to extrace the boot sectors from
the actual discs or images.
Should have been extract. LOL
--
<Wildman> GNU/Linux user #557453
The cow died so I don't need your bull!
Kerr-Mudd,John
2020-05-09 19:07:15 UTC
Permalink
Post by Wildman
Post by Wildman
I used WinImage to extrace the boot sectors from
the actual discs or images.
Should have been extract. LOL
Gosh; it was Nortons Utilities in my day. Till I wrote my own.

Oh dear, an embarrassing 213 bytes with some of my home-grown routines.
(still, it's olde DOS only, direct disk access by int 13 is disallowed
under NT upwards)
--
Bah, and indeed, Humbug.
T. Ment
2020-05-09 15:31:18 UTC
Permalink
Post by Wildman
I used WinImage to extrace the boot sectors from
the actual discs or images.
What version, and where can I get it?
Wildman
2020-05-09 16:32:27 UTC
Permalink
Post by T. Ment
Post by Wildman
I used WinImage to extrace the boot sectors from
the actual discs or images.
What version, and where can I get it?
Used different versions over a period of time. I think the
last version was 8.10. It is shareware and good for thirty
days. I seem to remember a keygen around. Contact me by
email (the Yahoo addy is good) if you are interested.

Download here:
http://www.winimage.com/download.htm
--
<Wildman> GNU/Linux user #557453
The cow died so I don't need your bull!
R.Wieser
2020-05-09 16:56:58 UTC
Permalink
T. Ment,
Post by T. Ment
Post by Wildman
I used WinImage to extrace the boot sectors from
the actual discs or images.
What version, and where can I get it?
You are aware that good-old DEBUG.EXE (as provided with DOS 5) is also able
to do it ?

IOW, no need to buy something. What WinImage does there is in no way
special.

Heck, I could imagine that a port of the Linux DD program (freeware) could
do the same (read /and/ write).

Regards,
Rudy Wieser
Wildman
2020-05-09 17:09:59 UTC
Permalink
Post by R.Wieser
T. Ment,
Post by T. Ment
Post by Wildman
I used WinImage to extrace the boot sectors from
the actual discs or images.
What version, and where can I get it?
You are aware that good-old DEBUG.EXE (as provided with DOS 5) is also able
to do it ?
IOW, no need to buy something. What WinImage does there is in no way
special.
Heck, I could imagine that a port of the Linux DD program (freeware) could
do the same (read /and/ write).
Regards,
Rudy Wieser
Yes, dd will.
--
<Wildman> GNU/Linux user #557453
The cow died so I don't need your bull!
T. Ment
2020-05-09 17:21:46 UTC
Permalink
Post by Wildman
Post by R.Wieser
Heck, I could imagine that a port of the Linux DD program (freeware) could
do the same (read /and/ write).
Rudy Wieser
Yes, dd will.
I know. dd is what I used. I asked about Winimage because I like to know
what other tools can do.

Rudy doesn't pay attention. But that's nothing new.
R.Wieser
2020-05-09 17:44:05 UTC
Permalink
T.Ment,
Post by T. Ment
Rudy doesn't pay attention. But that's nothing new.
Thanks, that really friendly of you. But hey, if you have a hobby in
gathering commercial, payed for software than be my guest.

Goodbye.
Wildman
2020-05-09 17:48:16 UTC
Permalink
Post by T. Ment
Post by Wildman
Post by R.Wieser
Heck, I could imagine that a port of the Linux DD program (freeware) could
do the same (read /and/ write).
Rudy Wieser
Yes, dd will.
I know. dd is what I used. I asked about Winimage because I like to know
what other tools can do.
Rudy doesn't pay attention. But that's nothing new.
Yea, WinImage will do a lot more. It can handle just
about every disc format including ISO's. I can mount
an image or ISO for direct access. It will display
the info about the boot sector such as serial, label
and OEM. And of course it can extract and/or insert
a boot sector from/to a floppy or image.

It can read raw images created by other programs, such
as DCF. It can save images in raw format (.IMA) or in
zip compressed form (.IMZ). It you unzip the .IMZ you
will get the .IMA.
--
<Wildman> GNU/Linux user #557453
The cow died so I don't need your bull!
Wildman
2020-05-08 15:24:52 UTC
Permalink
Post by T. Ment
"DOS 5.0" is how DOS 6.22 formats a real floppy disk. It's the OEM field
in sector 0. Any value may work, but I didn't try that.
The OEM field can be anything. It has no effect on the
operation of the floppy. Starting with Win 95 the OEM
field was used to store a unique number that the OS used
to ID the disc. As a vintage software collector, I found
that to be unacceptable. Discovered a registry hack to
stop it. Of course, write protect would also stop it.
--
<Wildman> GNU/Linux user #557453
The cow died so I don't need your bull!
T. Ment
2020-05-08 15:46:02 UTC
Permalink
Post by Wildman
The OEM field can be anything. It has no effect on the
operation of the floppy. Starting with Win 95 the OEM
field was used to store a unique number that the OS used
to ID the disc. As a vintage software collector, I found
that to be unacceptable. Discovered a registry hack to
stop it.
DOS 4.0 already defined a 32-bit binary volume ID at offset 27h. Maybe
they wanted more bits.
Wildman
2020-05-08 16:20:25 UTC
Permalink
Post by T. Ment
Post by Wildman
The OEM field can be anything. It has no effect on the
operation of the floppy. Starting with Win 95 the OEM
field was used to store a unique number that the OS used
to ID the disc. As a vintage software collector, I found
that to be unacceptable. Discovered a registry hack to
stop it.
DOS 4.0 already defined a 32-bit binary volume ID at offset 27h. Maybe
they wanted more bits.
That is the volume serial number. The numbers have
a similar use, to keep track of the disc that was
inserted into the drive, but, the two numbers were
not used together.
--
<Wildman> GNU/Linux user #557453
The cow died so I don't need your bull!
T. Ment
2020-05-08 15:21:38 UTC
Permalink
Post by wolfgang kern
wasn't any pre-formatting to 512 byte sectors required ?
I only have two USB sticks, and my method worked for both. As for USB
Post by wolfgang kern
Most modern disks use Advanced Format.
Advanced Format disks translate each 4,096-byte physical sector into
eight 512-byte logical sectors. To the firmware, operating system, and
all disk utilities, the disk appears to have 512-byte sectors, even
though the underlying physical sector size is 4,096 bytes.
Most USB Mass Storage devices -- especially inexpensive ones, like flash
drives -- will report 512-byte sectors for compatibility reasons. The
actual block size of the underlying flash memory is likely to be much
larger, but is not exposed by the device, so there's no way to detect
it from software.
https://superuser.com/questions/1394193/finding-the-physical-sector-size-of-usb-solid-state-drive-fdisk-stat
JJ
2020-05-08 08:46:51 UTC
Permalink
Post by T. Ment
My 1.44MB floppy drives are old and dying. I have USB, but most tools
format a USB stick like a hard drive, and then it boots as C: or D:. I
I couldn't find a USB format tool for that, so I hacked a floppy boot
sector. With much trial and error I got one working. It defines a 15MB
floppy, just under the FAT12 limit. Sectors per track is still 18, but
heads is now 64. Sectors per cluster is 8 instead of 1. Total sectors
changed from 2880 to 32520. That leaves a few unused clusters for the
limit of FAT12, and you could fiddle with it to max it out, but I was
happy to get one working, and didn't bother.
Below is the method I used to initialize the USB stick sector 0. After
that you still must boot into DOS and format it. It works on some PCs
but not all. If DOS format reports any bad sectors, it didn't work and
you must try a different PC.
Once formatted correctly, it will boot as the A: drive. One PC of mine
required USB-ZIP in the BIOS setup instead of USB-FDD.
??? is the usb stick device name
dd bs=4k count=5000 if=/dev/zero of=/dev/???
dd if=sector0 of=/dev/???
[snip]

BIOS will recognize a floppy media as long as the media type field in the
boot record is one of floppy media types. The file system doesn't matter
because BIOS is file system blind. So, you can have larger disk capacity
than that. e.g. 256MB with FAT16 or larger, as long as the disk geometry is
still within BIOS limit. However, only some file systems are designed for
use with removable disks, and it'll depend on what file systems are
supported by the OS which is to be booted.
James Harris
2020-05-08 10:21:56 UTC
Permalink
Post by JJ
Post by T. Ment
My 1.44MB floppy drives are old and dying. I have USB, but most tools
format a USB stick like a hard drive, and then it boots as C: or D:. I
I couldn't find a USB format tool for that, so I hacked a floppy boot
sector. With much trial and error I got one working. It defines a 15MB
floppy, just under the FAT12 limit. Sectors per track is still 18, but
heads is now 64. Sectors per cluster is 8 instead of 1. Total sectors
changed from 2880 to 32520. That leaves a few unused clusters for the
limit of FAT12, and you could fiddle with it to max it out, but I was
happy to get one working, and didn't bother.
Below is the method I used to initialize the USB stick sector 0. After
that you still must boot into DOS and format it. It works on some PCs
but not all. If DOS format reports any bad sectors, it didn't work and
you must try a different PC.
Once formatted correctly, it will boot as the A: drive. One PC of mine
required USB-ZIP in the BIOS setup instead of USB-FDD.
??? is the usb stick device name
dd bs=4k count=5000 if=/dev/zero of=/dev/???
dd if=sector0 of=/dev/???
[snip]
BIOS will recognize a floppy media as long as the media type field in the
boot record is one of floppy media types. The file system doesn't matter
because BIOS is file system blind.
Isn't the media type field part of the file system?
Post by JJ
So, you can have larger disk capacity
than that. e.g. 256MB with FAT16 or larger, as long as the disk geometry is
still within BIOS limit. However, only some file systems are designed for
use with removable disks, and it'll depend on what file systems are
supported by the OS which is to be booted.
--
James Harris
JJ
2020-05-09 10:40:43 UTC
Permalink
Post by James Harris
Isn't the media type field part of the file system?
Oh, you're right. It is.

Then it depends on the BIOS itself, just like T. Ment have said. How
flexible it can be for handling custom floppy formats.
James Harris
2020-05-09 16:11:18 UTC
Permalink
Post by JJ
Post by James Harris
Isn't the media type field part of the file system?
Oh, you're right. It is.
Then it depends on the BIOS itself, just like T. Ment have said. How
flexible it can be for handling custom floppy formats.
There's a very good (and plausible) write-up on how different BIOSes
responded to the challenge of booting USB flash at

https://wiki.osdev.org/Problems_Booting_From_USB_Flash

See especially the "Old Computers" section.
--
James Harris
T. Ment
2020-05-09 16:51:36 UTC
Permalink
Post by James Harris
There's a very good (and plausible) write-up on how different BIOSes
responded to the challenge of booting USB flash at
https://wiki.osdev.org/Problems_Booting_From_USB_Flash
It may seem "plausible" to you, but just because it's on osdev.org,
doesn't make it good. They say:

The MBR must have a partition table with an active partition
with the boot loader starting in the active partition
(in case the firmware doesn't support "floppy emulation")

As I said earlier, USB-ZIP works on a PC of mine where USB-FDD does not.

As a a floppy, My USB stick has NO partition table. BIOS boots it as
USB-ZIP. Some people claim USB-ZIP needs a partition table, but my PC
proves that false.

Just because people post something on a web site, doesn't make it true.
T. Ment
2020-05-08 12:34:05 UTC
Permalink
Post by JJ
BIOS will recognize a floppy media as long as the media type field in the
boot record is one of floppy media types. The file system doesn't matter
because BIOS is file system blind. So, you can have larger disk capacity
than that. e.g. 256MB with FAT16 or larger, as long as the disk geometry is
still within BIOS limit. However, only some file systems are designed for
use with removable disks, and it'll depend on what file systems are
supported by the OS which is to be booted.
I never got it to boot as an A: drive with FAT16. FAT12 is the only way
it worked. That limits you to about 15MB. My point was to get it booting
as A:, since I have a need for that.

4087 clusters is the cutoff between FAT12 and FAT16. Less than will
format as FAT12, greater than or equal as FAT16. See Duncan's Advanced
MS-DOS programming, page 183.

The cluster count is derived from more than one variable. You can fiddle
with them to see, if you want to max out the FAT12 limit. Mine is just a
little under the limit. It leaves a few unused clusters, but maybe a PC
BIOS has an off-by-one bug. The few wasted clusters don't amount to much
space.
T. Ment
2020-05-08 17:16:53 UTC
Permalink
Post by T. Ment
I never got it to boot as an A: drive with FAT16. FAT12 is the only way
it worked. That limits you to about 15MB. My point was to get it booting
as A:, since I have a need for that.
4087 clusters is the cutoff between FAT12 and FAT16. Less than will
format as FAT12, greater than or equal as FAT16. See Duncan's Advanced
MS-DOS programming, page 183.
Maybe FAT12 could go higher than 15MB if you double the sectors per
cluster, because that would cut the cluster count by half and then you
could double the total sector count and stay within the 4087 cluster
limit.

Though irrelevant for floppies which have no partitions, DOS FDISK uses
partition size to choose partition type. For 16MB or greater it chooses
FAT16, less than 16MB it chooses FAT12. That's why I said FAT12 has a
15MB limit. But if you fiddle with the sector 0 variables, maybe FAT12
could go higher.

But then it may be incompatible with BIOS, and refuse to boot as an A:
drive. Who knows. I don't have time to learn everything. I got something
working, and for now that's where I stop.
T. Ment
2020-05-11 15:37:31 UTC
Permalink
Post by T. Ment
I never got it to boot as an A: drive with FAT16. FAT12 is the only way
it worked.
I tried RMPrepUSB. Their website is nearly useless because of ads, and
they want a donation for an ad-free URL. But I found another web site to
download their tool.

They use FreeDOS to create a FAT16 bootable A: drive. But when I reboot
to DOS 6.22 on my C: drive, I still can't see the USB drive that has
FreeDOS. So it's DOS 6.22 that can't handle a FAT16 A: (or B:) drive.

And I need DOS 6.22. So FAT12 it is.
T. Ment
2020-05-11 06:08:56 UTC
Permalink
Sectors per track is still 18, but heads is now 64.
Sectors per cluster is 8 instead of 1. Total sectors changed
from 2880 to 32520.
27 sectors per track seems to work better. Heads is still 64.

Instead of calculating total sectors by hand, now I set it to 0FFFFh (at
offset 13h). Then reboot into DOS and:

format b: /s

Don't use /u. The invalid 0FFFFh total sector count makes DOS resize the
volume. You get a prompt saying it can't be unformatted. That's what you
want to see.

Different USB sticks get different sizes. Not sure why, maybe firmware
in the stick.
T. Ment
2020-05-11 15:55:10 UTC
Permalink
Post by T. Ment
27 sectors per track seems to work better. Heads is still 64.
ZIP disk geometry is 32 sectors per track. I tried that, but the DOS
6.22 format command fails.

ZIP disk geometry is 64 heads. Other values format OK, but an old Award
BIOS sees garbage in the files when booting.

So for DOS 6.22 and FAT12, 27 sectors and 64 heads are magic numbers.
Loading...