📄 install
字号:
* Linux source:In order to compile the Comedi modules, you will need to havea correctly configured Linux kernel source tree. The bestway to get one is to download a tarball from kernel.org andcompile your own kernel. Comedi should work with most 2.2 and2.4 Linux kernels. Support for 2.0.3x is not actively maintained,but it should work and bugs will be fixed as they are reported.You can also prepare a kernel source tree that matchesthe kernel you are currently running if you have its config file (inthe Debian distibution the config files for the kernel-image packagesare installed into the /boot directory). The following steps will(almost) set up your kernel sources correctly. You will also needwrite permission to the kernel source directory the first time yourun comedi's 'make config', so you might want to unpack the kernel source into a directory you own.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.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.4.16-386" then your EXTRAVERSION should be set as 'EXTRAVERSION=-386'.3) Run 'make oldconfig' in your kernel source directory.4) Run 'make dep' in the kernel source directory and you are done.Red Hat users note: Kernel sources that are distributed with RedHat Linux are not supported, because they are too heavilymodified. However, there is some information inDocumentation/comedi/redhat-notes on how to use Red Hat kernels.* RTAI support:If you want to use the real-time capabilities of Comedi withRTAI, you need to compile and install RTAI first. It isnecessary to use the rthal patch instead of the "copyto"scripts. Known working versions are RTAI-1.6, RTAI-24.1.4,and current RTAI CVS. Remember to enable Kcomedilib support,since you will be accessing Comedi from other kernel modules.* RTLinux support:If you want to use the real-time capabilities of Comedi withRTLinux, you need to compile RTLinux (both the kernel and themodules) first. Known working versions are 2.x and 3.0.Remember to enable Kcomedilib support, since you will beaccessing Comedi from other kernel modules.* Configuration:Configure using 'make'. This will ask you the location of theLinux kernel source tree. If it detects that you have a kernelpatched for RTAI or RTLinux, it will also ask you for the locationof the RTAI or RTLinux source directory. Then the configurationscript will ask questions for a couple general Comedi featuresand then whether or not compile each driver.* Compiling:Compile using 'make'. If this fails for some reason, send the_entire_ build log to the mailing list. Without the buildlog, it is impossible to find problems.* Installation:Install using 'make install' as root. This installs the files: /lib/modules/<<kernel version>>/misc/comedi.o /lib/modules/<<kernel version>>/misc/kcomedilib.o /lib/modules/<<kernel version>>/misc/<<driver files>>.oYou need to create device files to access the hardware from auser process. These can be created using 'make dev'. The followingspecial files will be created: /dev/comedi0 /dev/comedi1 /dev/comedi2 /dev/comedi3* Comedilib:Now would be a good time to compile and install Comedilib. Comediand Comedilib are completely independent, so it doesn't matterwhich is installed first.* Running Comedi:To use comedi, the driver module and the core Comedi modules mustbe loaded into the kernel. This is done by a command similar to /sbin/modprobe <<driver>>If your module dependencies are set up correctly, this will loadboth comedi.o and your driver. If you get unresolved symbols, checkthe FAQ or the mailing list archives. Also look at the man pagesfor modprobe and insmod.In order to configure a driver module to use a particular devicefile (/dev/comediN) and a particular device, you need to use thecommand /usr/sbin/comedi_config, which is part of the comedilibdistribution. Comedi_config is invoked using /usr/sbin/comedi_config /dev/comedi0 <device name> <option list>The device name may or may not be the same as the module name. Ingeneral, if the device type can be autoprobed (as with ISA PnP orPCI devices), the device name will be the same as the module name.Otherwise, you will need to check Documentation/comedi/drivers.txtfor information about what device name is appropriate for yourhardware. The option list is to supply additional information,such as I/O address, IRQ, DMA channels, and other jumper settings.Information about option lists appropriate for a driver is indrivers.txt. The following commands are examples: /usr/sbin/comedi_config /dev/comedi0 dt2821 0x240,3 /usr/sbin/comedi_config /dev/comedi1 ni_atmio 0x260,4 /usr/sbin/comedi_config /dev/comedi2 dt2817 0x228 /usr/sbin/comedi_config /dev/comedi3 ni_pcimioTry a 'man comedi_config' for information on how to usethis utility. Scripts have been written for a few of the driverswith very complicated option lists -- these are found in the etcdirectory.* Module Autoloading:If you like to autoload your modules, put the following linesinto /etc/modules.conf (this does not apply for PCMCIA cards): alias char-major-98 comedi alias char-major-98-0 your_driver post-install your_driver /usr/sbin/comedi_config /dev/comedi0 your_driver <<options>>Alternatively, for complicated option lists, the scripts in etcare designed to be copied into /etc, so that you could put thefollowing lines into /etc/conf.modules: alias char-major-98-0 dt282x post-install dt282x /etc/dt282x.confIf you have a National Instruments AT-MIO or PCI-MIO board, you probablywill want to run comedi_calibrate, an autocalibration tool that is partof comedilib in a bootup script.* PCMCIA:Linux-2.4 kernels are recommended for PCMCIA drivers, since 2.2kernel require the separate PCMCIA package. It is possible touse 2.2 kernels with PCMCIA, although it is necessary to modifythe top level Makefile.Comedi works with several PCMCIA cards, and the driver modules canbe loaded and unloaded upon insertion and removal of the card.The necessary configuration files are in the Comedilib sourcepackage. Copy the files in etc/pcmcia/ to /etc/pcmcia and restartcard services. The pcmcia script provided is very simple -- it onlyuses /dev/comedi0 for devices, which is a limitation if you haveother Comedi devices in your system.* Upgrading:From versions prior to 0.6.0, you will need to edit and recompileall programs that use comedi or comedilib, since the names offunctions and ioctls have changed.From versions prior to 0.5.0, you will need to recompile all programsthat use comedi or comedilib, since the interface to both of these haschanged. No changes should need to be made to the source of theprograms. The format for parameters of comedi_config has changed.From versions prior to 0.4.0, you will need to run 'make dev' againto recreate /dev/comedi*, since the major number has changed.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -