1.  Copy the files "ai.c", "aireg.h", and "aivar.h" into
/usr/sys/sundev (you can make them symbolic links if you wish).

2.  In the file /usr/sys/conf/files.sun3, add the following
entry:

sundev/ai.c			optional ai device-driver

(I added ours right before the entry sundev/ar.c)

3.  In the file /usr/sys/sun/conf.c, add the following block of text	
just before the "struct cdevsw ..." declaration:

#include "ai.h"
#if NAI > 0
extern int aiopen(), aiclose(), aistrategy(), airead(), aiwrite();
extern int aiioctl(), aireset();
#else
#define aiopen		nodev
#define aiclose		nodev
#define aistrategy	nodev
#define airead		nodev
#define aiwrite		nodev
#define aiioctl		nodev
#define aireset		nulldev
#endif

4.  In that same file, add the following block just before the bracket
that closes the cdevsw array declaration:  (it should be apparent
where this will go because the numbers of the cdevsw entries are listed
as comments to the right of each entry.  "ai" is entry # 40 (/*40*/) --
if the last entry in your cdevsw array is NOT 39, then readjust the
ai comment number.  "ai" MUST be 40 or greater, however.  If you have
less than 39 entries in your current cdevsw array, you must fill out to
40 with null entries.  Consult your fun Sun manual for instruction
covering how to do this.  Final caution:  Be sure you are dealing with
the cdevsw array declaration and not the bdevsw declaration (both in
this file))

    {
	aiopen,		aiclose,	airead,		aiwrite, 	/*40*/
	aiioctl,	nodev,		aireset,	0,
	nodev,		0,		0,
    },


   NOTE: If you have other specialized devices on your system, our
   device may be a number higher than 40 (device #40 may already be
   used in your cdevsw array).  If it is NOT 40, then you must
   edit the MAKEDEV.ai script -- the "/etc/mknod" line must have
   the number you used for the ds16 driver in place of the "40".

5.  In the /usr/sys directory, create a new directory for the
new kernel you will build (we call our machine "woof", the
directory I made for new kernels is /usr/sys/WOOF).

6.  Copy the file "ai.h" into that newly-created directory.

7.  In the /usr/sys/conf directory, copy your current configuration
file and call the new one the same name that you gave the directory
you created in step 5 (i.e. "cp GENERIC WOOF").

8. Edit that new file ("WOOF") and add the following
entry at the very end of the file:

device		ai0 at vme24d16 ? csr 0xd06000 priority 2 vector aiintr 0xdb

NOTE:  Check to be sure that the address 0xd00000 is unique in that
file.  This address should also match the address set on the
Ikon interface card (should come from MTU that way).

9.  While in the /usr/sys/conf directory, issue the command
"config <name>"  where <name> is the name of the new configuration
file (and the name of the directory you created in step 5) (i.e.
"config WOOF").  You should see a statement from the
system: "doing a make depend".

10.  Go to the directory you created in step 5 (/usr/sys/WOOF).
Type "make".  This will create a new kernel for you in that
directory -- it will be called "vmunix".  To test it, copy that
kernel to your root directory, giving it a name like "testvmunix".

11.  You can then boot that kernel -- shut the machine down to the
monitor prompt, and type "b testvmunix".  As the machine comes back up,
you should see it attach the ds16 as it runs through the devices.
It will show as a line reading "ai0 at vme24d16 csr 0xd00000 vec 0xdb..."
or something like that.


Before booting the new kernel, it's probably a good idea to make
the entries in /dev for the convertor.  Copy the MAKEDEV.ai
script into /dev, and say "MAKEDEV.ai ai0"

12.  Once you are running the new kernel, compile the play.c
program (normal "cc", no special options needed).
Then type "a.out <soundfile>" and, hopefully, sound will
MAGICALLY APPEAR!  If you don't have the ds16 wired for audio
yet, you should see the buffers fill to about 75%, then the run
light should come on and the buffer lights should start "pumping"
up and down as samples get sent in.  If all goes well, then
you can copy the "testvmunix' to "/vmunix" (you might want to
mv the old /vmunix to /old.vmunix just in case something goes
wrong).  Reboot the system and your off to hours of listening
pleasure...

At this point, you should probably read the "caveats" file
that I will be sending telling you possible troubles
you might have, things that the driver definitely doesn't
do yet, etc.  If you have any problems, questions, etc., call
me (Brad Garton) at (212)280-3825 <work> or (609)448-9214 <home>.

Good Luck!
