Short Tutorial for installing Comedi & Comedilib

Comedi (Control Measurement and Device Interface) is a collection of device driver for data acquisition board. The specification of my computer system is

a. RTLinux 3.2-rc-1 from www.rtlinux-gpl.org

b. Linux Kernel 2.4.21 from kernel.org

c. Redhat 9

d. Comedi from RTLinux 3.2-rc-1 in “drivers” folder

e. Comedilib 0.7.22 from www.comedi.org

Below are the steps of installing comedi and comedilib in RTLinux :

1. Step 1 (Preparation)

– Modify the file “fs.h” in /usr/src/rtlinux/drivers/comedi/include/linux/fs.h become

/* linux/fs.h compatibility header

*/

# ifndef __COMPAT_LINUX_FS_H_

# define __COMPAT_LINUX_FS_H_

# include <linux/version.h>

# define KILL_FASYNC(a,b,c) kill_fasync(&(a),(b),(c))

# include_next <linux/fs.h>

# endif- Please check your kernel version which has already been patched with rtlinux. Use command prompt “uname -r” in shell prompt

- Upgrade the “swig” for linux redhat 9. The swig version must above 1.3.x

2. Step 2 (Configuration and Install)

- Do configuration inside the comedi folder, by typing “./configure”. After that type “make config” . And fill the name of location of linux installation folder. Remember this linux folder must be patched by rtlinux. Then, fill the name of location of rtlinux folder.

- type “make” for compile

- type “make install”

- After the comedi has been successfully installed in the system. Type “make dev” for making device files

3. Step 3 (Test the Driver) – Install driver module by using command: (ni_pcimio is the driver which is suitable for my data acquisition board)

“/sbin/modprobe ni_pcimio “

- for checking the message from this action, type “dmesg” in shell prompt

4. Step 4 (Install Comedilib)

- “./configure” in comedilib folder

- make

- make install

5. Step 5 ( Modify /etc/modules.conf )

If we type the command “/sbin/modprobe -c | grep comedi”, we get no result ( something like ” alias char-major-98 comedi”). We must modify modules.conf file by adding

“alias char-major-98 comedi”

in that file.

6. Step 6 (Showing the board information)

- use command like this below to show the information about our board:

“cat /proc/comedi”

Reference :

1. http://he3.dartmouth.edu/pci-ioc/LinuxIOC_2.html

2. http://www.comedi.org/cgi-bin/viewvc.cgi/comedi/Documentation/comedi/

Leave a Reply

You must be logged in to post a comment.