VOGONS


First post, by mogwaay

User metadata
Rank Newbie
Rank
Newbie

Hi all,

I've been testing a Trident TVGA9000i graphics card in my Xi8088 based computer, the https://github.com/moogway82/XTjr and it is doing some weird stuff.

Details on the card are:
Trident TVGA9000i-3 based with a 4.01E ROM. In an 8-bit ISA slot with jumpers set for 8-bit mode and Non-Interlaced modes. 256kb RAM. Electrolytics caps have been replaced as some seemed marginal on testing.

Firstly, as you can see in videos, it's detecting the display as Monochrome, but I'm not too worried about that at the moment as it's something to do with Pin 12 Monitor ID and I can work-around it using SMONITOR utility, it's been discussed here before (Problems with 8-bit TVGA9000 based ISA video card). [Aside: I had to GND Pin 12 as left floating machine wouldn't boot at all... I thought N/C Pin 12 would normally be the indicator for a colour monitor? Maybe this is a sign of a bad TVG9000i chip?]

The BIG issue I have at the moment is it locking up and DOS text is not scrolling vertically. When you get to the bottom of the screen, the machine just hangs. The boot process also doesn't scroll and just does a weird text cursor jumping around thing and lots of hidden and missing text - only XTIDE and Vid BIOS show text until SMONITOR and SVM in autoexec.bat run. I put the missing text down to monochrome being detected maybe, but the text screen scrolling issue is weird and super annoying.

Video showing the Boot Process and DOS crash:
https://youtu.be/jE3ijiIQbKM

Short Video showing just the crash in DOS on scroll"
https://youtu.be/r2nIx8Bm440

I can still run some programs however. The SVM utility for Trident cards to change the video mode works great and lots of the modes work fine when returning to DOS, however all hang when you reach the bottom of the screen. Prince of Persia's SETUP program works fine and the game runs great in VGA mode - I just get a black screen in CGA, and EGA mode. When exiting back to DOS, the machine hangs with a Black Screen. (I'm assessing machine-has-hung by whether it will soft reset Ctrl+Alt+Del). "E" PC-DOS's Edit replacement, runs fine too.

Video showing Prince of Persia running then crash on Exit:
https://youtu.be/M3li4vPQum4

TOPBENCH will show a grey screen and a flashing cursor on the left side of the screen 2/3rds down and hang.

Video showing TOPBENCH crash:
https://youtu.be/aBL3rvzN_dU

I've tried some of the other jumper settings on the card: 8/16-bit Memory use BIOS detect and Non-Interlaced and Interlaced, but seems to make no difference. Also, the computer works great with my 2 working EGA cards, no weird scrolling crashes there. I don't have another VGA card to test with yet.

I'd be really interested if anyone has seen something like this before with an old 8-bit PC with an ISA VGA card in DOS?

My XTjr has no DMA or 2nd PIC (no IRQs above 7). I'm sure DMA isn't a problem, not sure about 2nd Intterupt Controller, but pretty sure old VGA cards didn't do much with IRQs (IRQ 2 maybe).

My suspects are:
- ROM version, would like to try the 3.51 version, maybe 4.01E expects too much from the hardware of my XTjr?
- RAM - only has 256kb and maybe one of the banks are wonky (although surprised PoP works so well if that's the case...)?
- Bad TVGA9000i-3 chip - nowt I can do at that point 😉 but surpised that it still works so well in PoP VGA mode, but terrible in Text mode

Any thoughts are greatly appreciated, many thanks!
Cheers,
Chris.

Reply 1 of 7, by mogwaay

User metadata
Rank Newbie
Rank
Newbie

Working now, populated all RAM to 512KB and for some reason it works now. Don't know why that would fix it, but it did, so just going to enjoy that my 10MHz XT Clone is now a lovely retro game machine and not going to dwell on it too much 😀

Reply 2 of 7, by Datadrainer

User metadata
Rank Member
Rank
Member

Glad you have resolved your issue.
Your XTjr project is very interesting.
I never used a computer with less than 1 MB of RAM but I don't understand how a PC with less than 640 KB of RAM can work with cards that have an embedded BIOS as the reserved address space for the BIOSes is in the UMA. If a card need the range, by example, 0x0B0000-0x0B0FF to work and there is no memory here, how can it work ?

Knowing things is great. Understanding things is better. Creating things is even better.

Reply 3 of 7, by mkarcher

User metadata
Rank l33t
Rank
l33t
Datadrainer wrote on 2022-01-22, 20:52:

Glad you have resolved your issue.
Your XTjr project is very interesting.
I never used a computer with less than 1 MB of RAM but I don't understand how a PC with less than 640 KB of RAM can work with cards that have an embedded BIOS as the reserved address space for the BIOSes is in the UMA. If a card need the range, by example, 0x0B0000-0x0B0FF to work and there is no memory here, how can it work ?

The 640KB of RAM is exactly what is *not* in the UMA, that is 0000..9FFF (all addresses in my reply are segment addresses, i.e. you need to extend the start address with an extra 0 and the end address with and extra F to obtain byte addresses). In the PC/XT system, the area A000..FFFF is reserved for special-purpose memory (like network card buffers, video memory, BIOS extensions and finally the mainboard BIOS). A card with a BIOS chip just puts the BIOS contents on the XT bus (= the 8-bit ISA bus) when it is adressed. The Area you cite, B000..B0FF is half of the MDA video memory. The MDA card has its own memory which can be accessed between B000 and B1FF. This is why you don't need mainboard memory for that card to work.

Reply 4 of 7, by Datadrainer

User metadata
Rank Member
Rank
Member
mkarcher wrote on 2022-01-22, 21:45:
Datadrainer wrote on 2022-01-22, 20:52:

Glad you have resolved your issue.
Your XTjr project is very interesting.
I never used a computer with less than 1 MB of RAM but I don't understand how a PC with less than 640 KB of RAM can work with cards that have an embedded BIOS as the reserved address space for the BIOSes is in the UMA. If a card need the range, by example, 0x0B0000-0x0B0FF to work and there is no memory here, how can it work ?

The 640KB of RAM is exactly what is *not* in the UMA, that is 0000..9FFF (all addresses in my reply are segment addresses, i.e. you need to extend the start address with an extra 0 and the end address with and extra F to obtain byte addresses). In the PC/XT system, the area A000..FFFF is reserved for special-purpose memory (like network card buffers, video memory, BIOS extensions and finally the mainboard BIOS). A card with a BIOS chip just puts the BIOS contents on the XT bus (= the 8-bit ISA bus) when it is adressed. The Area you cite, B000..B0FF is half of the MDA video memory. The MDA card has its own memory which can be accessed between B000 and B1FF. This is why you don't need mainboard memory for that card to work.

Okay ! The range I gave was randomly given in the area of the upper memory as an example.
Thank you very very much for the answer @mkarcher. So if I understand correctly, the whole thing comes to light. The UMA (0xA0000–0xFFFFF which is 640KB to 1 MB) is not mapped to RAM chips, so if any chip in the bus want to use this space it can. The software just need to read or write there to program the chips reading there (that maybe chip registers or on board expansion memory I think). That is why it is important to avoid addressing overlap. So that means from the point of view of a memory expansion board of, say, 1 MB you literally loose 384 KB. And now I understand too how programs such as HIMEM and EMM386 works. They allow to remap UMA unused parts to the RAM so some programs can be loaded there (or in HMA the same way). I think I understand too why some programs have to be specially programmed to work in such way as some code still should exist in the base memory at least as an entry point to load the rest.
Splitting the address space was common on a lot a hardware, but I don't know why, for me the PC BIOS had to be in charge to detect and copy the expansion board BIOS to the RAM.
It was an interesting think on how it works. Please correct me if I am wrong somewhere. My first PC was a 486 with MS-DOS 6.0, so MEMMAKER was my friend and I had just a limited knowledge of how thing worked behind especially from an electronic point of view.

So, to go back to the Trident problem of @mogwaay, if the card require a specific address range in the UMA, that should be RAM independent, so why the screen freezes when trying to scroll when there is not enough RAM? Could the BIOS of the computer allocate arbitrary space in the UMA for some embedded chip of the motherboard depending of the amount of RAM installed creating an overlapping with the BIOS address space of this card?

Knowing things is great. Understanding things is better. Creating things is even better.

Reply 5 of 7, by mkarcher

User metadata
Rank l33t
Rank
l33t
Datadrainer wrote on 2022-01-23, 09:45:

The UMA (0xA0000–0xFFFFF which is 640KB to 1 MB) is not mapped to RAM chips, so if any chip in the bus want to use this space it can. The software just need to read or write there to program the chips reading there (that maybe chip registers or on board expansion memory I think). That is why it is important to avoid addressing overlap.

You got it. To make it even more clear, write it as "is not mapped to mainboard RAM chips". The UMA may very well be mapped to RAM chips. For example RAM chips on the MDA card, the CGA card, selectable areas of EMS cards or network card packet buffer RAM.

Datadrainer wrote on 2022-01-23, 09:45:

So that means from the point of view of a memory expansion board of, say, 1 MB you literally loose 384 KB.

Usually, you don't. In the 80s, you couldn't afford losing 384KB, RAM was way too expensive for that. Instead, there was some hole in the address space. The original IBM AT, if equipped with 1MB RAM used a memory layout consisting of 512KB conventional memory (from 0KB to 512KB) and 512KB extended memory (from 1024KB to 1536KB), with no memory between 512KB and 1024KB. This has the advantage of being easy to implement: You can build a 512KB bank from 18 chips (including parity) of 256K x 1 each, and you wire up one bank as conventional memory and the second bank as extended memory.

The original AT memory layout wasn't DOS-friendly, as you don't even get 640KB for DOS programs. You could at a 128KB ISA memory card to expand the conventional memory to 640KB. Also some later memory expansion cards had the option to map 128KB of their memory space into that range, a feature usually called "backfill".

Later AT-compatible mainboards used chipsets wth more complex addressing schemes, which were generally able to to split 1MB of memory into 640KB of conventional memory and 384KB of extended memory, so you are not using actual memory, even though you have a hole in the address space.

And now I understand too how programs such as HIMEM and EMM386 works. They allow to remap UMA unused parts to the RAM so some programs can be loaded there (or in HMA the same way).

You need to get a bit more into detail to understand the different options of memory management. HIMEM actually doesn't do anything about the UMA. HIMEM does two things: It configures the computer for HMA access, and tracks whether the HMA is in use or free (typically, you allocate the HMA to the DOS kernel using DOS=HIGH, so the HMA is in use all the time). It also contains a driver that allows copying memory between the standard 1MB XT-like address space and XMS at higher addresses. The straightforward way to do that is temporarily switching to protected mode to be able to access all the 16MB of the 286 address space (or 4GB of the 386 address space), and indeed, that's what DR-DOS HIMEM.SYS DOS. On the other hand Microsoft's HIMEM used a special undocumented debugging feature of the 286 processor, called "LOADALL" to circumvent the need to switch to protected mode.

HIMEM does not remap any memory at all. The only thing you could somehow call "remapping" is that HIMEM disables a PC/XT compatibility mode that makes the address space wrap around at FFFF:000F back to 0, so you get nearly 64KB of extra memory at FFFF:0010..FFFF:FFFF, which would alias to 0000:0 to 0000:FFEF on a classic PC/XT system.

There were 286 boards which allowed to not remap the whole 384KB of RAM "behind the UMA" to XMS, but instead map some of that RAM into the UMA. The NEAT ("New Enhanced AT") chipset by Chips & Technologies is a well-known example for this. If your board supports making memory available at UMA addresses, or you have RAM cards that put RAM into that range, you can make DOS aware of that memory using a UMB driver. Typical examples of drivers that enable UMBs on certain chipsets and tell DOS about it are UMBDRVR.SYS and UMBPCI.SYS. If the RAM is already available, and you just need to tell DOS about it, USE!UMBS.SYS is a minimal driver that does just that. The important point is that up to now we are talking about memory that actually is at addresses in the UMA area on the system bus.

EMM386 works in a completely different way: The 386 processor has a feature that allows software-controlled remapping between memory addresses seen by DOS software (or any other 16-bit software) and physical addresses on the bus. This enables multitasking of individual DOS environments, by providing different memory mappings for different "DOS VMs". Providing multiple DOS VMs is not implemented in EMM386, but is used in the windows 386 enhanced mode, or by DESQView, and this is why this operation mode of the 386 processor is called "virtual 8086 mode". Nevertheless, the software-controlled remapping is used by EMM386 to emulate EMS and to map unused UMA space to RAM way past 1MB. EMM386 also provides the API to tell DOS where it remapped memory to to provide UMBs.

for me the PC BIOS had to be in charge to detect and copy the expansion board BIOS to the RAM.

This actually is a common thing to do when there is enough RAM available, but this is not done on old PC/AT systems. Copying of ROM to RAM is called "shadowing" and is used to provide faster BIOS execution. 386DX and 486 processors can access RAM 32-bits at a time, while only very few 386DX boards provide 32-bit access to the mainboard ROM BIOS, and you can't get 32-bit access to extension BIOSes located on ISA cards. Furthermore, typical ROM chips require extra wait states. So as performance optimization, the contents of the mainboard BIOS and expansion BIOS ROMs can be copied to RAM. There are two ways to handle it: Either the BIOS does it, with support from the mainboard chipset, which redirects certain areas of UMA to RAM instead of the ISA bus or the mainboard BIOS. Another way is letting EMM386 do it: EMM386 can also copy ROM to extended memory and use the memory remapping feature of the 386 processor to make it look as if the copy were at the UMA address which is actually occupied by the BIOS.

Datadrainer wrote on 2022-01-23, 09:45:

So, to go back to the Trident problem of @mogwaay, if the card require a specific address range in the UMA, that should be RAM independent, so why the screen freezes when trying to scroll when there is not enough RAM? Could the BIOS of the computer allocate arbitrary space in the UMA for some embedded chip of the motherboard depending of the amount of RAM installed creating an overlapping with the BIOS address space of this card?

The memory upgrade (from 256KB to 512KB) that made the system work applies to VGA memory, not mainboard memory. The Trident card always occupies selectable areas of the A000..BFFF space for video RAM access, and the C000..C7FF range for the video BIOS. The freezes were very likely completely unrelated to any UMA memory layout. Furthermore, the size of memory by itself doesn't matter, because everything the OP did doesn't require more than the 256KB of RAM which was already present on the original VGA.

The important point is that the original VGA card uses 32-bit memory access (by using 8 chips providing 4 bits at 64kilo-addresses, so all chips together provide 32 bits at 64 kilo-addresses, for a total of 256KB). The Trident chips mostly support up to 1MB of RAM (the 9000i-3 might be a cost-reduced version that is limited to 512KB), using different chips: They use chips that provide four bits each at 256 kilo-addresses. To equip a TVGA9000i-3 with 256KB of RAM, you just install two chips, which make 256 kiloaddresses, consisting of 8 bits each, so the TVGA chip can not access more than 8 bits at once. This acutally is a challenge for that chip, because the VGA programming model provides a multitude of memory access methods designed around the capability of accessing 32 bits of video RAM at once. When you upgrade a TVGA9000 card from 256KB to 512KB of RAM, you also upgrade the memory data path width from 8 bits to 16 bits, greatly reducing the stress on the TVGA chip. The freezes in the OP were most likely caused by the TVGA chip not being able to correctly handle the 8-bit RAM data path under certain access patterns (like scrolling), possibly the problems only occurs when video memory access and video BIOS access interleave (which is the case when the BIOS ROM scrolls text in the VGA RAM, unless the BIOS is shadowed (see above). The upgraded video RAM allowed the TVGA chip to handle the memory access in a way that works without problems.

Reply 6 of 7, by mogwaay

User metadata
Rank Newbie
Rank
Newbie
mkarcher wrote on 2022-01-24, 22:11:

The important point is that the original VGA card uses 32-bit memory access (by using 8 chips providing 4 bits at 64kilo-addresses, so all chips together provide 32 bits at 64 kilo-addresses, for a total of 256KB). The Trident chips mostly support up to 1MB of RAM (the 9000i-3 might be a cost-reduced version that is limited to 512KB), using different chips: They use chips that provide four bits each at 256 kilo-addresses. To equip a TVGA9000i-3 with 256KB of RAM, you just install two chips, which make 256 kiloaddresses, consisting of 8 bits each, so the TVGA chip can not access more than 8 bits at once. This acutally is a challenge for that chip, because the VGA programming model provides a multitude of memory access methods designed around the capability of accessing 32 bits of video RAM at once. When you upgrade a TVGA9000 card from 256KB to 512KB of RAM, you also upgrade the memory data path width from 8 bits to 16 bits, greatly reducing the stress on the TVGA chip. The freezes in the OP were most likely caused by the TVGA chip not being able to correctly handle the 8-bit RAM data path under certain access patterns (like scrolling), possibly the problems only occurs when video memory access and video BIOS access interleave (which is the case when the BIOS ROM scrolls text in the VGA RAM, unless the BIOS is shadowed (see above). The upgraded video RAM allowed the TVGA chip to handle the memory access in a way that works without problems.

Ahhh, this is very interesting. Yes it would make sense that the VGA card is having to do a lot to translate a lowly 8-bit memory bus to a 32-bit one - combined with an 8-bit bus running at 10MHz this may be a bit much for the poor Trident card. As it's also a homebrew computer, my bus may be noisier than a professionally designed machine - I'm no 80s IBM! 😉 I still get some graphical glitches in EGA mode, but no crashes, so I'm pretty happy with it. I'm going to test the memory some more to see if I got a failing new-old-stock 4x256 chip which might explain the glitches, but VGA modes look great and I can alway swap the VGA card out for my Paradise PEGA2 EGA card instead which works pretty good too.

Thanks for getting back to Datadrainer on his points. As I designed the chip selection logic and my own memory map for the XTjr, and I'm not interested in memory above 1MB, I didn't see memory mapping as much of an issue here, nothing on my system should respond to addresses A000-DFFF at the moment, so shouldn't be any overlap with the Graphics card's selection logic... Maybe I could've tried shadowing the VROM but would be sad to lose any of my precious 640KB 😀

Cheers!

Reply 7 of 7, by Datadrainer

User metadata
Rank Member
Rank
Member

@mkarcher
Thank you very much for your complete and clear explanation! Now, I think I have a relative good view on how the PC/AT and PC/XT address space is working and is used.
Splitting the memory in two parts and shifting the 2nd part to start after the first 1MB segment was indeed clever. I suppose it's simply done on the address bus wiring by a chip routing an address line.
I also have a better understanding of what was the real purpose of EMM386 and the like.
I was aware of the shadowing principle. But I was thinking that was done only because of the RAM being faster than the BIOS. It was only partially correct. So on a 80386SX I suppose accessing the BIOS is done on 16-bit, so to get 32-bit data it needs two clock cycles, meaning two time slower + a slower reading speed. But for 80386DX & 80486 it is only the reading speed. I suppose there is no writing in the BIOS, for what I know the BIOS functions are accessed by software interrupt using the CPU in real mode and that's all.
In conclusion old BIOSes were not smart at all. After all they where meant to be a basic resources management system (cf the name).

About the Trident. I have some Trident video boards myself, that's why I was interested in the thread. It's very interesting to learn how the memory is managed between the video chip and the video RAM. I suppose it is not uncommon to find such an implementation with other manufacturer.

@mogwaay
Good luck on your project!

Knowing things is great. Understanding things is better. Creating things is even better.