<sect1 id="CDROM">
<title>Using CDROMS</title>

<sect2>
<title>The built-in driver</title>

<para>
This documents the cdrom extension rucker@astro.uni-bonn.de has
written for Dosemu.
</para>

<para>
An easy way to access files on a CDROM is to mount it in Linux and use
Lredir to refer to it. However, any low-level access, often used by
games is impossible that way, unless you use the C option.
For that you need to load some drivers in DOS. CDROM image files (ISOs)
can be used in a similar fashion.
</para>

<para>
The driver consists of a server on the Linux side
(src/dosext/drivers/cdrom.c, accessed via int 0xe6 handle 0x40) and a
device driver (src/commands/cdrom.S) on the DOS side.
</para>

<para>
Please send any suggestions and bug reports to <ulink
url="mailto:rucker@astro.uni-bonn.de"
>&#60;rucker@astro.uni-bonn.de&#62;</ulink
>
</para>

<para>
To install it:

<itemizedlist>
<listitem>

<para>
 Create a (symbolic) link /dev/cdrom to the device file of your drive
or use the cdrom statement in dosemu.conf to define it.
</para>
</listitem>
<listitem>

<para>
 Make sure that you have read/write access to the device file of your
drive, otherwise you won't be able to use the cdrom under Dosemu
directly because of security reasons.
</para>
</listitem>
<listitem>
<para>
 Load cdrom.sys within your config.sys file with e.g.:
</para>

<para>

<screen>
    devicehigh=d:\dosemu\cdrom.sys
</screen>

</para>
</listitem>
<listitem>
<para>
Mount the CD-ROM in Linux (some distributions do this automatically), and
use
</para>

<screen>
    lredir e: linux\fs/media/cdrom c
</screen>

<para>
to access the CD-ROM as drive E:. The "C" option specifies that the
low-level access provided via cdrom.sys is used. Or ...
start Microsoft cdrom extension as follows:
</para>

<para>

<screen>
    mscdex /d:mscd0001 /l:driveletter
</screen>
or
<screen>
    shsucdex /d:mscd0001 /l:driveletter
</screen>

</para>
</listitem>

</itemizedlist>

</para>

<para>
To change the cd while Dosemu is running, use the DOS program 'eject.com'.
If is not possible to change the disk, when the drive has been opened by
another process (e.g. mounted), then you need to unmount it first!
</para>

<para>
Lredir has the advantage of supporting long file names, and not using
any DOS memory, whereas MS/SHSUCDX are more low-level and perhaps more
compatible. You would need to use a DOS TSR driver such as DOSLFN to
use long file names with SHSUCDX.
</para>

<para>
Remarks by zimmerma@rz.fht-esslingen.de:
</para>

<para>
This driver has been successfully tested with Linux' SCSI CDROMS by the
author, with the Mitsumi driver mcd.c and with the Aztech/Orchid/Okano/Wearnes-
CDROM driver aztcd.c by me. With the latter CDROM-drives changing the CD-ROM 
is not recognized correctly by the drive under all circumstances and is 
therefore disabled. So eject.com will not work.
For other CD-ROM drives you may enable this feature by setting the variable
'eject_allowed = 1' in file dosemu/drivers/cdrom.c (you'll find it near the 
top of the file). With the mcd.c and aztcd.c Linux drivers this may cause your
system to hang for some 30 seconds (or even indefinitely), so don't change the
default value 'eject_allowed = 0'.
</para>

<para>
Support for up to 4 drives:
</para>

<para>
If you have more then one cdrom, you can use the cdrom statement
in dosemu.conf like this:

<screen>
  $_cdrom = "/dev/cdrom /dev/cdrom2 image.iso"
</screen>

and have multiple instancies of the DOS driver:

<screen>
  device=cdrom.sys
  device=cdrom.sys 2
  device=cdrom.sys 3
</screen>

</para>

<para>
The one and only parameter to the device driver is a digit between 1 and 4,
(if its missing then 1 is assumed)
for the DOS devices MSCD0001, MSCD0002 ... MSCD0004 respectively. You then
also need to use lredir or tell MSCDEX about these drivers such as

<screen>   
    lredir e: linux\fs/media/cdrom c
    lredir f: linux\fs/media/cdrom2 c 2
    lredir g: linux\fs/media/cdrom3 c 3
</screen>
where you need to loop-mount the image file, or
<screen>   
    mscdex /d:mscd0001 /d:mscd0002 /l:driveletter
</screen>


In this case the /l: argument defines the driveletter of the first /d:,
the others will get assigned successive driveletters.
</para>

<para>
History:
</para>

<para>
Release with dosemu.0.60.0
Karsten Rucker (rucker@astro.uni-bonn.de)
April 1995       
</para>

<para>
Additional remarks for mcd.c and aztcd.c
Werner Zimmermann (zimmerma@rz.fht-esslingen.de)
May 30, 1995
</para>

<para>
Release with dosemu-0.99.5
Manuel Villegas Marin (manolo@espanet.com)
Support for up to 4 drives
December 4, 1998
</para>

</sect2>

</sect1>

