Please understand that I wrote this "howto"
before L.I.F.E. with that being the case it may not be as simplified as
documents that L.I.F.E. uses now. However if you have any problems
feel free to email with them.
Kernel 2.4.x Linux Joystick HOWTO
Will linux recognize my joystick?
2. What kernel version do I need?
3. What other software do I need?
4. How do setup my joystick?
1. Will linux recognize my joystick?
This howto covers the detection and use of standard gameports and
analog joysticks. Other joysticks may be configurable in this fashion,
but there is no guarantee. Linux has probably already detected your
but the way to tell for sure is by executing a few simple steps. step
one: First try this "cat /proc/isapnp". Hold shift and press the "page
to scroll through the output. Look for something like this in
the output: Logical device 1 'CSC0001:GAME' Device is active Active
port 0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff Active
IRQ 255 [0xff],255 [0xff] Active DMA 255,255 Active memory
0xffffffff,0xffffffff,0xffffffff,0xffffffff Resources 0 Priority
preferred Port 0x200-0x200, align 0x7,
size 0x8, 16-bit address decoding Alternate resources 0:1 Priority
acceptable Port 0x208-0x208, align 0x7, size 0x8, 16-bit address
decoding If you see something similar to this then you are in luck.
gameport is more than likely on an isa PnP (Plug and Play) sound card
or game card. If you have a PCI sound card or game card then you can
"pnpdump" instead of "cat /proc/isapnp to get a similar output.
What kernel version do I need?
This HOWTO is written for kernel versions 2.4.x. For older kernel
read any joystick related files in the "Documentation" directory of
kernel source directory (usually
/usr/src/linux/Documentation/joystick.txt) Since the joystick and
compilation have several differences these steps
WILL NOT work for earlier versions. Please refer to the "Kernel
section of part 4 of this HOWTO to see suggestions for how to configure
your kernel version 2.4.x
What other software do I need?
Read the "Changes" file in your source directory. Make sure that you
the version of modutils that is asks for. You can also find joystick
software on the web (see section 5 of this HOWTO)
How do setup my joystick?
Ok, the fun part :) Part 4 is
set up in 6 steps below.
configuring your kernel Again this is for kernel
versions 2.4.x and will not work on other versions. Run make config,
menuconfig or make xconfig. Make sure you have enabled the following:
Input core support (module) Input core support --> Joysticks
(module) Character Devices --> Joysticks --> Joystick support
the kernel) Character Devices --> Joysticks --> ns558 support
(module) Character Devices --> Joysticks --> analog joysticks
(module) Once again this HOWTO is for setting up analog joysticks with
but at this point you can attempt to add support for your joystick if
it is not analog....lots of choices here. Also if you use make
you can highlight the joystick of your choice and then select "help".
the help dialog it will tell you the name of the module file
you probably want to write it down.
compiling your kernel. If you are unsure about how
to do that see the kernel HOWTO, but usually "make dep" then "make
then "make bzImage" then "make modules" (VERY IMPORTANT) then "make
(ALSO IMPORTANT) then optionally "make install" or use lilo (see the
HOWTO)to make a boot floppy or "make bzdisk"
Setup your modules. You should check to make sure
your modules are in the right directories. Look in
you should see the files "joydev.o" and "input.o" Now look in
look for the files "ns558.o", "analog.o" and "gameport.o" if you
module support for any other joysticks you should be able to find
for them in here as well. If you do not find all of these module files
here then you need to repeat steps one and two. Make sure that you have
enabled them as modules which will look like not < > or <*>
if you ran "make menuconfig"
Make the device files. Do the following command to
set up the correst device files in your /dev directory: cd /dev rm
js* mkdir input mknod input/js0 c 13 0 mknod input/js1 c 13 1
(if you have more than one gameport) ln -s input/js0 js0 ln -s
js1 (if you have more than one gameport) chmod u+rwx input/js0 chmod
u+rwx input/js1 (if you have more than one gameport) This will
manually make the nessecary device files and symbolic links that your
needs to function. I am not sure if the last step (chmod) is nessecary
for all systems but it was for mine.
Modifying rc scripts for the new modules modules.Before
you reboot your machine modify the file /etc/rc.d/rc.modules and ad the
following lines: /sbin/modprobe joydev /sbin/modprobe ns558
analog (or whichever driver your joystick uses) Now you can reboot your
Did it work? Take a close look at your start up dialog.
You should see: "Using
/lib/modules/2.4.4/kernel/drivers/char/joystick/analog.o" If you see
these lines with no error messages you are probably ready to test your
so move to section 5. If testing does not work you can return to this
part and continue. If you do see error messages (If your sound card or
joystick card is ISA you probably do) DO NOT PANIC. Simply move on to
the next step. Step seven: ISAPNP. First do "ls /etc/isapnp.conf" if
get a "file not found" error that's fine. If you do have a
file then this will get a little tricky, but chances are you don't. If
you do not have a isapnp.conf file then simply do "pnpdump -c >
If you have your sound card working already and you did not already
a isapnp.conf file then you will probably want to edit /etc/isapnp.conf
and comment out any references to your sound card and any other ISA
that are already working normally (if it ain't broke don't fix it).
you want to leave any references to your gameport. After you are sure
have edited this file properly then you can run "isapnp
you should get a response that says your gameport (and only your
is enabled. This is good. Step eight: Try try again. At this point you
want to run "lsmod" to see what modules are running. You should see
that "Joydev" and "input" are enabled. Now do "rmmod joydev" then
Now do "insmod joydev" then "insmod ns558" then "insmod analog". Now do
"lsmod" again and you should see something like: Module Size Used by
analog 7456 0 (unused) ns558 3200 0 (unused) gameport 1808 0 [analog
ns558] joydev 6240 0 input 3360 0 [analog joydev] If so all is well.
Notice that "input"
and "gameport" are loaded as well. They are loaded automatically when
load "joydev" and "ns558". You should be ready to move on to section 5
and test your joystick. If these modules are not loaded or if you got
an error when trying to load one of them then you may have a hardware
module problem. Try rebooting and see what happens. If it still does
work then try again from section one. 5. How can I test my joystick?
There are a few utilities for testing your joystick. Some can be found
Download the utilities package from the cvs tree. Alternatively you can
probably use an older version of the utility jstest like I did. As a
ditch effort you can "cat /dev/js0" while moving the joystick. If you
output you probably have a functional gameport. Note: This process is
not fool proof but it worked for my system. Please refer to the file
for more detailed instructions if this does not do the trick. Let me
everyone that I am a relatively new Linux user. If anyone has any
or suggestions please email them to me.
Special thanks to Urchlay from #linuxhelp, who really DOES know