INSTALL 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. Installing Linux-GPIB
  2. --------------------------------------------------------------------
  3. A) First steps:
  4. ---------------
  5. o) Installing your Hardware:
  6. If you have an old ISA board it may need to be configured by setting
  7. the appropriate board jumpers or switches
  8. for its base-address, interrupt-level (IRQ) and dma-request channel (DMA).
  9. Please choose a free base-address, irq and dma for your system
  10. (refer to your
  11. hardware documentation for this). You can "cat" /proc/interrupts,
  12. /proc/dma, /proc/ioports, and /proc/iomem to get information on
  13. interrupt, dma lines, io ports, and io memory already in use by other
  14. drivers. Now shut down your system and
  15. install the board in your computer.
  16. o) Unpacking the Software:
  17. Unpack the archives with the 'tar' program, for example
  18. 'tar -xzf linux-gpib.tar.gz'.
  19. You will also need the linux kernel source code, or a reasonable approximation
  20. thereof, which the linux-gpib
  21. package reads for header files and compilation variables when compiling
  22. the gpib kernel modules. Ideally, you have the linux source your
  23. current kernel was compiled from, or are willing to compile
  24. a fresh kernel. Otherwise, your distribution may provide a useable setup
  25. you can compile against (usually pointed at by a symbolic link at
  26. /lib/modules/<kernel_version>/build). For example, on Debian Sarge
  27. you can install the kernel-headers package which matches the kernel you
  28. are running and all should be well.
  29. You could also prepare a kernel source tree that matches
  30. the kernel you are currently running if you have its config file (in
  31. the Debian distibution the config files for the kernel-image packages
  32. are in the /boot directory). Perform the following steps:
  33. 1) Get a copy of the kernel source that matches the kernel you are
  34. running. Unpack it and copy your kernel config file to '.config'
  35. in the top directory of your kernel source. Note: you will need
  36. to have write permission to your kernel source
  37. directory when compiling linux-gpib, so it might be easiest to unpack
  38. the kernel source into a user-owned directory.
  39. 2) You might need to edit the file 'Makefile' in the kernel source.
  40. At the top of the Makefile, the variable EXTRAVERSION is defined.
  41. If necessary, change it to match your kernel (for example, if the command
  42. 'uname -r' produces "2.6.8-1-386" then your EXTRAVERSION should be
  43. set as 'EXTRAVERSION=-1-386'.
  44. 3) run 'make oldconfig' in your kernel source directory.
  45. 4) run 'make vmlinux' and 'make modules' in the kernel source directory. This will
  46. compile the Linux kernel and modules (and take a long time).
  47. You can probably get by with just doing a 'make modules_prepare' instead, and
  48. your GPIB driver modules should still work. However,
  49. the GPIB modules will taint your kernel when loaded. Tainting is
  50. a flag to kernel developers that something fishy has been done, and
  51. they tend to ignore bug reports from tainted kernels.
  52. B) Installing Linux-GPIB
  53. -------------------------
  54. o) cd to your linux-gpib directory and run the './configure' script.
  55. run './configure --help' for a list of the possible options.
  56. In particular, the '--with-linux-srcdir' option is useful for
  57. specifying the location of your Linux kernel source directory,
  58. and the '--enable-pcmcia' option is useful for laptops.
  59. If the configure script does not exist (you are using a cvs
  60. checkout), it can be generated by running the './bootstrap'
  61. script. You will need automake, autoconf, etc. to generate
  62. the configure script.
  63. Type 'make'. Now the Package will be compiled. Note, you
  64. will need to use the same version of gcc to compile the linux-gpib
  65. kernel modules as was used to compile your kernel. Using
  66. different versions has been known to cause problems (kernel panics,
  67. crashes, etc.). Linux-gpib will compile its kernel modules
  68. with the compiler specified by the kernel's Makefile (the CC
  69. variable).
  70. Type 'make install' (as root). This will copy the kernel driver to
  71. /lib/modules/<kernel version>/gpib as well as install the library
  72. and headers files. Make sure the directory you installed the
  73. shared library to is listed in your /etc/ld.so.conf file,
  74. so that ld can find libgpib.so. If the directory is not listed,
  75. add it and then run 'ldconfig'.
  76. To give a user access to the computer's gpib board you will have to add
  77. them to the group 'gpib' (you can use the 'usermod' tool or edit
  78. /etc/groups to change the groups a user belongs to). Or, you could change the
  79. permissions on the device files /dev/gpib[0-15] to something you like
  80. better, using 'chmod' (or edit devfsd.conf if you are using devfs).
  81. If you are using udev, you can set the permissions on the gpib device
  82. files by adding a line like:
  83. KERNEL=="gpib[0-9]*", MODE="0660", GROUP="gpib"
  84. to your udev rules (/etc/udev/permissions.rules on Debian Etch).
  85. C) Configuring the GPIB-Library
  86. -------------------------------
  87. Edit /etc/gpib.conf to match your interface board, and any devices you wish
  88. to open via ibfind(). See the documentation in doc/ for
  89. more information.
  90. D) Loading the driver module
  91. -----------------------------
  92. o) PCI and ISA boards
  93. You can load the driver module by typing
  94. modprobe <driver name>
  95. See the documentation in doc/ to see which driver your board is supported
  96. by.
  97. You need to run the 'gpib_config' utility to setup the driver
  98. before you can use it (the 'minor' options specifies which
  99. board index you are setting up):
  100. gpib_config --minor 0
  101. You can also set up the modules to load automatically by adding lines
  102. something like
  103. alias char-major-160 gpib_common
  104. alias gpib0 tnt4882
  105. install tnt4882 PATH=/sbin:/usr/sbin:/usr/local/sbin:$PATH;modprobe --ignore-install tnt4882;gpib_config --minor 0
  106. to /etc/modprobe.conf, which would autoload the tnt4882.o module and run
  107. gpib_config when the library is used. In the Debian distribution, modprobe.conf
  108. is modified by adding a file to the /etc/modprobe.d directory, and then running
  109. 'update-modules'.
  110. o) PCMCIA cards
  111. If you are using a PCMCIA board, copy the files in the etc/pcmcia
  112. subdirectory to /etc/pcmcia. You may need to send a SIGHUP signal
  113. to the cardmgr daemon to force it to reload the files in
  114. /etc/pcmcia (alternatively you could use your pcmcia init.d script
  115. to restart the cardmgr, or you could just reboot). The driver
  116. module will be loaded as needed by the cardmgr.
  117. You may wish to edit the options passed to the gpib_config call in the
  118. /etc/pcmcia/linux-gpib-pcmcia script.
  119. o) USB devices
  120. USB hotplug scripts will be installed into /etc/hotplug/usb if they do not already exist.
  121. You may wish to edit the GPIB_CONFIG_OPTIONS in the hotplug script for your device.
  122. You will also need to install firmware files for your device, a tarball is available from
  123. http://linux-gpib.sourceforge.net/firmware/. Make sure you have
  124. the "hotplug" and "fxload" packages installed on your computer. The hotplug system
  125. will automatically upload the firmware to your device and load the driver module when
  126. the device is plugged in. If you have errors, check your system log files (not dmesg)
  127. for messages from the hotplug scripts.
  128. E) Trying it out
  129. ----------------
  130. You may find the examples/ibtest program useful as a starting point in trying
  131. out your setup.
  132. F) Bindings for other languages
  133. -------------------------------
  134. The bindings to other languages will be enabled by default in the
  135. './configure' script. They will not be built if you disable
  136. them with the appropriate configure option, or if the necessary
  137. header files/libraries are not found on your machine.