First post, by Serious Callers Only
So, i'm trying to make instructions to make it easier for 'normal users' to use dosbox to run windows 95 games in linux (yes yes heretical i know).
Anyway, a major complexity of this process is creating new image files and attaching them to windows as readable. Assume dosbox is patched with the 'small' patches for large hd images without imgmake (which wouldn't solve the fdisk requirement, which is what i really want to get rid of).
It normally requires creating the image (with dd or boschs or something else), then imgmounting it in dosbox 'raw' with the -size parameters (which are hard to get), then run windows (possibly in another drive) or a bootdisk, and fdisk it with or without being vfat (in windows 95), creating the partition and finally rebooting and formatting to see the empty space and drive letter.
Anyway i thought i could use mkfs.fat to remove the need for fdisk and that first windows boot, but i need help to translate the created image properties to a usable 'size' for imgmount.
I'm using it like this - -C to create the file, -F32 to create a fat32 (it might be that this is a different thing and i should always use -F16 even when i want the max 8gb img that patched dosbox supports?), -v for verbose (to get the -size parameters) and the expression at the end is the number of blocks on the image for 50 mb on host (which will be different on usable mb on guest, because the filesystem doesn't use 100% of the file space for free space and the definition of megabyte changed over time from base 2 to base 10, now a 'mb' is 1000 bytes, while before it was 1024):
$ mkfs.vfat -C -F32 -v a.img $(( (50 * 1000) ))
mkfs.fat 4.1 (2017-01-24)
a.img has 64 heads and 32 sectors per track,
hidden sectors 0x0000;
logical sector size is 512,
using 0xf8 media descriptor, with 100000 sectors;
drive number 0x80;
filesystem has 2 32-bit FATs and 1 sector per cluster.
FAT size is 769 sectors, and provides 98430 clusters.
There are 32 reserved sectors.
Volume ID is a3b9dbe6, no volume label.
I'm _pretty sure_ that those properties don't map to imgmount -size parameters without calculation.
'logical sector size is 512' appears to map to 'bytes per sector'
but i believe 'sectors per cylinder', 'heads per cylinder' don't map to '32 sectors per track', '64 heads'
and who knows what 'cylinder count' maps to.
is it hopeless to use mkfs.fat for this and i always have to use boschs or dd, then use the windows fdisk for this? Can you think of any linux alternative that can support the CHS at (1023/255/63) max scheme of the patch and calculate those parameters easily while outputting a formatted ready to use image file?