INTRODUCTION

mtalk is a small, simple multi-user chat program.  It consists of a
daemon, mtalkd, which sits in memory and receives and sends data using
kernel message passing to user processes which have invoked the client
program and user interface, mtalk.  As the code stands at this release,
the daemon takes up only 15K or so of memory, as does each user process.
I've tested it with three simultaneous users, and it produced no significant
drop in processing speed on my machine (a 286 laptop).


MAKING mtalk

Before running make and compiling the programs, you must edit the header
file mtalk.h to reflect your system's configuration.  Of special importance
are the #defines DAEMON_PATH and CLIENT_PATH.  These must contain the
full pathnames of the daemon and client executables once they are compiled.
If either program can't find these two files when you run it, it will
crash immediately.  Other defines you may want to change are MAX_USERS,
the maximum number of users allowed on the system at any given time (I
would not recommend setting this above 30, but who has 30 users at a time
on Coherent anyway?) and MAX_MESSAGE, which is the maximum length of a
public message.  Care should be taken in changing MAX_MESSAGE, because
if it is too big it may exceed Coherent's maximum message size and crash
the system.


INSTALLING AND RUNNING mtalk

Assuming you have successfully compiled mtalk and mtalkd and put them in
the directories specified in DAEMON_PATH and CLIENT_PATH, you have two
options for installing the mtalk daemon: installing it for one session,
or installing it permanently.  Before you do either, however, I recommend
that you set mtalkd's owner to root and chmod it to 500 (read and execute
for owner only) to prevent users from running duplicate copies (which would
really mess things up).  mtalk, of course, should be chmod'd to 755, so
everyone can execute it.  That done, here are the two methods of installation:

1) For one session only.  mtalk uses the inter-process message passing
   system calls, which are implemented under Coherent as a device driver.
   Therefore you, as the superuser, need to load the device driver and
   then execute the daemon as a background process.  To do this, log in
   as root and type:

     /etc/drvld -r /drv/msg
     mtalkd&

   This will start the daemon as a background process, which will stay
   in the system until you kill it or shut the system down.  Although
   it will still technically be associated with the console (or whatever
   device you were using when you executed it); however, mtalkd takes
   steps to dissociate itself from its terminal and will not shut down
   if you log out or type the interrupt character.  It can only be killed
   with the kill command, by the SIGTERM signal (i.e. just kill <pid> to
   kill it).  NEVER kill mtalkd with a SIGQUIT signal, because it will
   be forced to exit without cleaning up message queues and will make a
   mess of the message system.

2) Permanently.  To install mtalkd permanently, so that it is automatically
   loaded in the background whenever you boot Coherent, you must change
   two files in the etc directory (as root).  First, add the following line
   to the file drvld.all:

     /etc/drvld -r /drv/msg

   Then, add a line to rc, in the section that invokes the cron and update
   daemons, invoking mtalkd as a daemon (i.e. executing it in the back-
   ground).  Then shut down and reboot the system.

Once you've done either of these, users can use mtalk by executing the
mtalk program.  See the mtalk man page for details about commands.


NOTES

I wrote this program as an exercise to learn to use the message passing
functions.  When I was done, I saw that I had a small and simple chat
program that others might find useful.  The code is well commented and
should be easily extensible; feel free to make modifications and
distribute them; just be sure and let me know (and send me a copy!).
If anyone has comments, questions, or bug reports, please e-mail me at
kimmel@umvlsi.ecs.umass.edu

Enjoy!

-Matt
