RTLab LiveCD ISA PNP Tools -------------------------- This is a floppy disk supplemental release. It is an ext2 floppy image containing the isapnptools programs. The reason for this disk image is that isapnptools was erroneously omitted from the root filesystem of the RTLab LiveCD 0.64.6, thus making it impossible to get NI AT-MIO series boards working when booted off the LiveCD. If you own such a board, and you want to use it with the RTLab LiveCD, you need to use the isapnptools programs (from this floppy disk) in order to configure the board properly (which is a required step before you can use the ni_atmio COMEDI driver). Below is a step-by-step overview of this process. *** Note: it is extremely difficult for novice users to configure ISA devices using isapnptools! I should have written a probe tool to automate this proces for all ISA COMEDI boards. Look for the next version of the RTLab LiveCD, which will solve this problem! Email me for help or if you are stuck: 1. Download the floppy image (isapnptools.img.bz2). 2. Uncompress the floppy image: Linux -- bunzip2 isapnptools.img.bz2 Windows -- use a program that supports .bz2. I think WinRAR might. 3. Copy the uncompressed floppy image to a floppy disk: Linux -- dd if=isapnptools.img of=/dev/fd0 Windows -- Obtain the program RAWRITE.EXE from somewhere and use that. 4. Boot onto the RTLab LiveCD. When you are able to get into a shell, mount the floppy disk: mount /dev/fd0 /mnt/floppy cd /mnt/floppy 5. Run pnpdump to get a sample isapnp.conf file: ./pnpdump > /tmp/isapnp.conf 6. Look at the isapnp.conf file you just generated and see what it expects of you. If you don't know how to configure ISA devices using isapnptools, email me and I will help you. It helps if you attach: a. your isapnp.conf file b. the contents of /proc/ioports and /proc/interrupts c. make sure they come from the rootfs/kernel of the booted LiveCD. The general idea with isapnp is that one tool, pnpdump, reads the ROMs off your ISA cards and generates a description/config file which you then edit and pass back to the complementary tool, isapnp, as input. Properly doing this is an artform, as well as a science. If you are lucky, you just need to uncomment the appropriate sections of the isapnp.conf file generated by pnpdump, since it may pick good defaults that actually work. Howevever, they usually _DON'T_ work, and you have to manually figure out what values are safe for ISA PNP configuration. It's a chore, and I really think that the authors of isapnptools could have done better, (like they could have auto-resolved conflicts for you and by default generated a valid config file rather than the file you do get which doesn't work at all without manual intervention). Whatever the case, the goal is to pick configuration values for your ISA card. Things like: IO Base address, IRQ, and DMA. There are some constraints on these values. Satisfying those constraints is where the art and science of this arcane processs come in. The constraints are that usually: the IO range and the IRQ should not conflict with any other devices on your system. You can look in /proc/ioports to see what ranges are already reserved on your computer. The isapnp.conf file will tell you that it needs such-and-such IO range, which is X bytes long and should live in a certain IO address range. For example, my isapnp.conf file says: # Start dependent functions: priority acceptable # Logical device decodes 16 bit IO address lines # Minimum IO base address 0x0020 # Maximum IO base address 0xffe0 # IO base alignment 32 bytes # Number of IO addresses required: 32 # (IO 0 (SIZE 32) (BASE 0x0020) (CHECK)) This means I need 32 bytes anywhere from 0x0020 to 0xffe0. That's a big address space -- almost 16kb. I can have any 32 bytes I want in this space, but I have to find a 32-byte range that doesn't overlap with any other range already being used on the system (by another board, presumably). For instance, in /proc/ioports you will see a bunch of ranges that you can't use. Pick a range that isn't covered by any of the ranges listed. So for instance if you need 32 bytes anywhere in the address space of 0x0020 to 0xffe0 (the isapnp.conf file itself will indicate the max and min values), and you think that 0x1000 as the base might be ok (i.e.: you don't see it anywhere in /proc/ioports), then you need the entire range of 0x1000-0x1020 (32 bytes) to be unreserved in /proc/ioports. In other words, for the base address of 0x1000, make sure nothing in the range 0x1000-0x1020 is listed in /proc/ioports. Then, if you are happy, you just need to remember the BASE of this IO range, or 0x1000 in our example. As far as interrupts go, you usually can pick from a set like 3, 5, or 7, etc. Again, the comments in the isapnp.conf file will tell you what the acceptable values are. Look in /proc/interrupts and pray none of the interrupts your board can accept is taken. The isapnp.conf file is really well commented so with some intuition and luck just reading that file may help explain more of this bizarre process. 7. Once you have decided on an ioport range and IRQ (and possibly a DMA channel), uncomment the appropriate sections of /tmp/isapnp.conf to indicate your selection. You may have to edit the IO line and pick a correct BASE derived as illustrated in step (6) above. ** Don't forget to uncomment the ACT Y line in the isapnp.conf file or else your selection is ignored! 8. Tell isapnp to use the configuration file you just edited: ./isapnp /tmp/isapnp.conf 9. If you were extremely lucky and configured the card correctly, your NI AT-MIO ISA board is now ready to talk to COMEDI. 10. Run rtlab-setup and pick the ni_atmio driver. When the setup program asks your for a config string for this driver, tell it: XX,YY,ZZ Where: XX is the IO Base address you picked in step (6) above, (eg 0x1000) YY is the IRQ you picked in step (6) above (eg 3) ZZ is the DMA you picked in step (6) above (eg 0) Good luck and sorry for the terse instructions! Again, please email me if you have trouble with your ISA-PNP setup. In the next version of the RTLab CD, we will be using a newer COMEDI package that will have ISAPNP support from the Kernel device drivers, so this stuff won't be necessary as ni_atmio.o will automatically setup your ISAPNP card. Calin Culianu October, 2003