mda -- Kernel loadable module to drive a secondary MDA monitor

This is my first attempt at hacking the Linux kernel and is necessarily
rather primitive. 

Todd J Derr (tjd@cs.pitt.edu) originally had a dual monitor kernel patch but
this became unusable about 1.1.47 because of fundamental changes in the Linux
console code. 

Advantages of this patch over Todd's:
-------------------------------------
It works with Linux 1.2.x and higher
(Tested on 1.2.5 -> 2.0.0)
The MDA is still visible (and usable) when X-Windows is active
Loadable module rather than kernel patch

Disadvantages:
--------------
No console (keyboard switching) support
Needs more VT100 escape sequence support
Only supports MDA cards (to my knowledge), that's all I have
and probably many more...

Installation & Use
------------------

Compile the module for your kernel version:

    make

The Makefile and source should be able to figure out whether you are using
CONFIG_MODVERSIONS on your kernel or not. If it gets it wrong then just add
-DCONFIG_MODVERSIONS to CFLAGS. 

Create the file in /dev for the monitor and copy the module to its live 
directory. This must be run as root.

    make install

Insert the module into the kernel (at boot time or whenever you want it)

   insmod mda

Any output sent to /dev/mono will appear on the attached monitor.

If you find that major device 31 conflicts with something else you have then
You can either change the number in the Makefile and recompile/install or use
the dynamic allocation described below.

Problems
--------

The module assumes your mono card has 8K of display RAM and uses this to
speed up the scrolling. Some cards, however, only have 4K. If you notice "odd" 
scrolling effects on your monitor then edit the mda.h file line that reads:

#define VIDEOMEM_END 0xB1FFF

to read

#define VIDEOMEM_END 0xB0FFF

I have tried to get the startup code to automatically detect this without
any luck. If anyone knows how it can be accomplished then please let me know.

If you find that insmod can't find mda.o, check that it has actually been 
copied into /lib/modules/misc (by make install). If it has then you probably 
have an old version of the module utilities. I recommend upgrading to the 
latest one suitable for your kernel but in the meantime you can simply add 
the full path to the insmod command.

The module code assumes you have configured kernel sources for your current
kernel available when you compile it. If you find that the compilation fails
to find version.h or anything else in /usr/include/linux then you should 
configure your kernel sources to match the kernel you are currently running.
Please see the documentation in /usr/src/linux/Documentation for more details.


Using with modprobe and kerneld
-------------------------------

The mda driver works well with kerneld in Linux 2.0.x, simply add the line:

alias char-major-31 mda

to the file /etc/conf.modules, and the module will automatically load
when required.


Dynamic major number configuration
----------------------------------

This release supports dynamic major number allocation introduced in Linux
1.3.something which gets around the problem of using the "illegal" major number
of previous releases.

To do this uncomment the line in the Makefile that reads

#define MONO_MAJOR=DYNAMIC

and recompile. If you use this method then you must insert the module using the
script load_mda which will re-create the /dev/mono device file each time to 
match the new major number assigned to the device.

This, relatively new, feature does not work with the automatic loading features
of kerneld (unless you know differently) so you are better off loading the
module at boot time. (it only uses two pages anyway)

Thanks to Alessandro Rubini and Linux Journal for the information on how to
do this.

Other driver
------------

If you need a more full-featured driver for your mono monitor I can recommend
multimon by Zach R Amsden (also available on sunsite & its mirrors in the same
directory you got this from).

Because it is distributed as a kernel patch rather than a module it needs 
patching into the kernel each time.

---
Please mail any comments to me at patrick@pandh.demon.co.uk
Any comments or patches related to the graphics mode are best 
directed to jepler@inetnebr.com.

