If your web browser formats this page incorrectly, try viewing the
page source. In netscape 4, click the view menu, then click page source.
This is correct for fedora 2 (kernel 2.6).
The linux joystick driver is divided into two parts. The first part is
joystick functions which are the same for all joysticks. There is only one
first part, and it is a kernel module named joydev, and you use it for most
joysticks. The second part is joystick functions which are are different for
each joystick. There are many of these second parts. Each is a seperate
kernel module. You must choose the correct second part kernel module. You
also need a driver for the port which your joystick is attached to. Thus you
need two kernel modules for the joystick plus more kernel modules for the
port to use a joystick with linux.
You may also need kernel module gameport, but gameport usually loads
automatically, so you do not need to think about gameport. (Why don't joydev
and the joystick port driver load automatically?)
Most cheap joysticks use the PC game port. Other joysticks may attach to usb
ports, serial ports, or parallel ports.
For an ISA PC, the game port driver is kernel module ns558. For a PCI PC,
the gameport driver is usually part of the sound card driver. Many sound
card drivers disable the game port by default. So you need to figure out
which kernel module is the driver for your sound card, and what kernel
module option to use to enable the game port. Your sound card driver may be
already loaded with the wrong joystick options.
Finally you need to figure out which kernel module is the driver for your
type of joystick. Most cheap joysticks use kernel module analog. Analog
seems to default to two axis three button, so you may need to use kernel
module options to specify how many axes and buttons your joystick has.
If any of the drivers is compiled into the kernel, you will need to add the
module options to your boot options.
The joystick device is /dev/js0, which is a link to /dev/input/js0, which is
a character device, major number=13, minor number=0.
For example, I have a cheap two axis two button joystick attached to a PC
game port on a PCI computer with an audioPCI sound card. In
/etc/modprobe.conf, I put:
install joystick /sbin/modprobe snd-ens1371; /sbin/modprobe joydev; \
/sbin/modprobe analog
options snd-ens1371 joystick_port=1
options analog map=2btn
and in my startup scripts I put:
/sbin/modprobe joystick
Some people say you can put something like 'alias char-major-13-0 joystick'
in /etc/modprobe.conf so that the joystick driver will load automatically
when you use /dev/js0. However, that does not seem to work in fedora 2. I
guess that is an old feature which worked in /etc/modules.conf with kernels
2.0 - 2.4, but does not work in /etc/modprobe.conf with kernel 2.6. Maybe it
would work with kernel 2.6 if it was in /lib/modules/*/modules.alias. Why
isn't it already in /lib/modules/*/modules.alias?
I think redhat 7.2 (kernel 2.4) is similar, except that the option for
module analog is js=... instead of map=..., and most 2.4 sound drivers do
not support the game port, so you may be unable to use a joystick attached
to the game port of a pci sound card. You can still use a joystick attached
to the game port of an isa computer, or attached to a usb, parallel, or
serial port.
For kernel 2.2, I think you use kernel module joystick plus another module
for your type of joystick.
For kernel 2.0, I think there is no joystick support, but there may be
kernel patches which provide joystick support.