Xsun multi-screen server Kaleb S. Keithley kaleb@x.org The R5 Xsun Multi-screen server is a general purpose replacement for MIT's server/ddx/sun layer. The major features are: o Supports up to three of the same type of frame buffers. o Provides a consistent interface to the frame buffers and fixes a number of bugs. o Eliminates SunView support. o Integrated keyboard support written by Martin Forssen, current with his set of patches dated 14 March, 1993. o Single source for both SunOS 4.x.x and 5.x. ============================================================================= Things to know and miscellaneous notes: XDEVICE environment variable. Xsun will look here first to get the device(s) to try; examples: (SunOS 4.x.x/Solaris 1.x) 'setenv XDEVICE /dev/cgtwo0:/dev/cgtwo1' 'setenv XDEVICE /dev/cgthree0:/dev/cgsix0' 'setenv XDEVICE /dev/cgsix0:/dev/cgthree0' (SunOS 5.x/Solaris 2.x) 'setenv XDEVICE /dev/fbs/cgtwo0:/dev/fbs/cgtwo1' 'setenv XDEVICE /dev/fbs/cgthree0:/dev/fbs/cgsix0' 'setenv XDEVICE /dev/fbs/cgsix0:/dev/fbs/cgthree0' -dev command line argument. Xsun will look here second, and override XDEVICE specified devices, to get the device(s) to try; examples: (SunOS 4.x.x/Solaris 1.x) 'Xsun -dev /dev/cgtwo0:/dev/cgtwo1' 'Xsun -dev /dev/cgthree0:/dev/cgsix0' 'Xsun -dev /dev/cgsix0:/dev/cgthree0' (SunOS 5.x/Solaris 2.x) 'Xsun -dev /dev/fbs/cgtwo0:/dev/fbs/cgtwo1' 'Xsun -dev /dev/fbs/cgthree0:/dev/fbs/cgsix0' 'Xsun -dev /dev/fbs/cgsix0:/dev/fbs/cgthree0' Fallback list. If neither of the two methods listed above are employed, Xsun will resort to a fallback list of devices to try. The list is: cgtwo0, cgtwo1, cgtwo2, cgthree0, cgthree1, cgthree2, cgsix0, cgsix1, cgsix2, cgfour0, bwtwo0, bwtwo1. cgfour note: Some Suns are equipped with a mono frame buffer on the mother board. All cgfours have an implicit mono frame buffer. /dev/bwtwo0, I believe will find the mother board frame buffer rather than the cgfour mono plane. In the absence of a real bwtwo, /dev/bwtwo0 will find the cgfour mono plane. If you experience strange behaviour, e.g. you have a cgfour and the cursor appears to go off the side of the screen, override the fallback list with either XDEVICE or -dev, e.g. 'Xsun -dev /dev/cgfour' Likely ways of having a bwtwo are: real bwtwo frame buffer in a slot, real bwtwo frame buffer on the mother board (3/60 only), or the cgfour emulates a bwtwo. Real problems arise when you have both a cgfour and another bwtwo. What happens is that the real bwtwo is assigned to /dev/bwtwo0, but this server expects /dev/bwtwo0 to be the mono plane of the cgfour, when there is one. The consequences are, that dragging the pointer off the edge of the screen causes the cgfour code to enable the mono plane; that's okay when the /dev/bwtwo0 is using the cgfour mono plane, but not okay when it's some other bwtwo, especially if that other bwtwo isn't hooked up to a monitor. As there is no way to tell from software whether a given bwtwo is real or emulated, it poses real problems with trying to automagically set up the server to handle all the available hardware correctly. Possible work arounds are: 1) specify the device list with either -dev or XDEVICE. 2) specify -zaphod 3) ensure that /dev/bwtwo0 uses the cgfour: 'cd /dev;mv bwtwo0 bwtwo1;MAKEDEV bwtwo0' is alleged to work. Sun 386i notes: Even though a Sun 386i cannot have multiple screens, the multi-screen server source contains conditional compilation for building on Sun 386 boxes. The conditional eliminates support for devices that will never be found on a Sun 386 and therefore produces a smaller binary than might otherwise be created. Suns' 386 compiler has a severe bug and will not generate correct code for mi/miscrinit.c, and cfb/cfbteblt8.c. You may overcome this flaw by compiling all the server code, or just these two files with gcc. I have used gcc-1.xx with success. Bug fixes for .../mit/server/ddx/mi: There is a bug in ddx/mi with regard to tracking the pointer across multiple screens. This apparently seems to only be a problem on machines where there is no hardware cursor support. This is true of all the "supported" Sun frame buffers. Three files are supplied to fix the bug. If you don't want to install the three ddx/mi files, the multi-screen feature will still work, but you're apt to get some strange behavior if you warp the pointer from screen to screen. Building with gcc on Solaris 2.x: If you are using the Cygnus gcc-2.1 from Sun's Catalyst CD-ROM, don't even bother trying to build X or the server. It doesn't work. Ftp the binaries from prep.ai.mit.edu:/pub/gnu/sparc-sun-solaris2/gcc-2.x.x.- tar.gz. Get the sources while you're there -- you'll need them too. Install the binaries -- they tar extract in /opt. Tar extract the sources somewhere, and do the following: 'cd ' './configure -prefix=/opt/gnu sparc-sun-solaris2' 'make install-fixincludes GCC_FOR_TARGET=gcc GCC_PARTS= GCC_PASSES=' The above steps are absolutely mandatory or the server won't build! New constype: The new constype probes for all the devices that Xsun supports, and reports any that it finds. Old kbd_mode: Included for completeness. kbdtype: From Martin Forssen's sunkbd.patch Extra keymaps: "You can tune a piano, but you can't tuna fish." Joe Walsh. If you want to tune the server you can remove support for unwanted keyboard layouts in sunKeyMap.c. By default there is support for 35 different layouts and every layout occupies approx 2.5K. Credits: The X Consortium staff. Keith Packard (keithp@ncd.com) Major contributors: Martin Forssen (maf@dtek.chalmers.se) -- keyboard support. John DiMarco (jdd@cdf.toronto.edu) -- Solaris 2 support. Bug fixers: George Ross (gdmr@dcs.edinburgh.ac.uk) Obi Thomas (obi@finnbogi.ocs.com) Eirik Fuller (eirik@elf.tn.cornell.edu) Andrew McRae (andrew@megadata.mega.oz.au) Minh Tran-Le (tranle@caliph.intellicorp.com) Where to get it: export.lcs.mit.edu (18.24.0.12) in the file: /contrib/Xsun.multi-screen/R5.Xsun.multi-screen.tar.Z Installation instructions: If you're using gcc on Solaris 2, read the note above! In previous versions, server/include/site.h was moved to server/include/site.h.orig. You may want to restore the original, but it's not strictly necessary. 'cd .../mit/' 'mv server/ddx/sun server/ddx/sun.orig' 'mv server/ddx/mi/mieq.c server/ddx/mi/mieq.c.orig 'mv server/ddx/mi/mipointer.c server/ddx/mi/mipointer.c.orig 'mv server/ddx/mi/mipointrst.h server/ddx/mi/mipointrst.h.orig 'mv include/Sunkeysym.h include/Sunkeysym.h.orig' 'zcat R5.Xsun.multi-screen.tar | tar xvf -' 'patch -p0 < R5.Xsun.multi-screen.patch' 'cd server' 'make Makefiles' 'make depend' 'make'