# 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 w: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.
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:
2. Update the package information database and install the x-driver-sis package:

## Hotplug

Install the hotplug package:

## 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”.
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:
3. Install the xserver-xorg package:

## XOrg server configuration
### 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:
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.
* Manually:
On a Debian system with the default init system, create a symbolic link:
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:

## 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.