Jump to content











Photo

Buidling/modifying floppy images with mtools (as replacement for WinImage/Imdisk/...)


  • Please log in to reply
36 replies to this topic

#1 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 22 April 2011 - 11:02 AM

Mtools compiled for Windows (small patch applied to avoid crashing of mcopy when doing recursive copies):
http://ubcdcreator.s...-crash-patch.7z

 

Update: mtools 4.0.18 for Windows can now be found in the download section:

http://reboot.pro/fi...ile/267-mtools/


Mtools 4.0.17 compiled for Windows
http://ubcdcreator.s...4.0.17-win32.7z

Mtools manual page:
http://www.gnu.org/s...ual/mtools.html

Tutorial: Editing a 2880 kb floppy image of UBCD (FDUBCD FreeDOS image):
http://www.ultimateb...php?f=13&t=4077

That tutorial makes use of the more advanced parts of mtools than what is shown below.
mtools can replace the "need" for WinImage in many cases, when working with floppy images.

Easy example:

For example, it could be used to make easily make a F6 floppy image with WinVBlock or Firadisk.

For the WinVBlock working on Windows 7 tutorial, you need to make a F6 floppy image
http://reboot.pro/13738/

 

 

Contents of your WinVBlock F6 floppy:

* WinVBlk.cat
* WinVBlk.exe
* WinVBlk.Inf
* WVBlk32.sys
* sc.exe
* txtsetup.oem

Create and format a empty 1440 kb floppy image file with mformat:

 

 

 

mformat -C -f 1440 -v WINVBLOCK -i WinVBlock.img ::

If you already have an 1440k empty floppy image file, you won't need the "-C" switch:

 

 

mformat -f 1440 -v WINVBLOCK -i WinVBlock.img ::

Now we can copy the wanted files to the image with mcopy:

 

 

mcopy -i WinVBlock.img WinVBlk.cat WinVBlk.exe WinVBlk.Inf WVBlk32.sys sc.exe txtsetup.oem ::

Done :happy_dance2:


  • Sha0 likes this

#2 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 22 April 2011 - 04:28 PM

Very interesting! Posted Image

If you use -C in the format command then you don't need to use QEMU to create a raw file. e.g.

mformat -f 1440 -v STEVE -C -i c:\test.ima ::


will create the file in one go.

mformat does seem to create a very strange LBA0 (1st sector) though. It is FAT12 but has a partition table (but no reserved sectors). I guess this helps it to be more compatible as it is both an MBR and a PBR!






[Sector 0]  0MB

0000 EB 3C 90 4D 54 4F 4F 34 - 30 31 36 00 02 01 01 00  ë<MTOO4 016.....

0010 02 E0 00 40 0B F0 09 00 - 12 00 02 00 00 00 00 00  .à.@.ð.. .......

0020 00 00 00 00 00 00 29 D6 - 39 00 00 53 54 45 56 45  ......)Ö 9..STEVE

0030 20 20 20 20 20 20 46 41 - 54 31 32 20 20 20 FA 31        FA T12   ú1

0040 C0 8E D8 8E C0 FC B9 00 - 01 BE 00 7C BF 00 80 F3  ÀŽØŽÀü¹. .¾.|¿.€ó

0050 A5 EA 56 00 00 08 B8 01 - 02 BB 00 7C BA 80 00 B9  ¥êV...¸. .».|º€.¹

0060 01 00 CD 13 72 05 EA 00 - 7C 00 00 CD 19 00 00 00  ..Ír.ê. |..Í...

0070 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00  ........ ........

0080 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00  ........ ........

0090 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00  ........ ........

00A0 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00  ........ ........

00B0 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00  ........ ........

00C0 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00  ........ ........

00D0 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00  ........ ........

00E0 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00  ........ ........

00F0 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00  ........ ........

0100 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00  ........ ........

0110 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00  ........ ........

0120 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00  ........ ........

0130 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00  ........ ........

0140 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00  ........ ........

0150 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00  ........ ........

0160 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00  ........ ........

0170 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00  ........ ........

0180 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00  ........ ........

0190 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00  ........ ........

01A0 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00  ........ ........

01B0 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 80 00  ........ ......€.

01C0 01 00 01 01 12 4F 00 00 - 00 00 40 0B 00 00 00 00  ....O.. ..@.....

01D0 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00  ........ ........

01E0 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00  ........ ........

01F0 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 55 AA  ........ ......Uª



========= END OF SECTOR DATA ================





Partition 1   SIZE=1.406MiB   Type: 01 12-bit FAT  *ACTIVE*

START POS   = CYL:0 HD:0 SEC:1  END POS = CYL:79 HD:1 SEC:18

START (LBA) = 0 (00000000)      SIZE (LBA) = 2,880 (00000B40)



#3 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 22 April 2011 - 05:01 PM

Just for the record, you don't really *need* Winimage (Shareware) to do most of these things, there is (still from Gilles Vollant) the Freeware Extract:
http://www.winimage.com/extract.htm
Additionally we do have a couple of handy tools by Bart Lagerwej (based on the Winimage library)
http://www.nu2.nu/bfi/
http://www.nu2.nu/mkbt/

and the MTOOLS here:
http://www.frontiern...~fys/mtools.htm
that include the IMGINIT (and IMGCPY)programs:

Imginit.exe is a tool by Alexia Frounze (http://alexfru.narod.ru/) that will make
three types of disk images.

C:\>imginit -fat12 testfat.img boot12.img
Will make a FAT12 1.44meg floppy image using boot12.img as the boot sector.
Omit boot12.img and it will create one for you.

C:\>imginit -fat32 testfat.img
Will make a FAT32 hard drive image.

C:\>imginit -fat1x testfat.img
This one is the most detailed. It will create multiple partitions, and
multiple extended partitions. It will create 5 total FAT12/16 partitions
with two extended partitions.

All partitions are formatted to FAT12/16/32 and are empty. Use the included
tool (imgcpy) to copy files to the image. (see .zip file)


Some examples given here:
http://www.msfn.org/...te/page__st__79

Of course using Ken Kato's VFD driver is the most straightforward way, and we also have IMDISK ....

:)
Wonko

#4 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 22 April 2011 - 05:03 PM

The rename below does not quite produce what I expected... ??





C:\SOURCES\mtools>mdir -/ -i c:\sources\testss.ima ::

 Volume in drive : is STEVE

 Volume Serial Number is 0000-39D6

Directory for ::/



minfo    exe    254579 2011-04-22  17:02  minfo.exe

        1 file              254 579 bytes

                          1 202 688 bytes free





C:\SOURCES\mtools>mmove minfo.exe minfo1.exe -i c:\SOURCES\testss.ima ::

Long file name "minfo.exe" already exists.

a)utorename A)utorename-all r)ename R)ename-all

s)kip S)kip-all q)uit (aArRsSq): q





#5 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 22 April 2011 - 05:23 PM

@ steve6375
Thanks for the "-C" switch option. I used it in the past, but forgot about it.
(Changed first post)

You can also use mtools to manipulate FAT partitions inside an image

You can also supply an offset within the image file by including @@offset into the file name.

Example:

mcopy -i my-image-file.bin@@1M ::file1 ::file2 .
This looks for the image at the offset of 1M in the file, rather than at its beginning.

For example for a small HD image that I made a while back.
Partition 1 starts at sector 63 (= offset 32256):
$ mdir -i cmdcons-extracted-hdd.img@@32256 ::

 Volume in drive : has no label

 Volume Serial Number is 0000-714D

Directory for ::/



cmldr           261936 2009-12-28  19:45  cmldr

ntdetect com     47564 2009-12-28  19:45  ntdetect.com

syslinux cfg       364 2010-03-14  21:18  syslinux.cfg

chain_g  c32     17188 2010-01-25   1:50  chain_g.c32

cmdcons      <DIR>     2009-12-28  19:45  cmdcons

grldr           220921 2010-01-05  19:52  grldr

menu     c32     54708 2010-01-05  20:16  menu.c32

menu     lst       451 2010-03-11   1:53  menu.lst

chain    c32     15272 2010-03-14  21:19  chain.c32

        9 files             618 404 bytes

                          1 120 256 bytes free
Here is the list of most of the tools provided by mtools.
(I removed some tools for which I know for sure that they won't work on Windows):
mattrib	  	change MS-DOS file attribute flags

mbadblocks	tests a floppy disk, and marks the bad blocks in the FAT

mcat	  	same as cat. Only useful with floppyd.

mcd	  	change MS-DOS directory

mclasserase	erase memory card

mcopy	  	copy MS-DOS files to/from Unix

mdel	  	delete an MS-DOS file

mdeltree	recursively delete an MS-DOS directory

mdir	  	display an MS-DOS directory

mdu	  	list space occupied by directory and its contents

mformat	  	add an MS-DOS file system to a low-level formatted floppy disk

minfo	  	get information about an MS-DOS file system.

mlabel	  	make an MS-DOS volume label

mkmanifest	makes a list of short name equivalents

mmd	  	make an MS-DOS subdirectory

mpartition	create an MS-DOS as a partition

mrd	  	remove an MS-DOS subdirectory

mmove	  	move or rename an MS-DOS file or subdirectory

mren	  	rename an existing MS-DOS file

mshortname	shows the short name of a file

mshowfat	shows the FAT map of a file

mtoolstest	tests and displays the configuration

mtype	  	display contents of an MS-DOS file

mzip	  	zip disk specific commands


#6 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 22 April 2011 - 05:24 PM

Is there an easy way to create a bootable floppy FAT12 image file (1.44 and 2.88) which has the MSDOS (IO.SYS) or FreeDos (Kernel.sys) boot code in it without having to get hold of or make a bin file first?

i.e just a simple command like

mkfddimg -1.44 -MSDOS c:\newfdd.ima
or
mkfddimg -2.88 -FreeDos c:\newfdd.ima

#7 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 22 April 2011 - 05:36 PM

Is there an easy way to create a bootable floppy FAT12 image file (1.44 and 2.88) which has the MSDOS (IO.SYS) or FreeDos (Kernel.sys) boot code in it without having to get hold of or make a bin file first?

See my tutorial at the UBCD forums.

You will need the FreeDOS base ISO (or a FreeDOS floppy image with sys.com).
qemu -boot d -cdrom fdbasecd.iso -fda your_floppy.img


FreeDOS sys.com
Usage:                                                                          

SYS [source] drive: [bootsect] [{option}]                                       

  source   = A:,B:,C:\DOS\,etc., or current directory if not given              

  drive    = A,B,etc.                                                           

  bootsect = name of 512-byte boot sector file image for drive:                 

             to write to *instead* of real boot sector                          

  {option} is one or more of the following:                                     

  /BOTH    : write to *both* the real boot sector and the image file            

  /BOOTONLY: do *not* copy kernel / shell, only update boot sector or image     

  /UPDATE  : copy kernel and update boot sector (do *not* copy shell)           

  /OEM     : indicates boot sector, filenames, and load segment to use          

             /OEM:FD use FreeDOS compatible settings                            

             /OEM:EDR use Enhanced DR DOS 7+ compatible settings                

             /OEM:DR use DR DOS 7+ compatible settings                          

             /OEM:PC use PC-DOS compatible settings                             

             /OEM:MS use MS-DOS compatible settings                             

             /OEM:W9x use MS Win9x DOS compatible settings                      

             default is /OEM[:AUTO], select DOS based on existing files         

  /K name  : name of kernel to use in boot sector instead of KERNEL.SYS         

  /L segm  : hex load segment to use in boot sector instead of 60               

  /B btdrv : hex BIOS # of boot drive set in bs, 0=A:, 80=1st hd,...            

  /FORCEDRV: force use of drive # set in bs instead of BIOS boot value          

  /NOBAKBS : skips copying boot sector to backup bs, FAT32 only else ignored    

SYS CONFIG /help
This will install the boot sector code for MS-DOS. I guess, that it doesn't require that IO.SYS is the first entry in the root table (not tried):
sys B: /BOOTONLY /OEM:MS
mformat can also get the boot code from another file and install it in the new image:
-B   Use the boot sector stored in the given file or device, instead of using its own. Only the geometry fields are updated to match the target disks parameters.


#8 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 22 April 2011 - 05:42 PM

Is there an easy way to create a bootable floppy FAT12 image file (1.44 and 2.88) which has the MSDOS (IO.SYS) or FreeDos (Kernel.sys) boot code in it without having to get hold of or make a bin file first?

Under XP/2003 :cheers::
http://www.911cd.net...showtopic=16745

Of course you cannot have a "make MSDOS floppy image tool" as you would need the actual MS-DOS system files (which are NOT freeware/redistributable, though largely available on the internet)

About FreeDOS, it is of course redistributable, and it could be possible to "embed" the needed files in an executable, but again, there are many downloadable floppy images with it, that it seems to me like an unneeded complication.

This will install the boot sector code for MS-DOS. I guess, that it doesn't require that IO.SYS is the first entry in the root table (not tried):

sys B: /BOOTONLY /OEM:MS

That was a requirement of MS-DOS up to 6.22, it was not needed anymore for later versions, but cannot say which version of the bootsector the FreeDOS SYS uses. :)

Bootpart can put the MSDOS.SYS :cheers: IO.SYS as first file, but cannot say if it can work on floppy :unsure:.

:cheers:
Wonko

#9 wendy

wendy

    Frequent Member

  • Lady
  • 290 posts
  • Location:one mile from the QR main line
  • Interests:Operating systems, Weights and Measures, Geometry
  •  
    Australia

Posted 23 April 2011 - 10:34 AM

I use regina rexx, and bfi to make the diskettes, and vfd, to modify them.

This rexx code reads a diskette image, and creates a boot disk, eg

bootsect.rex msdos622.ima -> creates msdos622.bs

You could add rex to the CMDEXT variable, and associate rex with regina.exe. This allows you to type rexx scripts without extention. Note that 4nt does the same thing with set .rex=regina.exe.


/* REXX boot sector*/

parse arg disk

parse var disk file &#39;.&#39; ext  ; bs = file&#39;.bs&#39;

call stream disk, &#39;c&#39;, &#39;open read&#39;

  bootsect = charin(disk, 1, 512)

call stream disk, &#39;c&#39;, &#39;close&#39;

call stream bs, &#39;c&#39;, &#39;open write replace&#39;

  call charout bs, bootsect

call stream bs, &#39;c&#39;,  &#39;close&#39;


Once ye have a library of boot sectors, the next step is to use a wrapper around bfi to make the diskette.

The boot images are stashed away in some out-of-use directory, you can maker/ver images to this as ye go, eg

z-dos32.bs ZDOS image.

You need to activate the maker in the code.

/* Boot Diskette maker */

/* configure this to where your apps live */

diskdrv = &#39;l:\save&#39;

diskdir = diskdrv || &#39;\cdata\bootsect&#39;

bootmkr = diskdrv || &#39;\mswin\exe\bfi.exe&#39;

opk = diskdrv || &#39;\mswin\apps\opk&#39;



parse arg dosver file directory

parse upper var dosver 1 dos 6 ver

select

   when dos = &#39;DRDOS&#39; & ver = &#39;341&#39; then dos1 = &#39;drbios.sys&#39;

   when dos = &#39;DRDOS&#39; then do; dos1 = &#39;ibmbio.com&#39;; dos2 = &#39;ibmdos.com&#39;; end

   when dos = &#39;MSDOS&#39; then do; dos1 = &#39;io.sys&#39;; dos2 = &#39;msdos.sys&#39; ; end

   when dos = &#39;PCDOS&#39; then do; dos1 = &#39;ibmbio.com&#39;; dos2 = &#39;ibmdos.com&#39;; end

   when dos = &#39;LZDOS&#39; then do; dos1 = &#39;io.sys&#39;; dos2 = &#39;msdos.sys&#39; ; end

   when dos = &#39;NODOS&#39; then do; dos1 = &#39;&#39; ; dos2 = &#39;&#39;; dosver = &#39;nodos502&#39;; end

   when dos = &#39;GSDOS&#39; then do; dos1 = &#39;dos.sys&#39; ; end

   when dos = &#39;WINNT&#39; then do; call ntboot ; exit; end

   when dos = &#39;/?&#39; then do; call ttyhelp; exit; end

   when dos = &#39;-?&#39; then do; call ttyhelp; exit; end

   otherwise;

     say dos ver &#39;not known.&#39;

     end

pwd = directory()

dos1 = upper(dos1); dos2=upper(dos2)



parse var directory bdir . ; bdir = pwd&#39;\&#39;bdir

cmdline = &#39;chcase.exe -aur&#39; directory&#39;\*&#39;

say cmdline

cmdline

cmdline = bootmkr &#39;-f=&#39;file

if dos1 \= "" then cmdline = cmdline &#39;-o=&#39;dos1

if dos2 \= "" then cmdline = cmdline &#39;-o=&#39;dos2

cmdline = cmdline &#39;-b=&#39;diskdir&#39;\&#39;dosver&#39;.bs&#39; directory

say cmdline

cmdline

exit



ntboot: ; /* Make a bootable ISO with oscd */

parse var directory label directory

if directory = &#39;&#39;  then

     do ; directory = label; label = upper(&#39;WINNT&#39; || ver) ; end

cmdline = opk&#39;\oscdimg.exe&#39;

bootsect = opk&#39;\etfsboot.com&#39;

runme = cmdline &#39;-b&#39;bootsect  &#39;-g -j1 -o -l&#39;label directory  file

say runme

runme

return





ttyhelp:

call lineout, &#39;DOSDISK makes dos diskettes based on a command line&#39;

call lineout, &#39;&#39;

call lineout, &#39;   dosdisk makerVER file directory&#39;

call lineout, &#39;     maker = DRDOS, MSDOS, PCDOS, LZDOS, GSDOS, NODOS&#39;

call lineout, &#39;     ver = 3 digit, eg 710&#39;

call lineout, &#39;     file = output disk, eg dos7.ima&#39;

call lineout, &#39;     directory = root directory of diskette&#39;

call lineout, &#39;   eg  dosdisk PCDOS710 bootdisk dosdisk&#39;

call lineout, &#39;     maker = WINNT makes a bootable iso using OSCDIMG&#39;

call lineout, &#39;     dosdisk WINNT510 [label] directory&#39;

return


The NT code is normally out of use. We use it to make dos diskettes.

eg dosdisk.rex MSDOS622 msdos622.ima (root of image)
dosdisk.rex /? just prints help


You then use vfd to modify the stuff.

vfd open msdos622.ima

You can use extract from http://www.winimage.com/extract (i rename it to extract2, since extract is a cab-unpacker, or you could use some sort of image writer to write diskettes from vfd to floppy.

I use dirtouch to make the thing look nice.

#10 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 26 April 2011 - 02:51 PM

Patched version uploaded (first post changed).

Mtools compiled for Windows (small patch applied to avoid crashing of mcopy when doing recursive copies):
http://ubcdcreator.s...-crash-patch.7z

#11 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 26 April 2011 - 02:53 PM

is the bug in post #4 above fixed?

#12 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 26 April 2011 - 03:04 PM

is the bug in post #4 above fixed?

I don't think it is a bug, but a wrong command line.

Try this instead:
mmove -i c:\SOURCES\testss.ima ::minfo.exe ::minfo1.exe
:: means drive specified by the -i filename switch.
This command will move minfo.exe inside the image to minfo1.exe inside the image.

#13 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 26 April 2011 - 06:18 PM

I don't think it is a bug, but a wrong command line.

Try this instead:

mmove -i c:\SOURCES\testss.ima ::minfo.exe ::minfo1.exe
:: means drive specified by the -i filename switch.
This command will move minfo.exe inside the image to minfo1.exe inside the image.


Yep - my bad!Posted Image Thanks!

#14 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 20 July 2011 - 06:33 PM

Out of curiosity, the NEEDED double ":" at the end of the command line of MFORMAT (when the -C -i <image> syntax is used) can be avoided (at least in the Win32 port)?

It looks to me "innatural" :cheerleader:

In any case the fact that without :: to end the command line the command doesn't work should be a bit highlighted, IMHO :cheerleader:.

:cheerleader:
Wonko

#15 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 31 August 2011 - 04:04 PM

Mtools 4.0.17 compiled for Windows
http://ubcdcreator.s...4.0.17-win32.7z

#16 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 24 November 2011 - 09:24 AM

FAT Image Generator might be useful too:
This program can be used to work with FAT12 floppy images.

Usage: fat_imgen -c [-F] -f IMG-FILE [-i FILE [-n FILENAME]] [-s FILE]

  or:  fat_imgen -m -f IMG-FILE -s FILE

  or:  fat_imgen -m -f IMG-FILE -i FILE [-n FILENAME]

  or:  fat_imgen -m -f IMG-FILE -i FILE [-n FILENAME] -s FILE

  or:  fat_imgen -e [-F] -f IMG-FILE

  or:  fat_imgen -e [-F] -f IMG-FILE [-o FILE] -x FILE

  or:  fat_imgen -b [-F] [-o FILE]



Main operation mode:

  -c                      Create an image.

  -m                      Modify an image.

  -e                      Extract files from an image.

  -b                      Create a standard FAT12 boot sector.

                          (Without -o, defaults to `bootsect.bin'.)



File selection:

  -f IMG-FILE             Use IMG-FILE as the image file.

  -s FILE                 Use FILE as boot sector in the image.

  -i FILE                 Insert FILE into the image.

  -n FILENAME             Use FILENAME as the filename of the inserted file.

  -x FILE                 Extract FILE from the image.

  -o FILE                 Write output to FILE.



Generic modifiers:

  -F                      Overwrite the output file (e.g. image, boot sector).



Informative output:

  --help                  Display this information.

  --version               Display version information.
http://www.assembla.com/wiki/show/slipstream/FAT_Image_Generator

#17 blackvision

blackvision
  • Members
  • 1 posts
  •  
    Italy

Posted 04 March 2012 - 11:36 PM

Another excellent replacement of WinImage is Simplified VFD + OmniFlop

VFD adds a virtual floppy drive, that can fully replace the real one.
OmniFlop can read/write/format almost any existing floppy format.

Both are free software.

Edited by blackvision, 04 March 2012 - 11:39 PM.


#18 TheHive

TheHive

    Platinum Member

  • .script developer
  • 4199 posts

Posted 05 March 2012 - 08:25 AM

Another excellent replacement of WinImage is Simplified VFD + OmniFlop

VFD adds a virtual floppy drive, that can fully replace the real one.
OmniFlop can read/write/format almost any existing floppy format.

Both are free software.

Had not heard of those tools. :good:

#19 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 12 January 2013 - 10:03 PM

mtools 4.0.18 for Windows can now be found in the download section:

http://reboot.pro/fi...ile/267-mtools/


  • Brito likes this

#20 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 09 July 2015 - 10:23 AM

A few observations, should by any chance Icecube have time to look into the matter.

 

More than a bug, seemingly an omission.

I could not find a way to set with mformat the value of byte @0x24, Disk Number, typically this is 0x00 (Floppy) or 0x80 (Hard disk partition/volume).

Not a real issue as it can be post-patched easily and anyway I don't think the value is commonly used.

 

When NOT using a pre-made external PBR code, the OEM field (8 bytes @0x03) is (arbitrarily and seemingly in an undocumented way) set to MTOO4018 which seems to make little sense, I could understand if it was set (say) to MTOOLS but "version specific"? :dubbio:

 

When using the -v (volume label) switch the label is written BOTH to the PBR and to the ROOT directory, which replicates what the "DOS"

format <drive:> /V:<label>

does, see also:

http://www.msfn.org/...at-b-and-label/

The NT family of OS's DOES NOT write the label in the PBR (and the label in it remains "NO NAME").

The Mformat however uses (like NT) the 0x08 attribute for the label in ROOT (unlike DOS that uses 0x28).

So, the end result when using the -v switch is a "mixed mode" between DOS and NT, again nothing to actually worry about, still as is the tool fails to reproduce exactly the one or the other OS behaviour.

 

As Steve6375 previously pointed out when NOT using a pre-made external PBR code the Mformat writes a few bytes of code and then creates a partition table where (arbitrarily) the first partition is set as active.

 

If you provide a "known" format (like Steve6375 used the -f 1440) the partition table entry will be populated by the valid CHS and LBA values for "self", i.e. 

01B0 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 80 00  ........ ......€.
01C0 01 00 01 01 12 4F 00 00 - 00 00 40 0B 00 00 00 00  ....O.. ..@.....
01D0 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00  ........ ........
01E0 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00  ........ ........
01F0 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 55 AA  ........ ......Uª

which may well have some usefulness as dual MBR/PBR :) but using a "custom" set of parameters, what I got was:

01B0 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 80 00  ........ ......€.
01C0 01 00 01 00 00 00 00 00 - 00 00 00 00 00 00 00 00  ........ ........
01D0 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00  ........ ........
01E0 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00  ........ ........
01F0 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 55 AA  ........ ......Uª

which makes no sense. :(

 

:duff:

Wonko



#21 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 10 July 2015 - 12:34 PM

Probably the best thing to do is to contact the developer of mtools:

  https://lists.gnu.or...nfo/info-mtools

 

Here are related problems:

  http://lists.gnu.org...06/threads.html

 

I am not sure if mtools still has a maintainer.



#22 davidm71

davidm71
  • Members
  • 5 posts
  •  
    United States

Posted 10 March 2018 - 09:31 PM

Mtools compiled for Windows (small patch applied to avoid crashing of mcopy when doing recursive copies):
http://ubcdcreator.s...-crash-patch.7z

 

Update: mtools 4.0.18 for Windows can now be found in the download section:

http://reboot.pro/fi...ile/267-mtools/

Mtools 4.0.17 compiled for Windows
http://ubcdcreator.s...4.0.17-win32.7z

Mtools manual page:
http://www.gnu.org/s...ual/mtools.html

Tutorial: Editing a 2880 kb floppy image of UBCD (FDUBCD FreeDOS image):
http://www.ultimateb...php?f=13&t=4077

That tutorial makes use of the more advanced parts of mtools than what is shown below.
mtools can replace the "need" for WinImage in many cases, when working with floppy images.

Easy example:

For example, it could be used to make easily make a F6 floppy image with WinVBlock or Firadisk.

For the WinVBlock working on Windows 7 tutorial, you need to make a F6 floppy image
http://reboot.pro/13738/

 

 

Create and format a empty 1440 kb floppy image file with mformat:

mformat -C -f 1440 -v WINVBLOCK -i WinVBlock.img ::

If you already have an 1440k empty floppy image file, you won't need the "-C" switch:

mformat -f 1440 -v WINVBLOCK -i WinVBlock.img ::

Now we can copy the wanted files to the image with mcopy:

mcopy -i WinVBlock.img WinVBlk.cat WinVBlk.exe WinVBlk.Inf WVBlk32.sys sc.exe txtsetup.oem ::

Done :happy_dance2:

 

 

Anyone have a copy of the MTools for Windows port? Non of the links work anymore..

 

Thank you



#23 maro

maro

    Newbie

  • Members
  • 13 posts
  •  
    New Zealand

Posted 10 March 2018 - 10:44 PM

I just checked and it seems that:

    http://reboot.pro/fi...oad/267-mtools/

is still working. I got my copy of "mtools for Windows" by ckicking on that fat, green 'Download' button on:

    http://reboot.pro/fi...ile/267-mtools/


Edited by maro, 10 March 2018 - 10:45 PM.


#24 davidm71

davidm71
  • Members
  • 5 posts
  •  
    United States

Posted 10 March 2018 - 11:09 PM

Thanks Maro! I didn't know why I couldn't find it before. Thanks!



#25 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 11 March 2018 - 05:18 AM

Just in case (since the topic has been revived) and before I forget, in a completely unrelated topic, a few little batches making use of the various options (as reference) were posted, starting from around here:

 

http://reboot.pro/to...keiso/?p=205455

 

:duff:

Wonko






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users