
				    SHSUFDRV
				    SHSURDRV

			   Copyright 2005 Jason Hood

			     Freeware. Version 1.00


    ===========
    Description
    ===========

    A floppy or hard disk image driver and RAM drive.  SHSUFDRV  works	dir-
    ectly  with  image	files; SHSURDRV copies the image into memory, and/or
    creates a new drive.


    =====
    Usage
    =====

    Run the appropriate program with the name of one or more image files, or
    the  size of one or more RAM drives.  If the images are acceptable, each
    image/drive will be assigned a drive letter.

    -------
    Options
    -------

	/F	specify image file name
	/W	images are writable (SHSUFDRV)
	/D	specify RAM drive parameters (SHSURDRV)
	/R	reserve memory (SHSURDRV)
	/C	control memory usage (SHSURDRV)
	/V	display memory usage
	/U	unload
	/Q	quiet


    /F - File name

    This "option" is required (for SHSUFDRV).  It's complete syntax is:

	[/F[:][?]]filename[,drive]

    where FILENAME is the raw disk image and DRIVE is the  drive  letter  to
    assign  it.  The question mark indicates this image should be ignored if
    it's invalid (rather than refusing to install).  The image is tested for
    validity  by reading a part of it to see if it looks like a normal disk.
    If no drive is specified the first available will  be  used  (note:  the
    drive  letters  assigned to subsequent images will always be higher than
    those assigned to previous images).  SHSUFDRV will leave the file  open,
    so	it  should  not  be moved whilst it is active.	SHSURDRV will accept
    images compressed by gzip.

    /W - Writable

    By default images are not writable, due to problems  I  had  in  getting
    write to actually work.  If you'd like to give it a go, use this option,
    but be warned: image and "host" (the drive the image is  on)  corruption
    may occur.	To test it, use SHSURDRV to make a RAM drive, copy the image
    to that, then use SHSUFDRV on the copy.  If you still want	some  images
    to be read-only, make the file itself read-only.

    /D - RAM Drive

    Create a RAM drive of a specified size.  The complete syntax is:

	[/D[:]][size][Ssectors][Ccluster][Dentries][$[label],][drive]]

    although each entry can be separated by a comma, not just the label, and
    apart from SIZE, the entries can be in any order.

    SIZE is the amount of free space to give the drive.  It can be  suffixed
    with  'K' to use kibibytes (1024 bytes) or 'M' to use mebibytes (1048576
    bytes).  The size will be rounded up to a multiple of the cluster  size.
    If	present,  it  is  not necessary to use "/D" (a parameter that starts
    with a digit will be assumed "/D", otherwise "/F").

    SECTORS specifies the exact number of sectors for the  drive.   If	both
    SIZE  and  SECTORS	are  present,  the  last used will take effect.  The
    default is 4101, which is just under 2MiB (the largest FAT12 drive	with
    a 512-byte cluster).

    CLUSTER is the cluster size to use, in kibibytes.  This value must be a
    power of two (ie. 1, 2, 4, 8, 16, 32 or 64); any other value is rounded
    up to the next, but no higher than 64.  The default is 512 bytes.

    ENTRIES is the number of root directory entries.   This  value  will  be
    rounded up to a multiple of 16.  The default is 64.

    LABEL is the volume label to give the drive.  The default is "SHSURDRV".

    DRIVE is the drive letter to assign.  See /F.

    /R - Reserve memory

    This option will allocate memory before any drives, then release it upon
    exit.   It	is only necessary in order for Windows to start (when drives
    exceed more than 14MiB in total).  The default is 4 (kibibytes).

    /C - Control memory usage

    By default SHSURDRV will automatically relocate itself high.   This  op-
    tion  will	keep it in conventional memory.  Alternatively, if it is al-
    ready loaded high, it will automatically relocate into low memory;	this
    option will then keep it high.

    /V - Memory usage

    When this option is used at install (it's ignored otherwise), a  summary
    of the memory usage is given.  The summary includes:

	Static		code and variables
	Dynamic 	data for each image, plus paragraph rounding
	SDA		swappable data area (to use DOS within DOS)
	Total		overall memory usage
	XMS		kibibytes (1024 bytes) or mebibytes (1048576 bytes)
			of XMS memory allocated

    SDA is used by SHSUFDRV; XMS by SHSURDRV.

    /U - Unload

    Removes the program from the device driver chain,  SHSUFDRV  closes  its
    files,  and frees its memory.  It is possible to load each program mult-
    iple times, in which case only the latest will be removed.

    /Q - Quiet

    Use this option to prevent the display of the sign-on  banner.  If	used
    twice (ie. /QQ), no display will be output at all.


    =====
    DRVON
    =====

    The new drives cannot be formatted, but if you try anyway  FORMAT  (from
    MS-DOS) will disable the drive.  DRVON can be used to enable the drive -
    just run it with the drive letter.	It's very simple, so the letter must
    be the second character (the separating space counts as the first).


    =======
    Windows
    =======

    SHSUFDRV will not work with Win9X; Win3 is fine.

    RAM drives greater than 64MiB will not be accessible after starting Win-
    dows (Win9X denies access; Win3 just stuffs up).

    NT/2K/XP users can use FileDisk (floppy images) or Virtual Floppy Drive/
    Disk Driver (floppy/hard disk images, respectively):

	http://www.acc.umu.se/~bosse/
	http://chitchat.at.infoseek.co.jp/vmware/


    =========
    Exit Code
    =========

	0	Uninstalled, help displayed
	1-32	First drive letter assigned (A: = 1)
	255	Not installed, not uninstalled


    =========
    Compiling
    =========

    I have used NASM 0.98.39.  Due to my heavy use of the NASM preprocessor,
    a  32-bit  version	is required, with about 6MB of free memory (to avoid
    paging).  I think version .36 may compile, but not before that.   Please
    see the MAKEFILE.

    There's no need to tell me about UPX, but feel free to use it yourself.

    Gzip decompression used by SHSURDRV is from a modified zlib 1.2.1.	 The
    compiled  library is supplied, so zlib is not needed, unless you want to
    use a different compiler or upgrade to a new version.  My  modifications
    to	zlib  are  in  the  SHSUCDRD.TXT  patch file (apply with -p1).	It's
    designed for Borland;  other  compilers  may  require  modification  (to
    SHSURDRV, as well).


    =====
    Files
    =====

    The following files are included in the package:

	README.TXT	This file
	SHSUFDRV.EXE	Image file driver (386+)
	SHSURDRV.EXE	Image file in memory driver, RAM drive (386+)
	SHFDRV86.EXE	Image file driver (286+)
	SHRDRV86.EXE	Image file in memory driver, RAM drive (286+)
	DRVON.COM	Enable a drive
	SHSUFDRV.NSM	NASM source code for SHSUFDRV
	SHSURDRV.NSM	NASM source code for SHSURDRV
	DRVON.NSM	NASM source code for DRVON
	NASM.MAC	General purpose NASM macros
	MAKEFILE	(Borland) Makefile
	ZLIBCDRD.LIB	Library used by SHSURDRV to decompress images
	ZLIBCDRD.TXT	Patches to zlib 1.2.1 to generate above


    =======
    Contact
    =======

    mailto:jadoxa@yahoo.com.au
    http://shsufdrv.adoxa.cjb.net/

    Jason Hood
    11 Buckle Street
    North Rockhampton
    Qld 4701
    Australia


    ==========================
    Jason Hood, 30 June, 2005.
