
                    Using Lredir
                    ============

What is it? Well, its simply a small DOS program that tells the
MFS (Mach File System) code what 'network' drives to redirect.
With this you can 'mount' any Linux directory as a virtual drive
into DOS. In addition to this, Linux as well as multiple dosemu sessions
may simultaneously access the same drives, what you can't when using
partition access.

Now, how do you use it?

First, mount your dos hard disk partition as a Linux subdirectory.
For example, you could create a directory in Linux such as /dos (mkdir
-m 755 /dos) and add a line like

   /dev/hda1       /dos     msdos   umask=022

to your /etc/fstab.  (In this example, the hard disk is mounted read-
only.  You may want to mount it read/write by replacing "022" with
"000" and using the -m 777 option with mkdir).  Now mount /dos.  Now
you can add a line like

  lredir d: linux\fs/dos

to the AUTOEXEC.BAT file in your hdimage (but see the comments 
below).  On a multi-user system you may want to use

  lredir d: linux\fs\${home}

where "home" is the name of an environmental variable that contains
the location of the dos directory (/dos in this example)

However, you may want to have your native DOS partion as C: under dosemu.
To reach this aim you also can use Lredir to turn off the 'virtual'
hdimage and switch on the _real_ drive C: such as this:

Assuming you have a c:\dosemu directory on both drives (the virtual
and the real one) _and_ have mounted your DOS partition as /dosc,
you then should have the following files on the virtual drive:

autoexec.bat:

  lredir z: linux\fs\dosc
  copy c:\dosemu\auto2.bat z:\dosemu\auto2.bat
  lredir del z:
  c:\dosemu\auto2.bat

dosemu\auto2.bat:

  lredir c: linux\fs\dosc
  rem further autoexec stuff

To make the reason clear _why_ the batch file (not necessaryly autoexec.bat)
_must_ be identical:

  Command.com, which interpretes the batchfile keeps a position pointer
  (byte offset) to find the next line within this file. It opens/closes the
  batchfile for _evry_ new batchline it reads from it.
  If the batchfile in which the 'lredir c: ...' happens is on c:, then
  command.com suddenly reads the next line from the batchfile of that
  newly 'redired' drive.  ... you see what is meant?


Other alternatives using Lredir:

To have a redirected drive available at time of config.sys you may
either use emufs.sys such as

   device=c:\emufs.sys /dosc

or make use of the install instruction of config.sys (but not both) such as

   install=c:\lredir.exe c: linux\fs\dosc

The later has the advantage, that you are on your native C: from the
beginning, ... but, as with autoexec.bat, both config.sys must be identical.
 
For information on using 'lredired' drives as a 'user' (having the right
permissions), please look at ./doc/README.runasuser.


Hans, May 12, 1997
