                       New Hard Driver (Release 1)
                       ___________________________




       New Hard Driver is an Object-oriented hard disk  driver
       that  is based  upon  a  new  generic  driver  package known
       as Gears SCSI Driver (GSD).  The Gears  SCSI  Driver
       replaces  Apples  Generic Driver  (GDISK).  This  new
       generic driver supports the following features:


       *  Infinite disk capacity (w/Parallel Access)

       The GDISK driver supported  by  Apple  Computer,  Inc.  does
       not provide support for more than one media type in a drive.
       Furthermore,  parameters for more than one disk cannot be
       maintained in memory and attempting to do  so  using GDISK
       is difficult to sometimes impossible.  GSD  supports
       multiple  media  on  one drive.  Furthermore, this media can
       be swapped in an out by the non-generic side of  the device
       driver even while the media is currently mounted.

       *  Removable Media support

       GDISK does not support removal and re-insertion of media in
       a drive.  GSD supplies routines for the non-generic side of
       the  driver  to  support removable media.

       *  Multi-sized Block Support

       The current generic driver only supports 512 byte blocks.
       GSD supports any block size needed.  Furthermore, the
       blocks  sizes  may  change  due  to changes in media type
       (i.e., removable media).

       *  Sophisticated Error Handling

       GDISK does not allow the non-generic side of the device
       driver to override error messages.  Unfortunately, in many
       cases it reports errors that should not be reported.  GSD
       provides  a  much  more  sophisticated   error   handling
       technique that allows the non-generic side of the driver to
       control the error reporting.


       *  Removal of Alternate Bad Blocking

       GDISK was designed at a time when many disks did  not
       support hardware bad blocking.  This lead to an alternate
       bad blocking scheme to be added to GDISK which has  added
       runtime  overhead   to   the   driver.    However,
       spare'ing(hardware bad block mapping) is now standard for
       all SCSI hard drives;  therefore, the alternate bad blocking
       is not required.  GSD  does  not  support  the  alternate
       bad blocking technique.


       *  Read-only support

       Although a patch does exist for CDROM technology,  GDISK
       does not actually support read-only drives.  This is because
       the driver always  attempts to write the DPME (partition
       table) structure on to the drive.  However, this is not
       acceptable to WORM technology.  GSD supports true "hardware
       read-only" as well as "write-once" drives.  Furthermore, GSD
       supports techniques that allow searching  for write protect
       indicators which the GDISK due to its  delayed
       initialization  does  not support.


       *  Multiple Driver Support

       The current version of GDISK is resident in the device
       switch table of A/UX.  Furthermore, this interface does not
       provide a  mechanism  for routing to the correct device
       driver upon determination of a foreign  hardware  type.  GSD
       uses a patching routine to replace the current  interface
       with  an  interface that allows a routing mechanism.  This
       mechanism requests a simple inquiry from  the hardware and
       lets the routing function call the proper  driver.
       Furthermore,  once the driver has been determined the device
       switch table  is  patched  (at  runtime) with the correct
       driver routines.

       *  Re-implementation of the disk sort algorithm

       The current version of GDISK  does  not  correctly  sort
       disk requests on the queue when such requests are DMA
       controlled.   This happens  because  the buffer cylinder
       member variable is filled with the address of  the  DMA
       request  and therefore correct sorting will not happen
       during these requests.   GSD requests requests are broken up
       into a partitions therefore cylinder information is  not
       needed  and just the block number can be specified to the
       sort algorithm.  The sort algorithm is also inline code.


       Some of the features of GSD are not used by the  NHD  driver
       and some  will  be  used  in  future  releases.   However,
       the  most important to CD-ROM owners  is  the  multiple
       block  size.   NEC Drives  do  not support the MODE SELECT
       parameter to change block size.  This is an optional command
       in SCSI so they do not need to support  it.  However, GDISK
       requires the command in order to get the device to a 512
       byte  block.   Since  GSD  does  not  require changing  the
       block size, no MODE SELECT is performed and the end result
       is NEC Drives work.

       Since this is a real product which is sold to development
       shops I have  only included binary only.  If your firm
       requires source or specific drivers please contact me.

       This package contains two modules which will  be  installed
       into your  kernel.   The  first  is  GSD (Gears SCSI
       Driver). GSD is a Object-oriented finite state machine
       library  that  is  used  for building  device  drivers.  The
       second is NHD (New Hard Driver).  NHD is a generic SCSI
       device driver that  was  implemented  using the  GSD
       module.  The two modules are installed and un-installed into
       the kernel via the newunix(1m) command.


       Things that don't work 
       ______________________


       1) HD Setup does not correctly handle non 512 byte/block
       disks.

       HD Setup bypasses the device drivers and uses /dev/scsi.  It
       therefore in calculates the block size incorrectly.

       2) CDROMS may use 512 bytes/block instead of natural

       Many CDROMS come with a MacOS drivers that change the block
       size of the device to 512 bytes/block.  NHD will  handle
       this no problem but you might want that software to  stop
       doing  that for efficiency.  NHD will NOT force the drive
       back to its natural block size.

       3) CDROMS that used Group6 Eject

       NHD doesn't currently support the Group6 Eject command. So if
       your drive only knows how to eject via this command then ejecting
       will have to be done manually.  This will supported in the
       future.


       Unpacking 
       _________

       In order to unpack and  install  the  modules  onto  your
       system execute the following commands as root.

               # cd /

               # cpio -iuv < 'location_of_files'/cpio.data



       Installation 
       ____________

       NHD now follows  standard  conventions  for  inclusion  into
       the kernel.  Therefore, the newconfig works.

               # newconfig nhd gsd

               will install NHD and GSD into the kernel.

               # newconfig nonhd nogsd

               will uninstall them.


       In the above installation all device on  the  SCSI  bus
       will  be controlled  by  the  NHD  driver.   In order for
       this to happen a program called '/etc/nhdpatch' is executed
       in  the  init  script.  This  program patches the kernel so
       that NHD will be used instead of GDISK (Apple's Generic
       Driver).  The reason the patch  program is  executed is to
       replace the routines hdopen, hdclose, etc ....  which were
       hard coded  into  the  kernel  instead  of  using  the
       autoconfig  procedure.  Therefore, the only way to stop them
       from being used is to patch the current unix  by
       substituting  hdopen with nhdopen in the bdevsw and cdevsw
       tables.


       Minimizing Damage 
       _________________

       In order to minimize any potential damage  done  by  the
       drivers (shouldn't be any but just in case :->).

       1) Copy /unix to /unix.sav.  If you are unable to  boot  for
       any reason then restore the /unix.sav in the standalone
       shell.

       2) NHD can be patched for particular scsiids  via  the
       following command

               /etc/nhdpatch unix scsiid

               example

               # /etc/nhdpatch /unix 5

               will patch the /unix for just scsiid 5.

       you may want to change the file /etc/init.d/nhd which  is
       the script that performs the patch.


       How do you know its working 
       ___________________________


       After booting and logining in, look at the A/UX console
       window or cat /dev/oldmsgs.  You should see the following
       two lines.

       NHD copyright 1992 Kristopher L. Tyra, Version: 1.4
             - enabled for ALL scsi ports

       Gears SCSI Driver V2.3 copyright 1991 Kristopher L. Tyra {The Sapphire Group}
	     100 gears available


       Special Thanks 
       ______________

       Special thanks to Apple Computer's Rick Auricchio  for
       supplying me  with  all  the  information  about  changes
       in 3.0.  Also to Michelle Gaskill for supplying A/UX 3.0
       faster than I could blink an  eye.   Apple's  has  proven
       that  they are a company flexible to support even the 
       smallest customer and  after  having consulted  to  some
       of the largest firms in the US I have to say this is most
       refreshing.  Hats off to Apple on this one!


               Let me know how it goes!

               Kristopher L. Tyra
	       ktyra%saphire@concert.net
	       The Sapphire Group
