home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
unix
/
volume11
/
mtools
/
part01
/
Readme
< prev
Wrap
Text File
|
1987-08-27
|
5KB
|
123 lines
MTOOLS v1.2
This is a collection of MSDOS tools to allow you to read and write to
MSDOS formatted diskettes from a Unix based system.
The following MSDOS commands are emulated:
Mtool MSDOS
name equivalent Description
----- ---- -----------
mdel DEL/ERASE delete a MSDOS file
mdir DIR display a MSDOS directory
mmd MD/MKDIR make a MSDOS sub directory
mrd RD/RMDIR remove a MSDOS sub directory
mread COPY read (copy) a MSDOS file to Unix
mren REN/RENAME rename an existing MSDOS file
mtype TYPE display contents of a MSDOS file
mwrite COPY write (copy) a Unix file to MSDOS
* CD change working directory
* by use of the environmental variable MCWD
The formats of IBM PC floppy disk drives are:
bytes per sectors per tracks number total disk introduced
sector track per side of sides capacity size in MSDOS
512 8 40 1 160k 5.25 1.0
512 9 40 1 180k 5.25 1.1
512 8 40 2 320k 5.25 2.0
512 9 40 2 360k 5.25 2.0
512 15 80 2 1.2M 5.25 3.0
512 9 80 2 720k 3.5 3.2
The following are typical Unix device names for the IBM formats:
/dev/rflp 'generic' used first to test the media
/dev/rflp40t8s1s 40 track 8 sector single sided
/dev/rflp40t8s2s 40 track 8 sector double sided
/dev/rflp40t9s1s 40 track 9 sector single sided
/dev/rflp40t9s2s 40 track 9 sector double sided
/dev/rflp80t15s2s 80 track 15 sector double sided
/dev/rflp80t9s2s 3.5 inch 80 track 9 sector double sided
These device names are in the msdos.h file as #defines and must be edited
to match the device names on your system. If your device driver does not
handle all of the formats shown, then you should leave those particular
devices undefined in the msdos.h file.
This program can be easily customized to accept non-standard disk formats.
For example, a popular disk format for Unix machines seems to be 80 track,
double sided, 8 sector. This doesn't conform to any of the IBM standard
formats, but MSDOS 3.30 can be made to format virtually anything using the
DRIVER.SYS parameters in the CONFIG.SYS file. Let's take a hypothetical
case of a brand X Unix machine with a 80 track, double sided, 8 sector
disk drive. You could purchase an external 80 track drive for your IBM
compatible computer and format the drive D: under MSDOS 3.30 with the
following DRIVER.SYS parameters:
DEVICE=DRIVER.SYS /D:2 /T:80 /S:8 /H:2 /F:2
Then, you would edit the init.c file to include the new non-standard
parameters. You might need Norton Utilities, or some other program,
to determine the statistics of the format. Using our example, the
format would have the following parameters:
FAT#1 sectors 1 - 3 fat_len = 3
FAT#2 sectors 4 - 6 dir_start = 4
DIR sectors 7 - 13 dir_len = 7
cluster size is 2 sectors clus_size = 2
there are 633 clusters num_clus = 633
Now, the diskette formated on your PC's external drive can be used in
both your PC and your Unix machine. Obviously, that diskette could not
be used in other IBM compatibles, unless they too had an external 80
track drive. That means that you'd need to copy your data from a normal
40 track diskette to the 80 track diskette prior to moving it to your
Unix machine. Likewise, you'd need to copy the 80 track diskette to a
40 track diskette to be able to move data from the Unix machine to
another PC.
The manuals are very terse... it's assumed that the reader is already
familiar with MSDOS.
The use of the environmental variable MCWD to keep track of the current
working directory is a little awkward, especially since there is no
'change directory' command. Bourne shell users will have to type two
commands to set their working directory, ie:
MCWD=/TMP
export MCWD
Wildcards are only applied to filenames and not to directory names.
For example '/usr/local/*.c' is appropriate, but '/usr/l*/main.c' is not.
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). Likewise,
if you forget to apply the text mode (to a Unix text file) then if the
file is used under MSDOS, it will be missing carriage returns. However,
if you aren't going to use the files on your Unix system (you just
intend to hold the files and then transfer them back to MSDOS later) then
you shouldn't use the text mode during either mread or mwrite. This is
because, the text mode is only useful if the files are gonna be used
under Unix.
Mwrite adds an EOF marker to every file (not just text files). Mread
ignores all EOF markers.
The MSDOS 'copy' command had to be broken down into two separate Unix
commands since the MSDOS device designations (A: or C:) would be
clumsy to implement.
Mtools is also available in versions especially written for Masscomp
computers and the AT&T Unix PC 7300.
Emmet P. Gray US Army, HQ III Corps & Fort Hood
...!ihnp4!uiucuxc!fthood!egray Attn: AFZF-DE-ENV
Directorate of Engineering & Housing
Environmental Management Office
Fort Hood, TX 76544-5057