I executed the command from your question, which is also shown below.
hdiutil create -size 1440k -fs "MS-DOS FAT12" -layout NONE -srcfolder disk2 -format UDRW -ov diskimage2.ima
A hexadecimal/ASCII dump of the BIOS Parameter Block in the diskimage2.ima.dmg
file shows the following.
hexdump -s 0xb -n 51 -Cv diskimage2.ima.dmg
0000000b 00 02 01 01 00 02 00 02 40 0b f0 09 00 20 00 10 |........@.... ..|
0000001b 00 00 00 00 00 00 00 00 00 00 00 29 fd 0c e6 34 |...........)...4|
0000002b 44 49 53 4b 32 20 20 20 20 20 20 46 41 54 31 32 |DISK2 FAT12|
0000003b 20 20 20
I used VirtualBox to create a formatted floppy stored in the file Windows_3.1_1.img
. A hexadecimal/ASCII dump of the BIOS Parameter Block in the Windows_3.1_1.img
file shows the following.
hexdump -s 0xb -n 51 -Cv Windows_3.1_1.img
0000000b 00 02 01 01 00 02 e0 00 40 0b f0 09 00 12 00 02 |........@.......|
0000001b 00 00 00 00 00 00 00 00 00 00 00 29 16 55 c8 ea |...........).U..|
0000002b 20 20 20 20 20 20 20 20 20 20 20 46 41 54 31 32 | FAT12|
0000003b 20 20 20 | |
0000003e
By comparing the two outputs, the following possible problems were found.
- Maximum number of FAT12 or FAT16 root directory entries at sector offset 0x11. Your value is 512. I was expecting 224.
- Physical sectors per track at offset 0x18. Your value is 32. I was expecting 18.
- Number of heads for disks at sector 0x1a. Your value is 16. I was expecting 2.
An image of a unformatted floppy can be made by using the following command.
dd if=/dev/zero of=myfloppy.img bs=512 count=2880
Either of the following commands below can format the floppy with the label MYFLOPPY
. This format matches the format used by VirtualBox.
newfs_msdos -v MYFLOPPY -f 1440 -b 512 -S 512 -r 1 -F 12 ./myfloppy.img
or just
newfs_msdos -v MYFLOPPY -f 1440 ./myfloppy.img
Note: Both commands will produce the following warning message.
newfs_msdos: warning: ./myfloppy.img is not a character device
ioctl(DKIOCGETPHYSICALBLOCKSIZE) not supported
I would suggest using these commands or VirtualBox to create a floppy image. Attach the image, copy some files to the image, eject and then see if your virtual machine can read the image as a floppy.
References
Design of the FAT file system
Creating bootable FreeDOS DOS floppy diskette IMG file for V86 on OSX
hdiutil create -size 1440k -fs "MS-DOS FAT12" -layout NONE -srcfolder disk2 -format UDRW -ov diskimage2.ima
command, then renameddiskimage2.ima.dmg
todiskimage2.img
. I had no problems reading the floppy from the current release of Windows 10 running in a VirtualBox virtual machine.