MTOOLS version 2.0 Mtools is a public domain collection of programs to allow Unix systems to read, write, and manipulate files on an MSDOS filesystem (typically a diskette). The following MSDOS commands are emulated: Mtool MSDOS name equivalent Description ----- ---- ----------- mattrib ATTRIB change MSDOS file attribute flags mcd CD change MSDOS directory mcopy COPY copy MSDOS files to/from Unix mdel DEL/ERASE delete an MSDOS file mdir DIR display an MSDOS directory mformat FORMAT add MSDOS filesystem to a low-level format mlabel LABEL make an MSDOS volume label. mmd MD/MKDIR make an MSDOS subdirectory mrd RD/RMDIR remove an MSDOS subdirectory mread COPY low level read (copy) an MSDOS file to Unix mren REN/RENAME rename an existing MSDOS file mtype TYPE display contents of an MSDOS file mwrite COPY low level write (copy) a Unix file to MSDOS You should be able to just close your eyes and pretend you're on an MSDOS system. Everything should work the same... except for the added 'm' at the beginning of each command. I really wanted to avoid the use of a 'text' mode and a 'data' mode when transferring files, but I couldn't find a better way. It gets rather confusing and it's quite possible to mess up a file if you apply the text mode when it is not appropriate (ie: to a COM or EXE file). The pattern matching routine more closely resembles Unix than MSDOS. For example, "*" matches all MSDOS files in lieu of "*.*". The use of wildcards (or the '\' separator) will require the names to be enclosed in quotes to protect them from the shell. For example: RIGHT: mcopy "a:*.c" . will copy all files on the A: disk with the extension .C to the current Unix directory. WRONG: mcopy a:*.c . will cause the shell to expand a:*.c in the current Unix directory (which is probably not what you wanted) then copy that list of files (if there were any) from A: to the current Unix directory. RIGHT: mcopy *.c a: will copy all files with the extension .c in the current Unix directory to the A: drive. (This time you *want* the shell the expand the *.c). The manuals are very terse... it's assumed that the reader is already familiar with MSDOS. Mcopy is really a front-end to the low level Mread and Mwrite commands. Emmet P. Gray US Army, HQ III Corps & Fort Hood ...!uunet!uiucuxc!fthood!egray Attn: AFZF-DE-ENV fthood!egray@uxc.cso.uiuc.edu Directorate of Engineering & Housing Environmental Management Office Fort Hood, TX 76544-5057
MTOOLS
Version 2.0
Patchlevel 5n
Here are the Mtools for the NeXT. They are actually almost identical
to the distribution of mtools version 2.0, patchlevel 5. The Mtools are a set
commands to directly access DOS formatted files with a command line
interface.
This distribution contains the sources of the programs, and binaries
to access the internal drive on a NeXT slab.
Laurent Amon (amon@cs.stanford.edu)
-lga- 92-07-28
Revised -lga- 95-09-17
<Insert here the usual disclaimer.>
RUNNING THE MTOOLS.
You've ever used a DOS machine? Then you won't have any problem.
Two things to note. The first is that you will get plenty of error messages
on the console, like
Bad disk label magic number
fd: UNABLE TO READ DISK LABEL
This is normal. Ignore them.
The second thing is that when you insert a disk in the drive, the
WorkSpace tries to mount them. To get around this, use the same solution as
whenn you do tar volumes: Type the command and <return>, and insert the disk
only when a window pops us asking you to insert it.
MODIFICATIONS FOR THE NeXT.
- Added a compiler option NeXT to select the NeXT floppy. This is set right
now to the internal drive.
- Modified Makefile to use install, and added the install.suid target.
- Added the files README-NeXT and INSTALL-NeXT.
- Added a file 'eject.c' and its binary, not created nor installed by
Makefile, to be used in case of a SUID installation.
DEVICES.
The binaries are build to access the internal floppy via the
device /dev/rfd0b. To compile them for another device, you have to
modify the file 'devices.c'.
To set it to an internal floppy, you must use /dev/rfd0b.
r: Specifies the character device.
fd: Floppy Drive, need I explain?
0: The number of the device, starting with the first one. Currently '0'
since the NeXT only has one internal drive.
b: Specifies the 'live' device. Accessing rfd0a would write a file system
label on the disk, causing an "device error" if you try to read it
on other workstations.
To set it to an external (SCSI) floppy, you must modify 'devices.c'
and replace the device name by /dev/rsd?h where:
r: Specifies the character device.
sd: SCSI device.
?: The number of the SCSI device corresponding to the floppy. The number are
attributed as follows: '0' for the boot device if it is a SCSI device,
then by ascending order starting with the device of lowest SCSI id.
For example, if you boot on your internal disk of ID 0, and have
the internal disk at ID 1 and the floppy at ID 3, the device to use
will be /dev/rsd2h. In any case, mount a floppy with the WorkSpace,
do a 'df' in a shell to see what device you need.
h: Specifies the 'live' device. This is a 'h' and not a 'b'.
If you have multiple drives, you can create entries in 'devices.c'
for drives A:, B:, etc. Be careful that devices are hard coded in the
binaries. If you shuffle around the SCSI number of your peripherals, you
may end up accessing the wrong device in case of an external floppy.
The present configuration should work for 1.44 Megs and 720 K disks.
I have not tested the 720 K option. I do not know the parameters for a 2.88
Megs disk, so ED DOS diskd are not supported here. I don't even think that
they exist anyway.
MAINTENANCE
I don't maintain this package. Possessors of non-black hardware
should be able to use the vanilla mtools as they don't have the ED floppy.
REVISION
Correction of the README-NeXT and INSTALL-NeXT files, as well as
pf the eject.c program (use execl instead of system).
REFERENCES.
The Mtools can be found in the volume 25 of the archives of
comp.sources.unix.
Additional information about the the NeXT floppy and the devices
are found with 'man fd', as well as in the include file
/usr/include/nextdev/fd_extern.h.
Also, the file 'transferring_data_with_floppy_disks' in the
Winter 1991 Support Bulletin.
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.