VOGONS


First post, by Gahhhrrrlic

User metadata
Rank Member
Rank
Member

I've been educating myself lately on how cards use resources and need IRQ/DMA/PORT assignments that don't conflict. While there is a wealth of info on this topic, surprisingly I have never seen video cards mentioned once. I would think out of all the things you could plug into a computer, the video card would want/need DMA at least. Don't know if it requires an IRQ or not. Anyway I was hoping someone could clear this up for me. I have an ATI VGA Wonder card and don't know if I need to reserve an IRQ/DMA/PORT for it. If I do it's going to be a challenge since I'm out of IRQs already with my other devices using them all but that's all the more reason to know the answer to this question. Thanks.

https://hubpages.com/technology/How-to-Maximi … -Retro-Computer

Reply 1 of 12, by Jepael

User metadata
Rank Oldbie
Rank
Oldbie

Usually this is not mentioned because usually it is not a problem - nearly all systems have a video card (there might be exceptions) and thus other cards are made to support only such resources that would conflict with video cards.

ISA video cards never use DMA, that's for sure.

They also do not require an IRQ, and not all cards even support IRQ, and software rarely needs IRQ support.
That said, EGA/VGA cards did have possibility to use an IRQ (same physical pin is IRQ2 on XT and IRQ9 on AT).

Memory area used depends on if it is a monochrome or color adapter as both can coexist, but generally memory segments A000-BFFF are reserved for video ram and C000-C7FF for video rom.

IO ports are too numerous to list here, take a look at HelpPC port listings or some other reference.
Again, monochrome adapters can coexist with color adapters so they all live on different ports in the range of 3B0 to 3DF.

Reply 2 of 12, by derSammler

User metadata
Rank l33t
Rank
l33t

I've never seen an ISA graphics card that uses an IRQ. IRQ usage was introduced with PCI graphics cards afaik and you could enable/disable it on the card via a jumper. Modern cards, however, always need an IRQ which should also not be shared, but for ISA, no.

Reply 3 of 12, by Gahhhrrrlic

User metadata
Rank Member
Rank
Member

Of course I have no reason to doubt you. If it doesn't need it, it doesn't need it. But I am confused as to why other ISA devices which are "less important" (or at least lower bandwidth) such as lan cards, sound cards, modems, etc., being ISA, still need IRQ/DMA/PORT assignment. It must not be merely a PCI thing as such. How does a video card communicate with the CPU without an interrupt and does it have direct access to memory? Not that this is important for my setup efforts but I'm just curious.

https://hubpages.com/technology/How-to-Maximi … -Retro-Computer

Reply 4 of 12, by derSammler

User metadata
Rank l33t
Rank
l33t

Quite simple: LAN cards, sound cards, modems, etc. need a way to tell the CPU that something needs to be done (e.g. LAN card or modem: get the received data from the buffer and move it to RAM). The graphics card however has no such functionality (speaking of simple ISA ones). Pixel data is just written to the frame buffer and drawn to screen by the RAMDAC. There's no need for the graphics card to interrupt the CPU.

Reply 6 of 12, by Scali

User metadata
Rank l33t
Rank
l33t
derSammler wrote:

There's no need for the graphics card to interrupt the CPU.

Actually there is, and most non-PC systems have this functionality.
At the very least you want to know when the vertical blank interval occurs. PCjr and EGA/VGA support this (see page 72 here: http://www.minuszerodegrees.net/oa/OA%20-%20I … s%20Adapter.pdf)
C64 goes beyond that, and can generate an interrupt on any scanline you want (for example when you want to do sprite multiplexing).
Amiga does even more than that: it has a special co-processor (copper) which can perform operations (including generating interrupts) anywhere on a scanline.

On PC it was rarely used, and the functionality was broken on some clones. But proper EGA/VGA cards do support it and use IRQ2/9.

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 7 of 12, by derSammler

User metadata
Rank l33t
Rank
l33t
Scali wrote:

Actually there is, and most non-PC systems have this functionality.

No offense, but we are not talking about C64, Amiga, and other non-PC systems here. The question was about ISA cards in a PC, and nothing else. And those do not need an IRQ.

Reply 8 of 12, by Scali

User metadata
Rank l33t
Rank
l33t
derSammler wrote:

No offense, but we are not talking about C64, Amiga, and other non-PC systems here.

It was just extra information, to put things in perspective. It is VERY common for graphics hardware to have IRQs.
It often helps to know more than one side of the story.

derSammler wrote:

The question was about ISA cards in a PC, and nothing else. And those do not need an IRQ.

No offense, but they do.
Read the manual I linked to.

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 9 of 12, by Gahhhrrrlic

User metadata
Rank Member
Rank
Member

I actually came across IRQ 2 and 9 and how they were used on the older display formats. They also had the curious property of working in tandem with each other, effectively prohibiting you from using either one. I don't understand why mind you but I wasn't going to use them anyway so if my ISA graphics card wants to use IRQs 2 and 9, it's welcome to 😀

Interesting to come across sprite multiplexing again. I think the SNES used this (and maybe the Atari 2600?) to achieve some cool tearing effects mid-raster so you could get this kind of shearing effect on the sprite. I could be full of BS but I think that's how it worked. Anyway seems more or less absent most of the time on PCs, as mentioned.

https://hubpages.com/technology/How-to-Maximi … -Retro-Computer

Reply 10 of 12, by Scali

User metadata
Rank l33t
Rank
l33t
Gahhhrrrlic wrote:

I actually came across IRQ 2 and 9 and how they were used on the older display formats. They also had the curious property of working in tandem with each other, effectively prohibiting you from using either one. I don't understand why mind you but I wasn't going to use them anyway so if my ISA graphics card wants to use IRQs 2 and 9, it's welcome to 😀

This is because of the PC/XT vs AT design:
The PC and XT only had one interrupt controller, which allows for 8 interrupts (IRQ0-IRQ7).
Since this wasn't enough, IBM added a second interrupt controller to the AT (IRQ8-IRQ15).
The problem is, it is basically 'piggybacked' to the first interrupt controller (known as 'cascaded' configuration), because the CPU can only connect to a single interrupt controller. The second interrupt controller is actually connected to the first, as a 'device' with IRQ2.
So IBM rewired the AT so that the real IRQ2 now comes in on IRQ9 of the second controller.
This is why you often see 'IRQ2/9'. On a PC or XT it really is IRQ2, and on an AT it is IRQ9 cascaded back to IRQ2.
So the AT actually has 15 IRQs in total, not 16 as you might expect.

Gahhhrrrlic wrote:

Anyway seems more or less absent most of the time on PCs, as mentioned.

Yes, I don't know of any software that ever used it... But on many early cards you can't disable or reconfigure IRQ2, so it is 'in use' by the card.
On newer plug&play cards, you will find that they usually configure themselves to IRQ2 automatically on bootup.
But IRQs can be shared, and the EGA manual does point out that you need to poll the video status register to make sure that it was the EGA (or VGA) card that signaled the IRQ, before acting on it.
So any software/hardware that uses IRQ2 (it was also the default for MPU-401 for example) should check that the IRQ came from the device they are trying to use. In which case you'll be fine if the EGA or VGA card ever did signal an interrupt.
In practice it's never a problem, and you don't really have to care about it.

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 11 of 12, by Scali

User metadata
Rank l33t
Rank
l33t

By the way, since I dusted off my old 486 to do some Mode X and OPL3 coding anyway, I figured I'd test to see if it supports the EGA/VGA vertical sync interrupt. And indeed it does. Since it's an AT-class system, it comes in on IRQ9 as expected, rather than IRQ2.
This is on a Diamond SpeedStar PRO VLB card, Cirrus Logic CL5426 chipset if I'm not mistaken.

I also checked the IBM VGA/XGA technical reference from 1992, and they explicitly list the functionality there, so it is expected that proper VGA clones fully support this functionality, since IBM never removed it in VGA and XGA.

(For some reason, DOSBox only supports it for EGA, only when you set machine=ega)

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 12 of 12, by Scali

User metadata
Rank l33t
Rank
l33t

I've created a test-program to investigate this further, I've made a new thread for it here: The myth of the vertical retrace interrupt on EGA/VGA

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/