Renamed comedi_driver##_pci to comedi_driver##_pci_driver to avoid
[comedi.git] / INSTALL
1
2 * Linux source:
3
4 In order to compile the Comedi modules, you will need to have
5 a correctly configured Linux kernel source tree.  The best
6 way to get one is to download a tarball from kernel.org and
7 compile your own kernel.  Comedi should work with most 2.2, 
8 2.4, and 2.6 Linux kernels.  2.6.x kernels older than 2.6.6 are
9 not supported.  Support for 2.0.3x is not actively maintained,
10 but it should work and bugs will be fixed as they are reported.
11
12 You can also prepare a kernel source tree that matches
13 the kernel you are currently running if you have its config file (in
14 the Debian distibution the config files for the kernel-image packages
15 are installed into the /boot directory).  The following steps will
16 (almost) set up your kernel sources correctly.  You will also need
17 write permission to the kernel source directory the first time you
18 run comedi's configure script, so you might want to unpack the kernel
19 source into a directory you own.
20
21 1) Get a copy of the kernel source that matches the kernel you are
22         running.  Unpack it and copy your kernel config file to '.config'
23         in the top directory of your kernel source.
24 2) You might need to edit the file 'Makefile' in the kernel source.
25         At the top of the Makefile, the variable EXTRAVERSION is defined.
26         If necessary, change it to match your kernel (for example, if the command
27         'uname -r' produces "2.4.16-386" then your EXTRAVERSION should be
28         set as 'EXTRAVERSION=-386'.
29 3) Run 'make oldconfig' in your kernel source directory.
30 4) Run 'make dep' (for 2.6 kernels, do a 'make modules_prepare' instead 
31         or even better a full 'make') in the kernel source directory and 
32         you are done.
33
34 Red Hat users note: Kernel sources that are distributed with Red
35 Hat Linux are not supported, because they are too heavily
36 modified.  However, there is some information in
37 Documentation/comedi/redhat-notes on how to use Red Hat kernels.
38
39 * RTAI support:
40
41 If you want to use the real-time capabilities of Comedi with
42 RTAI, you need to compile and install RTAI first.  If you
43 don't install the rtai kernel modules, you may get unresolved
44 symbols when installing the comedi kernel modules.
45
46 * RTLinux support:
47
48 If you want to use the real-time capabilities of Comedi with
49 RTLinux, you need to compile RTLinux (both the kernel and the
50 modules) first.  Known working versions are 2.x and 3.0.
51
52 * Configuration:
53
54 Configure with './configure'.  './configure --help' will give the
55 configuration options.  If the configure script does not exist
56 (if you checked comedi out from cvs for example), it can
57 be generated by running './autogen.sh'.  The autoconf, automake,
58 autoheader, etc. tools are required to generate the configure
59 script (automake version >= 1.7 recommended).  The --with-linuxdir
60 option is particularly useful, as it allows you to specify
61 the location of your Linux kernel source directory.  If
62 you are using an RT-patched kernel, the --with-rtaidir or
63 --with-rtlinuxdir options allow you to specify
64 the location of your RTAI or RTLinux source directory.
65
66 * Compiling:
67
68 Compile using 'make'.  If this fails for some reason, send the
69 _entire_ build log to the mailing list.  Without the build
70 log, it is impossible to find problems.
71
72 * Installation:
73
74 Install using 'make install' as root.  This installs the files:
75
76   /lib/modules/<<kernel version>>/comedi/comedi.o
77   /lib/modules/<<kernel version>>/comedi/kcomedilib.o
78   /lib/modules/<<kernel version>>/comedi/<<driver files>>.o
79
80 You need to create device files to access the hardware from a
81 user process.  These can be created using 'make dev'.  The following
82 special files will be created:
83
84   /dev/comedi0
85   /dev/comedi1
86   /dev/comedi2
87   ...
88   /dev/comedi15
89
90 * Comedilib:
91
92 Now would be a good time to compile and install Comedilib.  Comedi
93 and Comedilib are completely independent, so it doesn't matter
94 which is installed first.
95
96 * Running Comedi:
97
98 To use comedi, the driver module and the core Comedi modules must
99 be loaded into the kernel.  This is done by a command similar to
100
101   /sbin/modprobe <<driver>>
102
103 If your module dependencies are set up correctly, this will load
104 both comedi.o and your driver.  If you get unresolved symbols, check
105 the FAQ or the mailing list archives.  Also look at the man pages
106 for modprobe and insmod.
107
108 In order to configure a driver module to use a particular device
109 file (/dev/comediN) and a particular device, you need to use the
110 command 'comedi_config', which is part of the comedilib
111 distribution.  Comedi_config is invoked using
112
113   comedi_config /dev/comedi0 <device name> <option list>
114
115 The device name may or may not be the same as the module name.  In
116 general, if the device type can be autoprobed (as with ISA PnP or
117 PCI devices), the device name will be the same as the module name.
118 Otherwise, you will need to check Documentation/comedi/drivers.txt
119 for information about what device name is appropriate for your
120 hardware.  The option list is to supply additional information,
121 such as I/O address, IRQ, DMA channels, and other jumper settings.
122 Information about option lists appropriate for a driver is in
123 drivers.txt.  The following commands are examples:
124
125   comedi_config /dev/comedi0 dt2821 0x240,3
126   comedi_config /dev/comedi1 ni_atmio 0x260,4
127   comedi_config /dev/comedi2 dt2817 0x228
128   comedi_config /dev/comedi3 ni_pcimio
129
130 Try a 'man comedi_config' for information on how to use
131 this utility.  Scripts have been written for a few of the drivers
132 with very complicated option lists -- these are found in the etc
133 directory.
134
135 * Module Autoloading:
136
137 For recent kernels, module autoloading is handled by udev.  The
138 following is only applicable to older kernels.
139
140 If you like to autoload your modules, put the following lines
141 into /etc/modules.conf (this does not apply for PCMCIA cards):
142
143   alias char-major-98 comedi
144   alias char-major-98-0 your_driver
145   post-install your_driver PATH=/sbin:/usr/sbin:/usr/local/sbin:$PATH;comedi_config /dev/comedi0 board_name <<options>>
146
147 Alternatively, for complicated option lists, the scripts in etc
148 are designed to be copied into /etc, so that you could put the
149 following lines into /etc/conf.modules:
150
151   alias char-major-98-0 dt282x
152   post-install dt282x /etc/dt282x.conf
153
154 * Calibration:
155
156 If your board has self-calibration capabilities,
157 will want to run comedi_calibrate, an autocalibration tool that 
158 is packaged in a seperate tarball, in a bootup script.
159
160 * PCMCIA:
161
162 The PCMCIA drivers require at least a 2.6.16 kernel (at for
163 unpatched mainline kernels).  You must also have pcmciautils
164 and udev installed.  You can write a udev rule to automatically
165 run gpib_config after the driver is loaded.
166
167 * Upgrading:
168
169 From versions prior to 0.6.0, you will need to edit and recompile
170 all programs that use comedi or comedilib, since the names of
171 functions and ioctls have changed.
172
173 From versions prior to 0.5.0, you will need to recompile all programs
174 that use comedi or comedilib, since the interface to both of these has
175 changed.  No changes should need to be made to the source of the
176 programs.  The format for parameters of comedi_config has changed.
177
178 From versions prior to 0.4.0, you will need to run 'make dev' again
179 to recreate /dev/comedi*, since the major number has changed.
180