T. Ment
2020-05-08 03:41:53 UTC
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
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