.key isofilename/a,unitnum/k
.def unitnum "2"
.bra {
.ket }

; Creates CD-ROM file system entry for Dillon's fmsdisk.device
; Modified fmsdisk.device 1.1 (CAS 7/93) will look for
; ENV:FMSUnit<n> where n is digit of the unit and will read the
; ENV variable for the full path to the disk image file.
; If ENV variable is not found, falls back to old method:
; ISO image must be named Unitn where n is digit of the Unit below
; (for example Unit2) and the ISO image file must reside at FMS:
; (an asignment)
;
; This file enables the CD-ROM file system which allows you to read standard
; ISO-9660 CD-ROM disks from an Amiga with a SCSI controller.
;
; The "Unit" line defines the SCSI address of the CD-ROM drive. Drives
; often come configured as unit 2, which is the default. Check the
; documentation for your CD-ROM drive to find the exact SCSI address.
; Note that most drives let you change this number using jumpers.

if not exists {isofilename}
   echo "isomount: File *"{isofilename}*" not found... Aborting"
   quit
endif

echo  >t:isomountlist{unitnum} "ISO{unitnum}:"
echo >>t:isomountlist{unitnum} "FileSystem	= L:CDFileSystem"
echo >>t:isomountlist{unitnum} "Device		= fmsdisk.device"
echo >>t:isomountlist{unitnum} "Unit		= {unitnum}"
echo >>t:isomountlist{unitnum} "Flags		= 0"
echo >>t:isomountlist{unitnum} "Surfaces	= 1"
echo >>t:isomountlist{unitnum} "SectorsPerTrack	= 1"
echo >>t:isomountlist{unitnum} "SectorSize	= 2048"
echo >>t:isomountlist{unitnum} "Mask		= 0x7ffffffe"
echo >>t:isomountlist{unitnum} "MaxTransfer	= 0x100000"
echo >>t:isomountlist{unitnum} "Reserved	= 0"
echo >>t:isomountlist{unitnum} "Interleave	= 0"
echo >>t:isomountlist{unitnum} "LowCyl		= 0"
echo >>t:isomountlist{unitnum} "HighCyl		= 0"
echo >>t:isomountlist{unitnum} "Buffers		= 5"
echo >>t:isomountlist{unitnum} "BufMemType	= 0"
echo >>t:isomountlist{unitnum} "StackSize	= 1000"
echo >>t:isomountlist{unitnum} "Priority	= 10"
echo >>t:isomountlist{unitnum} "GlobVec		= -1"
echo >>t:isomountlist{unitnum} "DosType		= 0x43443031"
echo >>t:isomountlist{unitnum} "Mount		= 1"
echo >>t:isomountlist{unitnum} "#"

setenv FMSUnit{unitnum} "`which {isofilename} NORES`"
echo "Mounting `getenv FMSUnit{unitnum}` as ISO{unitnum}:"
mount ISO{unitnum}: from t:isomountlist{unitnum}
