Building the device driver requires a configured kernel source tree. The source tree should be for the same version of the kernel that the device driver will be loaded into. This is usually, but not necessarily, the same version as the running kernel. In the following instructions it is assumed that it is. 1. Make sure you have a kernel source tree. a. Red Hat `rpm -q kernel-source' b. Debian `dpkg -s kernel-source' c. Slackware ?? d. Suse ?? e. All else fails: look for the file `/usr/src/linux/Makefile' or `/usr/src/linux-2.4/Makefile'. You should use kernel sources that come with your distribution. Most distributions patch up the kernel and therefore the kernel that comes with a distribution will not in general match the canonical version from ftp.kernel.org. 2. Make sure that the running kernel version matches the source tree version. You can determine the running kernel version with the command $ uname -r 2.4.18-3 The source tree version is defined by four variables at the top of the top-level kernel Makefile (`/usr/src/linux/Makefile' or `/usr/src/linux-2.4/Makefile'). For example, kernel 2.4.18 as patched by Red Hat for version 7.3 of their distribution would have the following lines at the top of the top-level Makefile: VERSION = 2 PATCHLEVEL = 4 SUBLEVEL = 18 EXTRAVERSION = -3custom A kernel built in this source tree would have version 2.4.18-3custom. Note that the word "custom" has been appended to the version and will cause a version mismatch with the running kernel. Since this is the *only* difference between the running kernel version and the source tree version, it is safe to edit the Makefile and remove the word "custom" from the EXTRAVERSION variable. 3. Make sure that the kernel source tree is configured. If the file `/usr/src/linux/.config' or `/usr/src/linux-2.4/.config' doesn't exist, then a. Configure the kernel sources by hand: run 'make config', 'make menuconfig' or 'make xconfig'. This runs the risk that the resulting kernel configuration will not match the one used by your distribution in essential ways (e.g. symbol versioning). -or- b. (Preferred method) Find the configuration used by your distribution and copy it to the file `/usr/src/linux-2.4/.config'. The configuration file is sometimes found in `/boot/config-2.4.18-3' (substitute your kernel version number) or in the directory `/usr/src/linux-2.4/configs'. For example, on a single CPU i686 Red Hat system, you could # cp /boot/config-2.4.18-3 /usr/src/linux-2.4/.config After you copy a configuration file into the kernel source tree, you must also run # cd /usr/src/linux-2.4 # make oldconfig 4. Generate the dependency files: # cd /usr/src/linux-2.4 # make depend 5. Now you can build the device driver and utility programs using one of two possible methods. The first is just a conventional source build. $ gunzip -c at6n00-1.0.1.tar.gz | tar xf - $ cd at6n00-1.0.1 $ ./configure $ make # make install (The last step above requires root privileges.) Alternatively, on Red Hat (or other rpm-based distros), you can build an rpm and then install that: # rpm -tb at6n00-1.0.1.tar.gz # rpm -Uvh /usr/src/redhat/RPMS/i386/at6n00-1.0.1-1.i386.rpm (Both steps above require root privileges.) 6. Configure the IRQ and IOPORT address for each installed at6n00 device. For example, if you have a single AT6400 using IO address 0x300 (768 decimal) and IRQ 3, then you would edit the at6n00 options line in the file `/etc/modules.conf' to read options at6n00 major=60 irq=3 port=0x300 (The major number might be something other than 60 -- this is determined by the configure script at build time). The device entry point `/dev/at6n00a' will correspond to this device. Note that these numbers must match the settings on the DIP switches on the card itself (see the installation guide provided by Compumotor), and must not conflict with the settings of any other active device in the system (run `cat /proc/ioports' and `cat /proc/interrupts' to see what is currently in use). If you have two AT6400s using IO addresses 0x300 and 0x308 and IRQs 3 and 4, then you would edit the line to read options at6n00 major=60 irq=3,4 port=0x300,0x308 The device entry point `/dev/at6n00a' will correspond to the first device (IRQ 3 and port 0x300) and the device entry point `/dev/at6n00b' will correspond to the next device (IRQ 4 and port 0x308). You can configure up to four devices this way. 7. Load the operating system into all the configured devices. The osload utility is provided for this purpose. If `AT6400.OPS' is the file containing the operating system image (provided by Compumotor with the indexer), then the command to load the operating system is # osload AT6400.OPS /dev/at6n00a and it should be repeated for all configured devices (`/dev/at6n00b', `/dev/at6n00c' etc.). Note that if you used the RPM build/install method, then a shell script was added to /etc/rc.d/init.d that will load the AT6400 operating system automatically on boot.