Previous Next Contents

3. Installing MGR

The latest source distribution can be FTPed from the directory ftp://archimedes.nosc.mil/pub/Mgr/69 or Mosaiced from http://archimedes.nosc.mil/Mgr/69. The same should be found at ftp://sunsite.unc.edu/pub/Linux/apps/MGR and its mirrors. Older versions of this distribution from Haardt can be found on tsx-11.mit.edu and perhaps elsewhere. Pre-Linux versions of MGR from Uhler and others have been found at ftp://bellcore.com/pub/mgr, but I think they are gone now. I have saved a copy of everything about MGR seen on the Internet, but I am not aware of anything weighty that is missing from this Linux/Sun distribution. MGR has been through a lot of versions and releases, but the current *Linux* version number is 0.69. This version number could jump to 1.0 when stable 256-color VGA code for Linux appears (for more than one video card type). RCS version numbers have increased from Bellcore's 4.3 up to our 4.13 now.

Required tools to build this distribution of MGR are m4 (GNU, or perhaps another supporting the -D option), make (GNU, or perhaps another supporting include) and *roff for the docs. Also sh, awk, and POSIX install. Binary distributions are not assembled often so you need an ANSI C compiler environment, e.g. gcc.

A Linux installation requires Linux 0.99.10 or better (1.2.13 is what I actually test on now), an HGC, EGA, VGA, or SVGA graphics card, and a mouse. Mouses supported are: serial Microsoft mouse, serial MouseSystems 3 and 5 byte mouse, serial MMSeries mouse, serial Logitech mouse, PS/2 mouse, or a bus mouse. With Buckey (Meta) hot keys enabled, even a mouseless system could do a certain amount of useful work under MGR. The VGA 640x480 monochrome graphics mode is supported out of the box, as is 640x350 and 640x200. To run 800x600, or other modes that your BIOS can initialize and which do not require bank-switching, you need to run a small program (supplied as src/vgamisc/regs.exe) under DOS or an emulator to read the VGA registers and write a header file which you place in the directory src/libbitblit/linux, so that it can be #include'd by the vga.c file there. Samples of these files are supplied, but please create your own. Some VGA cards can use 128k windows, and these might run higher monochrome resolutions.

The Linux-colorport code also runs in the standard 320x200x256 color VGA mode without difficulty, because no bank switching is required. If you think of how few 64000 pixels is, you would realize this color mode is quite limited. Non-fast, but simple, bank-switching code has been added in version 0.65, and it works with a Tseng ET4000 card in 640x480x256 and 800x600x256 modes. The S3 code does not work in super VGA resolutions, yet. Supporting new super VGA cards requires writing one function to switch banks and then making sure that the desired screen mode can be initialized from a register dump, possibly with hand-tweaking. The Linux color servers generally mangle the screen fonts, necessitating use of restorefont as in runx. If someone were to extract the VGA initialization code out of X, this might make MGR work on a lot more color systems.

Suns with SunOS 4.1.2+ and bwtwo, cgthree, or cgsix frame buffers are supported. Their speed handling color is good. Coherent installations should refer to the Versions/README.Coh file in the source distribution. Porting the latest-and-greatest MGR to another POSIX-like system which provides select() and pty's and direct access to a bitmapped frame-buffer ought to be straightforward, just implementing the libbitblit library based on the sunmono or colorport code, say.

If you want to install everything, you need 7 MB disk space for binaries, fonts, manual pages etc. The sources are about 4.5 MB, plus object files during compilation.

Normally, /usr/mgr should be either the directory or a link to the directory where you install MGR stuff for runtime use. Typing

cd /usr/mgr; tar xvfz whereveryouputit/mgrusr-0.69.tgz
and optionally
cd /usr/mgr; tar xvfz wherever/morefonts-0.69.tgz
will unpack these. The source can be put anywhere, e.g. typing
cd /usr/src/local/mgr; tar xvfz wherever/mgrsrc-0.69.tgz
to unpack the sources from archimedes.nosc.mil.

The source tree can be compiled from one top-level Makefile which invokes lower-level Makefiles, all of which "include" a "Configfile" at the top level. The Configfile is created by an interactive sh script named Configure, which asks you questions, then runs m4 on a Configfile.m4. So you type something like this:

chdir /usr/src/local/mgr
sh ./Configure
make first
make depend
make install
make clean

It might be wise, before running make, to eyeball the Configfile generated by the Configure script, checking that it looks reasonable. (At least one m4 poops out (Sun /usr/bin/m4), creating a very short Configfile. If this happens, try hand editing a copy of Configfile.sun or Configfile.lx) One can also make all in any directory with a Makefile as soon as the libraries have been compiled and installed. The server, libraries, and some clients have been linted, but several clients are K&R C code that generates many compiler warnings.

Several flags in MGRFLAGS can be added/omitted in the Configfile to change some optional features in the server, viz:

-DWHO

muck utmp file so "who" works

-DVI

code for clicking the mouse in vi moving the cursor

-DDEBUG

enable debugging output selectable with -d options.

-DFASTMOUSE

XOR the mouse track

-DBUCKEY

for hot-key server commands without mousing

-DPRIORITY

for priority window scheduling instead of round-robin; the active window gets higher priority

-DCUT

for cut/paste between windows and a global snarf buffer

-DMGR_ALIGN

forces window alignment for fast scrolling (monochrome)

-DKILL

kills windows upon tty i/o errors

-DSHRINK

use only some of the screen ($MGRSIZE in environment)

-DNOSTACK

don't permit event stacking

-DBELL

audibly ring the bell

-DKBD

read mgr input from the sun kbd, instead of stdin. This permits redirection of console msgs to a window.

-DFRACCHAR

fractional character movement for proportional fonts

-DXMENU

extended menu stuff (experimental)

-DMOVIE

movie making extension which logs all operations to a file for later replay -- not quite working under Linux

-DEMUMIDMSBUT

Emulate a missing middle mouse button by chording

Not all combinations of these options have been tested on all systems.

The BITBLITFLAGS macro should contain -DBANKED if you're trying out the super VGA color.

C code for the static variables in the server containing icons and fonts is generated by a translator from icon and font files.

Not all the clients are compiled and installed by the Makefiles. Clients found under src/clients having capitalized names or not compiled by the supplied Makefiles may have problems compiling and/or running, but they may be interesting to hack on. Most of the screen drivers found under the libbitblit directory are of mainly archeological interest. Grave robbing can be profitable.

At some point check that your /etc/termcap and/or terminfo file contain entries for MGR terminals such as found in the misc directory. If all your software checks $TERMCAP in the environment, this is not needed, as long as you run eval `set_termcap` in each window.

MGR works better if run setuid root, because it wants to chown ptys and write in the utmp file. This helps the ify iconifier client work better and the event passing mechanism be more secure. On Linux, root permissions are required in order to do in/out on the screen device. Otherwise, you decide whether to trust it.

In versions around 0.62 there are troubles on the Sun with using the csh as the default shell. Programs seem to run in a different process group than the foreground process group of the window's pty, in contradiction to man pages and posix specs. There is no trouble with bash, sh, or rc. Ideas why?


Previous Next Contents