These are the linux dual-monitor patches, version 1.1.42 alpha 1, 24 Aug 94.

These patches allow you to simultaneously use both color (EGA or VGA) and
monochrome video cards for VC's.  

NOTE: please see the Configuration section below, since a lot has changed
with this release (47a1).

------------------------------------------------------------------------
Mailing list:

	I run a mailing list through which I announce updates to dualmon
and the like.  If you'd like to be on the list, please send me mail at:

		tjd@neurocog.lrdc.pitt.edu -or- tjd@cs.pitt.edu

and let me know.  I don't distribute patches over the announcement list,
but I do have another list for people who prefer having the patches mailed
to them, so let me know if you are one of them.

------------------------------------------------------------------------
News:
	In 47a1, a lot has changed:  you now need to load a modified
keymap to run dualmon, which will be better in the long run since it
makes things much more flexible.  Please see 'Configuration' below!
Also note the support for VC swapping, see the 'Installation' section.

	As of 42a1, configuration is now moved to a single file, dualmon.h.
A new option is also there to allow hiding the cursor on the non-active
monitor.  See below or in dualmon.h for this.

	Jeff Grills is no longer the maintainer of these patches.  They
are now maintained by myself, Todd J. Derr.  If you need to get in touch
with me about them, email me at:

		tjd@cs.pitt.edu -or- tjd@neurocog.lrdc.pitt.edu

	I'd appreciate it if you browse over the 'To Do' section and
send me comments on what I'm planning to do with these patches.  Also
send me any other feedback/comments/suggestions/problems.

------------------------------------------------------------------------
Installation:

NOTE: the patch is now from the top-level linux directory, since I had
	to change a kernel include file, so make sure you apply the
	patch from there and _not_ in drivers/char!

- If you are working from "clean" kernel sources, use the patchfile
	'dualmon-47a1.patch'.  Probably the least chance of trouble.

- If you are working with sources that you have already applied the 42a1
	and 42a2 patches to, use the patchfile 'dualmon-42a2-47a1.patch',
	which contains only the changes.  If you didn't get or haven't
	applied the 42a2 patch, please apply it first, then this patch.

- The directory 'full_src' contains my versions of the affected kernel
	files.  To use them, follow the instructions in that directory
	and do not apply a patch.  If you do this your kernel _MUST_
	be pl47.  

to patch, cd to your top level linux source directory and apply the patch
using the command: 

	patch -p1 < patchfile

Look for any abnormal output from patch, perhaps try 'find . -name \*rej	-print' to look for any reject files.  If anything goes wrong that you
don't know how to fix, let me know.  I also have some patches against
older kernel versions if you need them.

	There are a few things you can configure in the file dualmon.h.
You may want to look it over, though most of the configuration is now
done dynamically using loadkeys (see 'Configuration' below).  Things
in dualmon.h are:

CONFIG_DUALMON:

If you want to build a kernel without dualmon, comment out the
#ifdef/#define/#endif CONFIG_DUALMON lines.

Alternatively, you may want to let linux's normal configuration
script handle this.  If so, replace the patched Makefile with the
original one, and edit 'config.in' in the top kernel directory.
Add a line to config.in that says:

bool 'Dual monitor (VGA/EGA + mono) support' CONFIG_DUALMON y

The proper place for this is in the 'Character Devices' section,
I put it under the CONFIG_SELECTION line, but it's up to you.  If
you do this, you will have to 'make config' before you make the new
kernel.

If you do move the configuration to config.in, also comment out the
#ifdef/#define/#endif CONFIG_DUALMON lines.


LEFT_ADAPTER and RIGHT_ADAPTER:

No longer there, because they're no longer used.  See 'Configuration' below!

MONO_CONSOLE:

This is the default tty for the mono screen at boot time.  Add 1 for the
real tty number, so the default (7) is tty8.  Change this if you want.


HIDE_NONACTIVE_CURSOR:

If defined, this hides the cursor on the screen that does not have the
input focus.  Handy for knowing which one is active, but comment this
out if you don't like it.


ADAPTER_SWAP:

Best to explain by example.  Say you have VC 1 on the color monitor, and
VC 2 on the mono monitor.  You press the key for Console_Color_2.  This
controls what happens:

AS_SWAP_VCS 	swaps the displays.  VC 2 is now on the color screen, and
		VC 1 is on the mono.  Input focus is VC2.
AS_FOCUSONLY	Input focus becomes VC 2, on the _mono_ monitor.  No
		swapping takes place.  This is the same as 'Console_2'.
AS_NONE		nothing happens, just like it always didn't.


HGC:

Eventually, we'll autodetect Hercules or MDA (hopefully).  For now, if
you have a MDA adapter (the one that doesn't do graphics, only text),
undefine HGC or something unpredictable may happen.


Once you're all set up and ready, make the kernel and install it.  Also
install the 'loadkeys' and 'dumpkeys' programs in the 'kbd-0.87-dualmon'
directory, you're going to need them when you reboot.

------------------------------------------------------------------------
Configuration:

Dual-mon now requires a modified version of the 'kbd' package, and its
own special keymap.  This is a bit of a pain at first, but it's well
worth it since:

	- you can reconfigure things without rebuilding the kernel.
	- you can bind the functions to whatever keys you like.
	- new functionality can be added more easily.
	- no more limit of 12 VC's, you can have 255 if you want.

The modified version of loadkeys recognizes some new key symbols that
you'll need to use to get the most out of dualmon, namely:

Console_Color_1-n and Console_Mono_1-n:
	these symbols specify what dualmon needs to know when you
switch VC's; which one you want and where you want it.  If you use
the normal 'Console_x' symbols, that console is selected on the
monitor on which it was last displayed.

Focus_Color, Focus_Mono, and Focus_Swap:
	these allow you to switch the focus to the Color or Mono screen,
or to swap the focus (i.e. Focus the monitor that isn't), without
having to know the VC # on that monitor.  Handy.

So, install the 'loadkeys' and 'dumpkeys' programs in the 'kbd-0.87-dualmon'
directory, which includes the binaries.  If you want to rebuild from the
sources, get the 'kbd-0.87.tar.gz' file from your favorite ftp site, apply
my patch in the 'src' directory, and rebuild.

Once you have this much working, you'll need to load a keymap.  You should
first load your standard keyboard map (unless you have it installed as the
default), and then load one of the dualmon maps, according to whether you
want the color or mono adapter to be the left alt (the other one is then
obviously the right alt).  

Now, if you prefer to have a complete keymap so you only need to load one,
you can use 'dumpkeys > my_keymap.map'.  You'll probably want to install
this map in the standard place (usually /usr/lib/kbd/keymaps) and load it
at bootup from one of your /etc/rc files.

The default bindings are as follows (in color_left.map, reverse these for
mono_left.map):

Alt   F1-F10: Console_Color_1-10
AltGr F1=F10: Console_Mono_1-10
Alt   Tab:    Focus_Left
AltGr Tab:    Focus_Right
Alt AltGr:    Focus_Swap

Feel free to change the keymap to your liking, that's the whole point of
it.  I personally prefer the Focus C/M operations to be on the spacebar,
but I figured that knocking out Meta_Tab was better than knocking out
Meta_Space.  If you don't ever use Meta_Space, you may want to change
these.  If you _do_ use Meta_Tab, give me a better suggestion.  Meta_Tab
is still accessable as Ctrl-Alt-Tab.

------------------------------------------------------------------------
Using the dualmon patches:

On bootup, you should see a message from the console driver indicating
that the dualmon driver is installed.  If not, go back to 'installation'
and try again.

Basically, the patches modify the action of the ALT keys so that one of
them selects the mono screen and one of them selects the color screen,
although this is determined by a loadable keymap.  You need to load a
keymap (see 'Configuration' above), or you can't do too much.   The
operation of the key symbols is explained there as well.

------------------------------------------------------------------------
To Do:

please send me comments about the ideas below, i'd like as much feedback
as possible about them! 

[keymaps done for 47a1]
[swapping vc's and some ioctl(VT_ACTIVATE) problems fixed for 47a2]

X is a big problem.  I know about it, I've seen it, I'm working on it.
Don't switch VC's if you run X for now.

Autodetection of HGC/MDA/no card at all, and initialization cleanup.

Some problems with scrollback need fixed.

finally, I'm working on generally cleaning things up, resolving the
above issues, and trying to get the patches incorporated into the
main kernel so that I don't have to keep sending out updates.  I've
talked with linus about this and he seems to think it would be OK...
but there's a lot of work to be done and little time for me to do it
before this happens....
------------------------------------------------------------------------

todd j. derr

tjd@cs.pitt.edu
tjd@neurocog.lrdc.pitt.edu
