Multiseat Configuration/evdev

This page teaches how a Multiterminal with evdev works and how to do it. This method eliminates the use of kernel patch, and then, configures multiterminals using evdev protocol.

Operating System
Debian Sarge (but you can easily use other Linux distributions)

Hardware
Video Adapters:


 * 4 SiS graphic cards (you can also use other video-cards, but it doesn't always work with other combinations of cards)

Input devices:


 * 1 PS/2 keyboard
 * 1 PS/2 mouse
 * 3 USB keyboards
 * 3 USB mice

Make sure your kernel is compiled with the evdev module.

You also need to install udev, which provides a dynamic /dev directory refreshed with the currently available devices.

apt-get install udev

The udev system requires kernel 2.6.12 or higher.

Installing the SiS driver
1. Add this line to the file /etc/apt/sources.list:

http://www.winischhofer.net/sis/debian/stable ./

2. Update the package information database and install the x-driver-sis package:

apt-get update apt-get install x-driver-sis

Hotplug
Install the hotplug package:

apt-get update apt-get install hotplug

Input devices
Before proceeding, we need to make sure that the input devices (keyboards and mice) were properly detected. Read the contents of /proc/bus/input/devices, a file with details about devices detected by the kernel. A sample from this file is shown below. Only two fields are of interest to us: the device names, contained in lines beginning with “N: Name=”, and the physical address, shown in lines beginning with “P: Phys”.

I: Bus=0011 Vendor=0001 Product=0001 Version=ab41 N: Name="AT Translated Set 2 keyboard" P: Phys=isa0060/serio0/input0 H: Handlers=kbd event0 B: EV=120013 B: KEY=4 2000000 3802078 f840d001 f2ffffdf ffefffff ffffffff fffffffe B: MSC=10 B: LED=7

I: Bus=0011 Vendor=0002 Product=0005 Version=0000 N: Name="ImPS/2 Generic Wheel Mouse" P: Phys=isa0060/serio1/input0 H: Handlers=mouse0 event1 B: EV=7 B: KEY=70000 0 0 0 0 0 0 0 0 B: REL=103

I: Bus=0003 Vendor=0a81 Product=0101 Version=0110 N: Name="CHESEN USB Keyboard" P: Phys=usb-0000:00:10.2-1/input0 H: Handlers=kbd event2 B: EV=120003 B: KEY=10000 7 ff87207a c14057ff febeffdf ffefffff ffffffff fffffffe B: LED=7

I: Bus=0003 Vendor=0a81 Product=0101 Version=0110 N: Name="CHESEN USB Keyboard" P: Phys=usb-0000:00:10.2-1/input1 H: Handlers=kbd event3 B: EV=3 B: KEY=1f 0 20000 3878 d801d101 1e0000 0 0 0

I: Bus=0003 Vendor=04fc Product=0013 Version=06b0 N: Name="USB OpticalWheel Mouse" P: Phys=usb-0000:00:10.2-2/input0 H: Handlers=mouse1 event4 B: EV=7 B: KEY=70000 0 0 0 0 0 0 0 0 B: REL=103

Note that the file seems to show the presence of three keyboards, even though on the measured system there are only two. The reason for the additional device is that many USB keyboards include special keys (such as multimedia control or Internet shortcut keys), which are detected by the kernel as belonging to a secondary keyboard. Secondary keyboards have a physical address ending in “input1”. We will deal only with the primary keyboards, the addresses of which end in “input0”. Therefore, the section about the secondary keyboard with the physical address “usb-0000:00:10.2-1/input1” will be ignored.

XOrg server
The next step is installing the XOrg server.

1. Backup and remove the file /etc/init.d/xfree-common. 2. Add the following lines to /etc/apt/sources.list:

deb http://people.debian.org/~nobse/xorg-x11/ sarge main deb-src http://people.debian.org/~nobse/xorg-x11/ sarge main

3. Install the xserver-xorg package:

apt-get update apt-get install xserver-xorg apt-get upgrade

xorg.conf
This configuration will be used when the multiterminal is running. The file will have additional sections according to the number of terminals. For each terminal, we'll create mouse, keyboard, graphics device, monitor, screen, and layout sections. For example, in a multiterminal with four terminals, the file will have four mouse sections, four keyboard sections, and so on.

The “Identifier” values are not mandatory. They may be changed to anything, as long as the names are consistent in the whole file.

The physical address (“Dev Phys” option) can be obtained from the file /proc/bus/input/devices, as explained before.

Below there's a sample for each kind of section.

xorg.conf.probe
Besides the standard xorg.conf we'll need another configuration file, xorg.conf.probe. While the multiterminal is running, we disable interruptions on channel 10 (IRQ 10) to avoid VGA (and VESA VBE) calls to a board interfering with the others. However, without these calls the secondary boards are not initialized. To solve this problem, during system startup the XOrg server will be run with the xorg.conf.probe file. It will probe for these cards with IRQ 10 calls active during the test, thus initializing them.

To create your xorg.conf.probe, take the xorg.conf as a base, remove the sections related to the primary graphic card (which is initialized by the BIOS when the computer turns on) and toggle all NoInt10 options to "No". A single layout will be enough, as long as it includes all secondary cards. To illustrate, below are some sections of the xorg.conf.probe file derived from the previous xorg.conf:

To run the probe we provide the xorg-multiterminal script. It runs the X server in probeonly mode (check for video adapters and exit), using the xorg.conf.probe as the configuration file. As explained before, this step initializates the secondary video cards. The file contents are:

file=/etc/X11/xorg.conf.probe

-f "$file" && /usr/X11R6/bin/X -config "$file" -probeonly 2>/dev/null

Save it with the executable bit set and configure the startup system to run the script. On Debian, the path should be /etc/init.d/xorg-multiterminal, and there are two ways of configuring the system:


 * Through the update-rc.d command. This works for both users of the default Debian init system (sysv-rc) and users of the file-rc package.

update-rc.d xorg-multiterminal start 70 S.

On a Debian system with the default init system, create a symbolic link:
 * Manually:

ln -s /etc/init.d/xorg-multiterminal /etc/rcS.d/S70xorg-multiterminal

On a Debian system with the file-rc package, add the following line in an appropriate place of the /etc/init.d/runlevel.conf file:

70       -        S        /etc/init.d/xorg-multiterminal

GDM
The last step is configuring the login manager to start all the X servers. We will configure only GDM. Other login managers such as XDM and KDM may be configured in a similar manner.

The “[servers]” section of the /etc/gdm/gdm.conf file should have multiple entries, as in the following four-terminal example:

The name of the servers are arbitrary. A section must be added for each one, with the content as shown below:

Troubleshooting
Problems when starting the multiterminal will be logged in the files /var/log/Xorg.*.log. Each terminal's X server will create its own log file.