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

Installation & Use
------------------
Compile the module for your kernel version:

    make

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.
You can also read the contents of the displayed area using cat or less.

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.

Command-line options
--------------------
console={0|1}        1 specifies that the mono monitor receive console
                     messages. The default is 0. This will only work with
		     kernels later than 2.1.82.
mem=<n>              specifies the amount of video RAM on the card. 8 is the
                     default but there seem to be plenty of 4K cards out there
                     too.

eg:

 insmod mda console=1 mem=4

You can add these options to the load_mda command-line or edit that file
to include them in the OPTIONS variable.

I've left the variable 'console' available even for kernels earlier than 
2.1.80 to allow multi-kernel machines to work without lots of complicated
checking before inserting the module. It gives a warning at compile time but
that's a small price to pay for the extra convenience.

Potential Problems
------------------
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.

The Makefile should automatically determine the kernel version and compile
correctly. It now uses the current kernel sources rather than the stupid mix
of running kernel and available sources that it used to do.

The module will try to detect the amount of memory on the card but I don't
have access to anything other than my own 8K card. If you notice "odd" 
scrolling effects on your monitor then add the mem=4 to the insmod command
line ie:

insmod mda mem=4

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.

Note that a version compiled for kernel 2.0 will not work on 2.1 and a version
compiled for kernel 2.1 will not work on 2.0

Because of fundamental changes in the Linux kernel this release of mda will
not work on kernels before 2.0 without a lot of hacking. If you have a 1.2 
kernel then I recommend you upgrade to 2.0 if possible, or get a copy of
0.9 of this driver from http://www.pandh.demon.co.uk/files/mda-0.9.tar.gz


Using with modprobe and kerneld/kmod
------------------------------------
The mda driver works well with kerneld in Linux 2.0 or kmod in 2.1/2.2,
simply add the line:

alias char-major-31 mda

to the file /etc/modules.conf (or /etc/conf.modules), and the module will
automatically be loaded when required. This assumes you are using the default 
"illegal" major number of 31 for the driver. If you are using a different 
number then change the 31 to whatever number you are using.

If you need to specifiy the console or mem options then put those on a 
seperate line, eg:

options mda console=1 mem=4

If you are using the dynamic major numbers feature (see below) then I'm afraid
you're on  your own. I don't think it can be done (but if you know different...)

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 kmod/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.

Using top
---------
One of my favourite uses for this driver is to run top on the secondary 
monitor.
However top reads from it's input terminal and you can't redirect stdin from
the mda driver and make it work because top expects a real tty there.

My workaround (for which read gross hack) is to use an unused virtual console 
as the input tty for top as follows:

top >/dev/mono 2>/dev/mono </dev/tty8 &

this also has the slight advantage that you can switch to the vc and change the
output from top as you would if it were using the current display.

Other drivers
-------------
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, also I'm not sure how up-to-date it is.

Similarly the GGI project (http://synergy.caltech.edu/~ggi) is targeting 
multiple displays and mono devices are supported. This is very much
alpha-quality software at the moment but may well end up being the holy grail
of multiple monitor support.

---
I like to think I am receptive to suggestions and criticism, 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.

Comments or patches for the mdatools package can be sent to 
bytewurm@rising-systems.de
