MTOOLS - A Review by Timothy Swenson

Jonathan  Hudson has ported the Unix utility, Mtools, to QDOS.  In
the Unix world, Mtools is a set of utilities that read, write, and
navigate  MS-DOS disks.  With Unix, a single program can be called
by  different names and have different  behavior.  In QDOS this is
not possible, so  the full set  of these utilities  is the program
"mtools".

Mtools is essentually an implementation  of  a  number  of  MS-DOS
commands, such as COPY, DIR,  DEL,  TYPE,  CD,  MD,  RD,  DELTREE,
ATTRIB, etc.  Mtools can handle both DD and HD 3.5" disks.  I have
not tested it, but it should handle 5.25" disks also.

The  mtools_zip file  contains the  Mtools executable,  the Mtools
manual, a  QDOS README  file, and  a number  of Unix  man (manual)
pages  for each of the commands.  The manual covers the all of the
commands.  The man pages are added only for completeness.

Besides  the  Mtools  executable,   a   configuration   file   and
environment variable  are neeed.   This means  that you  must have
environment variables (ENV_BIN) support loaded.

The Mtools  configuration  (mtools_conf)  defines  how  your  disk
drives  are   setup  and  how   you  want  to   use  Mtools.   The
configuration file is a text file and can be created with any text
editor.   The main thing that is  needed in the configuration file
is the definition of your  disk  drives.   You  must  define  what
drives you have, what format they are, and what they are called in
MS-DOS terms.   In my case I  have a single HD  disk drive, so use
the following configuration entries:

     drive a: file="flp1_*d2h" 1.44m
     drive a: file="flp1_*d2d" 720k

The  first line tells mtools  that I am using  FLP1_ as the MS-DOS
drive A:  and that it is  an HD (1.44 MB)  drive.  The second line
says that the same drive can also be a DD (720K) drive.  The items
"flp1_*d2h" and "flp1_*d2d" come  directly  from  the  ToolKit  II
manual and are  the direct  sector reading  devices.  This  is how
Mtools  knows the  read the  disk drive.   If you  only have  1 DD
drive,  then you would  use only the  second line.  If  you have a
second disk  drive then you would just  add lines with "drive b:".
For ED disks, I believe the device needed is "flp1_*d2e" and it is
only 2.88 Meg.  MS-DOS did not support the ED drives at 3.2 Meg.

Once  I  had a configuration file created, I needed to tell Mtools
where to find it.  I used the SETENV command like this:

     SETENV "MTOOLS_RC=ram1_mtools_conf"

Since I only have one disk drive, I have to keep all my QDOS files
on  RAM1_, FLP1_ is used  as the MS-DOS disk.   You would use what
ever device you are using  for  your  QDOS  files  (FLP2_,  WIN1_,
etc.).

The  next thing I needed to do is to set the DATA_USE and PROG_USE
devices to  the device I am using  for QDOS files (RAM1_).  Mtools
has  a problem using QDOS device names, so it is better not to use
them and let DATA_USE / PROG_USE handle them.

Now I put an MS-DOS disk in the drive and execute Mtools:

     exec mtools;"-c mdir a:"

Because  of how Mtools was written and how QDOS is, Mtools must be
given a "-c"  argument and then  the command to  run.  Mtools also
puts a 'm'  before each standard  MS-DOS command name.   What I am
doing is "DIR A:" in MS-DOS terms.  Once Mtools executes, a window
pops up  and after  a bit  of reading  the disk,  a MS-DOS-looking
directory  of the disk  appears, including any  directories on the
disk.

To copy a file from MS-DOS to QDOS Mtools is executed like this:

    exec mtools;"-c mcopy a:file.ext file_ext"

I am telling Mtools to copy  the  file  "a:file.ext"  to  my  QDOS
device  (set by DATA_USE) as the name file_ext.  Mtools recognizes
the "a:" as an MS-DOS device and knows where to get the file.

Copying a file from QDOS to MS-DOS would go something like this:

     exec mtools;"-c mcopy file_ext a:"

Mtools knows to convert  the _  in file_ext  to a  standard MS-DOS
period.  Now if I had run Mtools like this:

     exec mtools;"-c mcopy ram1_file_ext a:"

then  a file called "ram1_file.ext" would  have been copied to the
MS-DOS disk.   Remember, Mtools does  not know how  to handle QDOS
device names.  This is why I set DATA_USE to RAM1_.

Mtools supports  the newer  MS-DOS file  systems that  allow lower
case  and longer file names, now used  by Win95 and NT.  Any files
copied to MS-DOS in all caps will remain in all caps.

Because of  a problem with C68, Mtools  has a problem handling the
MS-DOS device/file seperator back slash  (\).   In  my  testing  I
tried to create a directory TEST.  I used the Mtools command:

     exec mtools;"-c mmd a:\test"

Mtools seemed to translate the  \t  into  the  Tab  character  and
wanted  to create a subdirectory "a:     est".  To get around this
problem you have  to use two  back slashes (\\).   So this command
would work:

     exec mtools;"-c mmd a:\\test"

Mtools  also supports the  standard Unix seperator  slash (/).  So
this will also work:

     exec mtools;"-c mmd a:/test"

Mtools supports the following commands:

Mattrib - Used to change MS-DOS file attribute flags.

Mbadblocks -  Scan an MS-DOS floppy and  mark unused bad blocks as
bad.

Mcd - Change directory.

Mcopy - Copy a file.

Mdel - Delete a file.

Mdeltree - Delete a whole directory tree.

Mdir - Directory of an MS-DOS disk.

Mformat - Format an MS-DOS disk.

Minfo - Print paramaters of MS-DOS file system.

Mlabel - Label disk.

Mmd - Create a subdirectory.

Mmove - Move a file (Rename).

Mrd - Delete a directory.

Mren - Delete a file.

Mtype - Copy a file to the screen.

Xcopy - Copy a directory tree to another.


I  did have one problem  with Mtools that Jonathan  and I have not
sorted  out.  Mtools seemed  to have problems  formating MS-DOS DD
disks  on a HD drive.  It formatted the HD disks just fine.  Since
I only have the one disk drive, I can't rule out my drive as being
the problem.

I have also noticed  that NT  seems to  have a  problem formatting
720K disks also.   I formatted  a 720K  disk on  an NT  machine at
work, brought it home and tried to read it.  Mtools failed to read
it, anong with another MS-DOS disk reading utility I've been using
for years.  I doubt an old MS-DOS 3.3 system would also be able to
read the disk.

Mtools  is a fairly powerful set of utilties.  All of the commands
and the configuration file  have a  lot more  options that  I have
discussed.  At first it  may seem  a bit  overwhelming to  have to
many configuration options, but the simple configuration file like
the  one listed above should suit most uses.  The manual is fairly
thick  but it is very thorough and  between it and the QDOS README
file,  most of  your question  should be  answered.  I  wrote this
article in  such a  way that  it can  be used  as a  "quick start"
document and get you up and running.

Mtools  may not be for everyone and most who use it will only need
to  use just a few of the commands  (DIR & COPY), but I am finding
it very handy.   Now that  720K disks  are going  out of  style, I
needed a  way to read HD  disks on my QL.   Mtools fills this need
very well.

Mtools can be  found from  most QL  Freeware sources,  includes QL
BBS's, and on Jonathan's Web page.


    Source: geocities.com/svenqhj