First I want to say that if this floppy disk image is ultimately going to be placed on a CD as a boot image, then it can only be in one of three formats: 1.2M, 1.44M, and 2.88M. An image that is not in one of these three formats can only be placed in the boot area of the CD as a hard disk boot image (by the standard, that hard disk image can only contain one partition, and it must be in the position of the first partition in the MBR).
If you still want to make a 5M floppy disk image, the following method may be useful.
First, you need to have a 1.44M floppy DOS image. Or having a win98 on your hard disk is also fine. In short, you need some way to boot into pure DOS, and you also need Microsoft's FORMAT DOS utility. On your hard disk you need to prepare a 5M file, for example called 5M.IMG, and since we are going to write into it, everything already inside this 5M.img file will be overwritten.
All right, install the latest version of GRUB4DOS on your hard disk, and boot into GRUB.
At the GRUB command line, type in the following reference command(s) (the exact file locations need to be adjusted according to your own setup):
map --sectors-per-track=18 --heads=2 --unsafe-boot (hd0,0)/5m.img (fd1)
If it succeeds, continue with the steps below. If it fails (the failure message says the file is not contiguous), then you need to go back to DOS or WINDOWS and make several copies of 5M.IMG, such as 5M_001.img, 5M_002.img, and so on, then enter GRUB again until the above command executes successfully on one of those 5M.img files.
All right, assuming everything is OK, next do this:
map --mem (hd0,0)/DOS1440K.img (fd0)
map --floppies=2
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
boot
The above step is for booting into DOS. If you have DOS or Win98 on your hard disk, you can also replace it with the following steps:
chainloader (hd0,0)+1
map --floppies=2
rootnoverify (hd0)
boot
Be sure to hold down the ctrl key quickly, so you don't enter win98. You must only enter DOS, because when using map, WIN98 may damage your hard disk!
All right, you've successfully entered DOS. Now you should understand that drive B: is your target floppy, namely 5M.img. Now perform the format operation:
format B:
After formatting is finished, you can copy the files you need into B::
copy MY_FILE B:
All right, reboot the machine and enter DOS or Windows. The contents you just operated on in B: are actually in 5M.img. You have already made your 5M.img file.
As you have seen, without any special tools, as long as you have GRUB4DOS and your usual DOS utility disk, you can very easily make a floppy disk image file of any size.
[ Last edited by tinybit on 2005-11-18 at 23:10 ]