3 ms·
Sound cards had to have IRQ #, IO port base address, and often a DMA channel. The IRQs were handled by the PIC controllers, usually two with the secondary pigg
by xenadu02 10y ago
Sound cards had to have IRQ #, IO port base address, and often a DMA channel.
The IRQs were handled by the PIC controllers, usually two with the secondary piggybacking on the main controller's IRQ #2. This was how the hardware could signal to the software that it wanted attention. The sound driver needed to know what interrupt to listen for or it would never reply to the sound card's requests. It was setup this way because these were physical pins! If you look at the ISA slot pinout there are physical traces for IRQ 3-7. 16-bit ISA slots added pins for IRQ 10-14. A bunch of IRQs were permanently assigned from the old IBM PC days which is why turning off COM ports in the BIOS would free up the IRQ for use by other peripherals. I seem to remember having a card at one point that was 8-bit, but had a little extension off the end with a couple of traces for 16-bit slot support only so it could support higher IRQs; The manual told you not to use IRQs > 9 if plugged into an 8-bit slot.
The IO port base address is directly related to the article: It selected where in main memory the device was memory-mapped. Writes to that address would cause the device to latch onto the bus and start receiving data. Anything not in the appropriate range was ignored even though all devices technically received the signal electrically. If the driver had the wrong address it would either write to unmapped memory (not that there was an MMU so the data words just went by on the bus without any listeners). Or worse: the write went to a different device that might ignore what it considered malformed data, but in many cases would do random things, scribble on memory, or just blast the bus and cause a lockup. IO base addresses were pre-assigned to peripherals like COM and LPT ports too but they were not in such high demand compared to IRQ or DMA channels; still in some BIOSes you could change the COM port's base address which would make it show up as COM3 instead of COM1 for example.
The DMA channel was exactly what it sounds like: the system had a limited number of direct channels to the memory controller. Often the protocol for a sound driver was to write a "Read audio from address XYZ, length X" to the IO port. The sound card would use the DMA channel to read the audio from that address. Then it would signal an interrupt when it finished so the driver could submit the next batch of samples.
You usually configured ISA cards by setting jumpers on the card. The available jumper settings were usually much narrower than the hardware supported so conflicts were more common.
PCI still used the physical IRQ system but had a protocol for devices to negotiate available settings with BIOS on startup.
PCI express uses a higher-level protocol abstraction. An interrupt is just a special message on the bus and doesn't have any dedicated pins.
- digi_owl 10y agoSome later ISA cards also supported "negotiation", iirc. It was marketed as plug and play, but often referred to as plug and pray (because sometimes the result would be less than useful). Also made DOS drivers downright massive!
- korethr 10y agoI remember those 'Plug and Play' ISA cards. The PnP bit never worked, I eventually hard set the IRQ, IO port and DMA channel directly to get sound working, and that was that. At least, until the Windows95 install was messed up enough that it was time to reinstall again.
- cabaalis 10y agoSee? There are people who actually know and fully understood all this stuff and then there are guys like me who just played with the numbers until it worked. :) I applaud you
- digi_owl 10y agoAnd sometimes it feels like this is still the way to fix MS products, rote memorization of magical incantations. Right now i am trying to figure out what it is that makes a Windows 10 tablet i own lose the content of dropdown menus. All i get is the "drop shadow" frame around them, if that. Funny thing is that if i fiddle with the screen resolution it sorts itself out, for a while. F-ing black box computers...
- yuhong 10y agoWe now use the APIC. The first APICs had only 16 interrupts, but with the introduction of 82093AA in 1996 they now have 24 interrupts separating the ISA and PCI ones completely.
- pimlottc 10y agoOh man, IRQ and DMA numbers, there's another set of optimizations for your boot disk. Some games would require your sound card to be on a certain IRQ, or only give a limited number of options. Of course, your other devices like your mouse, CD drive, modem or network card need interrupts too, leading to the dreaded IRQ Conflict error message. DMA channels were even more limited but thankfully fewer devices needed them and programs tended to be less picky about which ones you chose.