Next Previous Contents

7. Resources

It is very important that the resource settings you specify in the isapnp.conf file avoid conflict with any other devices, Plug and Play or otherwise. If you fail to do this, the system may fail to work properly, crash, or lock up.

7.1 Determining resource usage (linux).

The easiest way to avoid conflict is to make a list of all the devices in your system and the resources they use.

To help in this task, try booting the system with no PnP devices configured, then examine the resources the kernel is using via the proc filesystem (which must be mounted, obviously).

You can also follow these instructions after configuring the PnP hardware and loading the appropriate driver modules to check that the drivers have been configured properly.

To check the proc file system is mounted, type mount at the shell prompt, and somewhere in the response should be a line similar to the one in the example below:

$ mount
...
/proc on /proc type proc (rw)
...
$

From now on, I shall assume you have the proc filesystem is mounted on proc/. In addition, if you use driver modules you should ensure that they are all loaded so that they grab the resources they require. You may want to print the results obtained below:

To see what IO addresses are used, type "catproc/ioports/". This will provide a list of IO ports and the drivers that use them.

To see what interrupts are used, type "catproc/interrupts/". This must be done with all your devices in use, (for example, mount a floppy disk so that the floppy disk interrupt is in use, and open all the serial ports, for example using the command "(cat < dev/ttyS1) &/").

To see what DMA channels are used, type "catproc/dma/".

Note also that some device drivers do not allocate resources unless a process has opened the device. This is normally the case for the floppy driver and serial drivers for example. This means that the above commands will probably not locate all the resources used by all the hardware, so you may still have to change some resource allocations to get things to work.

Another useful command to try is

dmesg | grep -i irq

which will trawl through the kernel bootup messages for lines containing irq. This finds resources used by kernel drivers.

These commands will give a good idea of which resources are in use, but they may miss something if the device doesn't have a driver for example, or the BIOS has allocated the resources for some other purpose. So it is a good idea to check the BIOS settings when rebooting - particularly look for interrupt lines allocated to PCI devices, you may want to deallocate some of these if your PnP card needs a interrupt.

Another possibility is to use the --dumpregs command to pnpdump to see what the BIOS has allocated.

For further information on standard motherboard resource settings and interrupt assignments, see the pc-hardware-faq (posted regularly to the comp.sys.ibm.pc.hardware.* news groups).

7.2 I've configured the card but the /proc entries haven't changed.

The /proc filesystem only reports resources actually in use by a driver.

So for example, if you configure a modem, nothing will change. If you then run setserial, to tell the kernel driver about the new port, you will see the IO ports in use in /proc/ioports, but there will still be no change in /proc/interrupts. It's only after you OPEN the serial port for the modem that the modem IRQ will be registered as in use.

Similarly, if you configure a device which uses a kernel module driver, nothing will change until you load the driver module, and even then, not all the resources the device uses may be shown as used. Some resources (particularly IRQ and DMA channels) will only be shown in use after a program opens the device and starts using it.

7.3 I've got a ..., which runs fine under Win95, how can I find out the port settings ?

Using the PEEK command in an isapnp script allows the existing configuration register settings to be examined. Assuming that the settings don't change between booting Win95 and booting Linux, this script can be used to find the settings.

If you boot straight into Linux, some devices may not be configured.

To find out the card settings, and then to generate a script to reproduce them, follow these instructions:

  1. To find out what configuration registers the card has, you must first run pnpdump with the two optional arguments. With pnpdump from release 1.12 or later you don't need the additional two arguments, though a single argument may be useful to set the READPORT address. See README.DOS for instructions on how to obtain the READPORT address that Win95 uses.
  2. Then examine the output to identify the number of logical devices, and the resources used by each one. For this it is best to pipe the pnpdump output through grep to remove most of the comments thus:
    pnpdump 2 0x3bb | grep -v '# [ A-Z]' | grep -v '^#$' | grep -v '^$' > pnpdump.res
    
    On my system I have two cards, and pnpdump.res looks like this:
    # 
    # (DEBUG)
    (READPORT 0x03bb)
    (CSN 2)
    (IDENTIFY *)
    (CONFIGURE EDI0119/236861364 (LD 0
    # (IO 0 (BASE 0x0240))
    # (INT 0 (IRQ 3 (MODE +E)))
    # (MEM 0 (BASE 0x0c0000) (MODE bu) (UPPER 0x0c4000))
    # (MEM 0 (BASE 0x0c0000) (MODE br) (UPPER 0x004000))
    # (ACT Y)
    ))
    (CONFIGURE DFX0000/1493 (LD 0
    # (IO 0 (BASE 0x02f8))
    # (INT 0 (IRQ 3 (MODE +E)))
    # (IO 0 (BASE 0x02f8))
    # (INT 0 (IRQ 3 (MODE +E)))
    # (IO 0 (BASE 0x02f8))
    # (INT 0 (IRQ 3 (MODE +E)))
    # (IO 0 (BASE 0x03e8))
    # (INT 0 (IRQ 3 (MODE +E)))
    # (IO 0 (BASE 0x03e8))
    # (INT 0 (IRQ 3 (MODE +E)))
    # (IO 0 (BASE 0x02e8))
    # (INT 0 (IRQ 3 (MODE +E)))
    # (IO 0 (BASE 0x02e8))
    # (INT 0 (IRQ 3 (MODE +E)))
    # (IO 0 (BASE 0x03f8))
    # (INT 0 (IRQ 4 (MODE +E)))
    # (IO 0 (BASE 0x03f8))
    # (INT 0 (IRQ 3 (MODE +E)))
    # (IO 0 (BASE 0x03f8))
    # (INT 0 (IRQ 3 (MODE +E)))
    # (ACT Y)
    ))
    (CONFIGURE DFX0000/1493 (LD 1
    # (DMA 0 (CHANNEL 3))
    # (DMA 0 (CHANNEL 1))
    # (DMA 0 (CHANNEL 4))
    # (ACT Y)
    ))
    
  3. Edit this to remove the duplicates, remove the ( ACT) commands, uncomment each resource and change the resource assignment commands to ( PEEK), thus:
    (READPORT 0x03bb)
    (CSN 2)
    (IDENTIFY *)
    (CONFIGURE EDI0119/236861364 (LD 0
    (IO 0 (PEEK))
    (INT 0 (PEEK))
    (MEM 0 (PEEK))
    ))
    (CONFIGURE DFX0000/1493 (LD 0
    (IO 0 (PEEK))
    (INT 0 (PEEK))
    ))
    (CONFIGURE DFX0000/1493 (LD 1
    (DMA 0 (PEEK))
    ))
    
    This shows the ethernet card (EDI0119/236861364) has a single logical device which uses one each IO, INT, and MEM resource, while the PnP modem (DFX0000/1493) has two logical devices:
    1. ( LD 0), which uses an IO resource, and an INT resource,
    2. ( LD 1), which uses a single 8 bit DMA channel.
  4. Run isapnp on this script, and the following output is obtained:
    Board 1 has Identity 13 0e 1e 37 b4 19 01 89 14:  EDI0119 Serial No 236861364 [checksum 13]
    Board 2 has Identity 6e 00 00 05 d5 00 00 d8 10:  DFX0000 Serial No 1493 [checksum 6e]
    Peek(EDI0119/236861364)[0][0x60](IO  0) is 0x0340, (3,64)
    Peek(EDI0119/236861364)[0][0x70](INT 0) is 0x0A02, (10,2)
    Peek(EDI0119/236861364)[0][0x40](MEM 0) is 0x0000000000000000, (0,0,0,0,0,0,0,0)
    Peek(DFX0000/1493)[0][0x60](IO  0) is 0x03E8, (3,232)
    Peek(DFX0000/1493)[0][0x70](INT 0) is 0x0C02, (12,2)
    Peek(DFX0000/1493)[1][0x74](DMA 0) is 0x04, (4)
    
    From this you can see that the modem card is configured at IO address 0x3E8, and uses interrupt 12. The 2 in the bottom half of the INT register means +ve edge trigger and is unlikely to ever be different. The DMA channel is set to 4, which means DMA not used.

    Also you can see that the ethernet card is configured at IO address 0x340, and uses interrupt 10. The MEM resource is all 0, which means it is not used.

  5. So to program these cards like this, use the script:
    (READPORT 0x3bb)
    (CSN 2)
    (IDENTIFY *)
    (CONFIGURE EDI0119/236861364
            (LD 0
                    (IO 0 (BASE 0x0340))
                    (INT 0 (IRQ 10 (MODE +E)))
                    (ACT Y)))
    (CONFIGURE DFX0000/1493
            (LD 0
                    (IO 0 (BASE 0x3e8))
                    (INT 0 (IRQ 12 (MODE +E)))
                    (ACT Y)))
    (WAITFORKEY)
    

7.4 Examining Win95 resource settings.

Alternatively, for the device of interest:

  1. Right click on My Computer
  2. Click on Properties->Device Manager
  3. Select the device of interest, then click on Properties->Resources.

    Make a note of the resources used.

7.5 The windows CTPNP.CFG file.

Some machines may have a CTPNP.CFG file containing PnP resource information. Have a look. If you've got one, it may be best to use the READPORT address in there.

7.6 How can I prevent pnpdump allocating certain resources with the -c flag.

Get isapnptools 1.16 or later, and put the resources you want to avoid in the /etc/isapnp.gone file.

7.7 Common problems

The usual source of conflicts in the sound card with something else, tyically the network card. This is because network cards like to be at addresses 0x300,0x320,0x340,etc, and sound cards use IO addresses all over the place, including (in my system) 0x0220-022f, 0x0330-0333, 0x0388-038b.

If you have a system with a network card, and then add a sound card later, it is quite likely that the network card is using addresses 0x0320-033f which will be clobbered by the sound card. The solution is to move the network card, and in my system I have it at 0x0340-035f.

Another common problem is to forget to configure one or more of the cards resources. This is particularly likely with sound cards which require so many. See How can I find out how the card is configured ? to see how you can check these.

7.8 What does isapnp mean by "Fatal - resource conflict allocating DMA1".

This means you are trying to allocate DMA1 to a PnP device, but the DMA resource has already been allocated to another device.

Similar messages can occur for IO ports or interrupts.

You need to find out what other device is using the resource, in case it turns out that the device you are trying to configure has already been configured by the BIOS, and a kernel driver has found it and is using it.

To find out what is using it, look in /proc/dma, /proc/ioports, /proc/interrupts as appropriate, or /etc/isapnp.gone.

If it is in use by another (different) device, then you must change your resource allocation.

If is in use by the device you are trying to configure, then you probably don't need to configure the device using isapnptools. Simply make sure the kernel driver settings match those allocated by the BIOS.

7.9 Do I have to configure all the devices.

No. More modern BIOSes seem to configure almost all devices, so you don't need to run isapnptools at all. If a device is not configured how you want, you can just reconfigure that one. Note that if you do reconfigure a device, it must not have a driver running on it. This means the driver must not be built into the kernel, and any driver modules for the device must be unloaded.

7.10 How can I reconfigure a device.

See also Do I have to configure all the devices.

Reconfiguring a device is almost the same as configuring one. Points to watch out for are:

  1. A device driver must not be using the device. This means you must unload the driver module. If the device driver is built into the kernel, and it has detected the hardware, you must not reconfigure the device.
  2. If you want to IO range CHECK the device, you must remember to deactivate it first. See What does "IO range check attempted while device activated" mean (from isapnp) ?.


Next Previous Contents