[DOSEMU Logo]
DOSEMU.org

| Home | | Developer Releases | | Stable Releases | | Documentation |

Home
README  - 0.97.10
Technical README
HOWTO
DANG
EMUfailure
Misc
Next Previous Contents

6. Using Lredir

This section of the document by Hans, <lermen@fgan.de>. Last updated on June 16, 1997.

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.

6.1 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 every 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?

6.2 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' (ie having the right permissions), please look at ./doc/README.runasuser.


Next Previous Contents
 
The DOSEMU team