Readme for MGR under Coherent 4.0
*********************************

MGR is copyright 1988 Bellcore.  This release is based on the linux port of MGR.
I would like to thank all the people at Bellcore, and all the people who worked
on the linux port, and Vance Petree & Grant Edwards & Udo Munk for their work on
Hercules, and Udo Munk for his work on serial mouse initialization & select, and
Norman Bartek & Hal Snyder at Mark Williams Co. for their help with some bugs &
with Coherent device drivers.  This is not the work of any one person!

This is the combined release of MGR.  The main purpose of this release is to 
coordinate efforts in the development of MGR.  The use of emulation header files
and libraries allows Coherent to virtually use the same source code as the 
general version.

I have tested MGR under VGA 640x200, VGA 640x350, VGA 640x480 and SVGA 800x600.
Several other users have tested it under Hercules.  I hope that it works under 
Trident SVGA1024x768.  I don't have a Trident SVGA card so I can't test that 
mode.  If you successfully (or unsuccessfully!) test that mode, please let me
know!

I have also tested 2-button Microsoft mouses and 3-button Mousesystems mouses.
Even though the Configure script allows you to use bus mouses I don't think
this code will work unless you have a device driver for it.

To use this package, you need Coherent 4.0.1r68 or later, Device Driver Kit 2.0
or later or kernel r72 or later, VGA or SVGA or Hercules graphics, and a serial
mouse.  You also need 3.5MB of disk space for this package without objects and
binaries.  The objects, binaries and man pages will add another 4MB, so you 
should have at least 7.5MB free to install MGR.

Please note that you must use gnu m4 to generate Configfile.  You need gnu m4 
because Coherent's m4 doesn't support the -D option, used in Configure.

Also note that you must use gnu make for these makefiles.  You need gnu make 
because the makefiles use include, which Coherent's make doesn't have.

To create the documentation you need groff, tbl, flex and gawk.

I wrote a program which I put in place of /bin/ln to take care of 'ln -s'.  It
does a copy for a 'ln -s' since it might cross device bounaries.  You can get a 
copy of this program from me or you can change the 'ln -s' commands in the 
Makefiles to 'cp' or 'ln -f'.

To run mgrload you need Randy Wright (rw@rwsys.wimsey.bc.ca)'s mz driver.  You 
can get this driver from him, me or raven (soon).  Follow the instructions for
creating a kernel with mz and creating /dev/memqry.  If you need help creating
a kernel with both bm and mz, email me.

Finally, you need my install program to run some of the 'make install' runs.

You can get all of these gnu programs and install from me.  You should also be 
able to get these from MWC or raven (if they aren't there now, then they will 
be soon).

Here are the basic steps involved in compiling and installing MGR:
******************************************************************

First, you must compile bm (the generic bit-mapped display driver) and link
it into the kernel.  Then you must create /dev/bm.  You can get bm.tar.Z from
raven.alaska.edu (/pub/coherent/incoming/MGR/ or /pub/coherent/sources32/MGR)
or Udo Munk's private machine (contact udo@umunk.GUN.de for details).  Follow
the instructions contained in this archive to create a new kernel with 
graphics.

Run 'Configure' (remember you must use gnu m4).  Obviously, you should choose
Coherent as the operating system.  Chose whatever video card you have.  Then
choose your mouse type; if in doubt, try microsoft.  Don't choose MOVIE unless
you are really adventurous (I haven't even looked at MOVIE yet).  The directory
for MGR should be the directory you are in RIGHT NOW!

Then check Configfile to make sure it matches your system.

Now type 'make first' to create some directories, and then 'make depend'.  If 
you get an error about a missing header file it is probably because a 
dependancy was created incorrectly.  Try typing 'make <header_file>' from the 
directory that caused the error and then do 'make install'.  If you get errors
with header files not created, please send me email.

Type 'make install' from the mgr directory to install the binaries and man 
pages.  This will also build the MGR documentation (if you have groff, etc.).

Now you must create /dev/mouse which is a link to the COM port which contains 
your serial mouse.  My mouse is plugged into COM1 and I am running COM3 in 
polled mode, so I used 'ln /dev/com1l /dev/mouse'.  You need to be root to
execute this command.

Go to src/misc.  'cat termcap>>/etc/termcap' to add the termcap entries for mgr
to /etc/termcap (or edit them in if you like a particular order, etc.).  Then 
type 'tic terminfo' to compile the terminfo entry for mgr.  You need to be root
to alter termcap and you need to be root or bin to run tic.

Now edit /etc/ttys.  Add the entries '0lttyp0' through '0lttyp9' for the 
pseudo-ttys that MGR uses.  You need to be root to edit /etc/ttys.

OK, you have now compiled MGR!  For a simple test, just go to bin/ and type mgr!
If everything was done correctly, then you should see the nifty-neato MGR 
Bellcore copyright screen.  This screen is animated.  If it is working then much
of the graphics stuff has just been tested.  

Press a key to go on.  You should see a 'herringbone' pattern and a mouse 
cursor.  Try moving the mouse.  If that works, try pressing the LEFT mouse 
button.  You should see a menu.  Pick 'new window'.  Now you will see an 
'elastic band' box.  Hold down the left mouse button and 'sweep out' a box the
size of the window that you want.  You should get a window with a shell in it.
Play around for a bit!  If some programs (vi, other screen oriented programs)
do not work properly, it is probably because your window is not 80x24
characters in size.  You can run the program 'shape' with no arguments to set a
window to 80x24 characters in size.

Compile notes:
**************

You can change the default font by changing the DEFAULT_FONT variable in the 
Configfile before building.  You may want to build MGR with the stock default 
font first so you can use the 'loadfont' and 'font' programs to try out all the
fonts before choosing a default one.

If you don't have a Video7 VGA card, try compiling the libbitblit stuff without
that flag.  If you compile without the VIDEO7 flag and MGR does weird things on
the screen, then you probably have a card which is not register compatible with
IBM VGA (like my Video7 card).  If your VGA card does not work properly with
or without the VIDEO7 macro defined, mail me and we will discuss the problem.

Miscellaneous notes:
********************

Don't change the size of MAXSHELL in src/mgr/defs.h to 128.  This causes 
problems for some weird reason.  This is probably a pty bug.  If you have
applications hanging ("ttyoq" in the even field from 'ps -lax') then try 
putting this value to 80 or 1024 and see if the problem goes away.

If you have Hercules then you must create a kernel with my bm bitmapped device
driver *AND* *NO* VIRTUAL CONSOLES.  Using virtual consoles and bm does not 
work due to conflicts between the drivers.  We hope this will be fixed in the
future.

If you create MGR without problems but it crashes upon start and you have r72 
then you probably have a broken assembler.  You can do one of two things.  You 
can get a new assembler from mwcbbs (filename as.GNU3.Z) or you can do a 
workaround: edit each .s file in the src/libbitblit/coherent directory.  Copy
the line before the 'table .long...' line right after itself.  This line will
be 'jmp isdone'.  Thus the file will originally look like:
---
	jmp isdone

table .long...
---
and after you change it:
---
	jmp isdone
	jmp isdone

table .long...
---
The second version works around the alignment problem in the r72 assembler.

Some programs do not work properly unless the screen is exactly or very close 
to 80x24 characters in size.  If you get weird screen cursor positions, etc., 
then you probably have a window that is too small or too big.  Use the 'shape'
program to change the window size.  Make sure your terminal type is set to 
'mgr' and make sure you have updated your termcap and terminfo files.

If you get link conflicts inside libbitblit.a then you probably left both vga.o
and hgc.o in the src/libbitblit/coherent directory when you maked libbitblit.
Remove the one you are not using and it will link just fine.

****

hpmgr compiles but does not work, for some reason.  You could help me out of 
you can figure out why!

In src/clients/misc, the programs 'maze' and 'set_console' should be commented
out of the Makefile.  'maze' won't compile since we don't have sockets and 
'set_console' is no needed under Coherent.

If you can't get MGR compiled or anything else, PLEASE EMAIL ME and I will see 
what I forgot to tell you about...

Please report all problems, bug fixes, etc. to me:

Harry Pulley
hcp@csx.cciw.ca
hcpiv@snowhite.cis.uoguelph.ca
