Skip to content
This repository
Fetching contributors…


Cannot retrieve contributors at this time

file 170 lines (137 sloc) 7.6 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169

Installing Linux-GPIB

A) First steps:

o) Installing your Hardware:
If you have an old ISA board it may need to be configured by setting
the appropriate board jumpers or switches
for its base-address, interrupt-level (IRQ) and dma-request channel (DMA).
Please choose a free base-address, irq and dma for your system
(refer to your
hardware documentation for this). You can "cat" /proc/interrupts,
/proc/dma, /proc/ioports, and /proc/iomem to get information on
interrupt, dma lines, io ports, and io memory already in use by other
drivers. Now shut down your system and
install the board in your computer.

o) Unpacking the Software:
Unpack the archives with the 'tar' program, for example
'tar -xzf linux-gpib.tar.gz'.

You will also need the linux kernel source code, or a reasonable approximation
thereof, which the linux-gpib
package reads for header files and compilation variables when compiling
the gpib kernel modules. Ideally, you have the linux source your
current kernel was compiled from, or are willing to compile
a fresh kernel. Otherwise, your distribution may provide a useable setup
you can compile against (usually pointed at by a symbolic link at
/lib/modules/<kernel_version>/build). For example, on Debian Sarge
you can install the kernel-headers package which matches the kernel you
are running and all should be well.
You could also prepare a kernel source tree that matches
the kernel you are currently running if you have its config file (in
the Debian distibution the config files for the kernel-image packages
are in the /boot directory). Perform the following steps:
1) Get a copy of the kernel source that matches the kernel you are
running. Unpack it and copy your kernel config file to '.config'
in the top directory of your kernel source. Note: you will need
to have write permission to your kernel source
directory when compiling linux-gpib, so it might be easiest to unpack
the kernel source into a user-owned directory.
2) You might need to edit the file 'Makefile' in the kernel source.
At the top of the Makefile, the variable EXTRAVERSION is defined.
If necessary, change it to match your kernel (for example, if the command
'uname -r' produces "2.6.8-1-386" then your EXTRAVERSION should be
set as 'EXTRAVERSION=-1-386'.
3) run 'make oldconfig' in your kernel source directory.
4) run 'make vmlinux' and 'make modules' in the kernel source directory. This will
compile the Linux kernel and modules (and take a long time).
You can probably get by with just doing a 'make modules_prepare' instead, and
your GPIB driver modules should still work. However,
the GPIB modules will taint your kernel when loaded. Tainting is
a flag to kernel developers that something fishy has been done, and
they tend to ignore bug reports from tainted kernels.

B) Installing Linux-GPIB

o) cd to your linux-gpib directory and run the './configure' script.
run './configure --help' for a list of the possible options.
In particular, the '--with-linux-srcdir' option is useful for
specifying the location of your Linux kernel source directory,
and the '--enable-pcmcia' option is useful for laptops.

If the configure script does not exist (you are using a cvs
checkout), it can be generated by running the './bootstrap'
script. You will need automake, autoconf, etc. to generate
the configure script.

Type 'make'. Now the Package will be compiled. Note, you
will need to use the same version of gcc to compile the linux-gpib
kernel modules as was used to compile your kernel. Using
different versions has been known to cause problems (kernel panics,
crashes, etc.). Linux-gpib will compile its kernel modules
with the compiler specified by the kernel's Makefile (the CC

Type 'make install' (as root). This will copy the kernel driver to
/lib/modules/<kernel version>/gpib as well as install the library
and headers files. Make sure the directory you installed the
shared library to is listed in your /etc/ file,
so that ld can find If the directory is not listed,
add it and then run 'ldconfig'.

To give a user access to the computer's gpib board you will have to add
them to the group 'gpib' (you can use the 'usermod' tool or edit
/etc/groups to change the groups a user belongs to). Or, you could change the
permissions on the device files /dev/gpib[0-15] to something you like
better, using 'chmod' (or edit devfsd.conf if you are using devfs).
If you are using udev, you can set the permissions on the gpib device
files by adding a line like:
KERNEL=="gpib[0-9]*", MODE="0660", GROUP="gpib"
to your udev rules (/etc/udev/permissions.rules on Debian Etch).

C) Configuring the GPIB-Library

Edit /etc/gpib.conf to match your interface board, and any devices you wish
to open via ibfind(). See the documentation in doc/ for
more information.

D) Loading the driver module

o) PCI and ISA boards

You can load the driver module by typing

modprobe <driver name>

See the documentation in doc/ to see which driver your board is supported

You need to run the 'gpib_config' utility to setup the driver
before you can use it (the 'minor' options specifies which
board index you are setting up):

gpib_config --minor 0

You can also set up the modules to load automatically by adding lines
something like

alias char-major-160 gpib_common
alias gpib0 tnt4882
install tnt4882 PATH=/sbin:/usr/sbin:/usr/local/sbin:$PATH;modprobe --ignore-install tnt4882;gpib_config --minor 0

to /etc/modprobe.conf, which would autoload the tnt4882.o module and run
gpib_config when the library is used. In the Debian distribution, modprobe.conf
is modified by adding a file to the /etc/modprobe.d directory, and then running

o) PCMCIA cards

If you are using a PCMCIA board, copy the files in the etc/pcmcia
subdirectory to /etc/pcmcia. You may need to send a SIGHUP signal
to the cardmgr daemon to force it to reload the files in
/etc/pcmcia (alternatively you could use your pcmcia init.d script
to restart the cardmgr, or you could just reboot). The driver
module will be loaded as needed by the cardmgr.
You may wish to edit the options passed to the gpib_config call in the
/etc/pcmcia/linux-gpib-pcmcia script.

o) USB devices

USB hotplug scripts will be installed into /etc/hotplug/usb if they do not already exist.
You may wish to edit the GPIB_CONFIG_OPTIONS in the hotplug script for your device.
You will also need to install firmware files for your device, a tarball is available from Make sure you have
the "hotplug" and "fxload" packages installed on your computer. The hotplug system
will automatically upload the firmware to your device and load the driver module when
the device is plugged in. If you have errors, check your system log files (not dmesg)
for messages from the hotplug scripts.

E) Trying it out

You may find the examples/ibtest program useful as a starting point in trying
out your setup.

F) Bindings for other languages

The bindings to other languages will be enabled by default in the
'./configure' script. They will not be built if you disable
them with the appropriate configure option, or if the necessary
header files/libraries are not found on your machine.

Something went wrong with that request. Please try again.