Formatting fat12 floppy image in OS X
Posted: Wed Jan 07, 2015 5:36 pm
I'm trying to get my environment set up for OS X. My coding was all done in Windows before, so now I'm working on getting scripts in order to make a floppy disk image out of my assembled sources.
Part of my little shell script looks like this
This all works fine... Except. It uses what I suspect is HDD like values for the FAT12 BPB.
RDE (root directory size) of 512 instead of standard floppy 224
SPT(sectors per track) 32 instead of standard 18.
HDS(heads) 16 instead of standard 2
Is there something I can do for diskutil to treat this as a floppy and not harddrive? Or any other tips for working with floppy images under OS X?
Part of my little shell script looks like this
Code: Select all
#Format image in MSDOS format and mount it
DISKNAME=`hdiutil attach -nomount bos.img`
diskutil eraseVolume MS-DOS BOS $DISKNAME
So../dev/rdisk1: 2829 sectors in 2829 FAT12 clusters (512 bytes/cluster)
bps=512 spc=1 res=1 nft=2 rde=512 sec=2880 mid=0xf0 spf=9 spt=32 hds=16 hid=0 drv=0x00
RDE (root directory size) of 512 instead of standard floppy 224
SPT(sectors per track) 32 instead of standard 18.
HDS(heads) 16 instead of standard 2
Is there something I can do for diskutil to treat this as a floppy and not harddrive? Or any other tips for working with floppy images under OS X?