• Please review our updated Terms and Rules here

VGA video RAM as regular memory

Cosi

Member
Joined
Mar 17, 2024
Messages
31
Location
Poland
Howdy,

my setup is pretty exotic (?): an IBM PC clone with a whopping 128k RAM (expandable only with a dedicated card) and a Trident TVGA card with... 512k video RAM, which made me think about using part of this memory as general-purpose RAM. After googling a bit I found lots of shareware tools (called 704K, ADDMEM, etc.) doing just that – using the A0000-B7FFF space as a natural expansion of the lower memory. The thing is, they all need 640k to be installed on board (perhaps to maintain continuity?).

Do you know of any tools/hacks that somehow "remap" this upper RAM or otherwise make it accessible on systems with less than 640k? I'm not afraid of assembly, so if there's a theoretic way to achieve that, I may try to write a program doing that, but I don't even know where to start.
 
My initial gut feeling is 'no' - as the real-mode CPU does not have a transparent memory management unit (as such).

I did once use a 486 CPU to directly address 4MB of EXTENDED RAM from real mode DOS... But I was pulling a few tricks...

Dave
 
Well, I was hoping that the primitive architecture of the 8088 would play to my advantage – a custom INT 67h handler here or there... 😄

But yeah, that was to be expected. I guess I'll have to hunt for an expansion card compatible with the Model M. Thanks, Dave!
 
After googling a bit I found lots of shareware tools (called 704K, ADDMEM, etc.) doing just that – using the A0000-B7FFF space as a natural expansion of the lower memory. The thing is, they all need 640k to be installed on board (perhaps to maintain continuity?).

I've got a utility from Quarterdeck called "VIDRAM" installed on my VGA card-equipped Tandy 1000 that *can* actually use VGA memory to (temporarily) give you an extra 64K on top of your base 640K for text-only programs by using RAM on the VGA card, so, yes, you can strictly speaking use VGA memory to run programs from, but... yeah, the issue in your case is that however much RAM you have on your VGA card the only place in the system's memory map it can be exposed is inside the area actually decoded by the VGA card's hardware. Graphics memory for EGA/VGA modes is page-swapped in the 64K Axxxx window, and they can also map memory into the Bxxxx page where the legacy MDA and CGA text and graphics modes live. Within that area a VGA card with 512K or 1MB or whatever can choose different regions of said memory to expose, but it has no ability to linearly map those pages of RAM outside of that one access window.

Anyway, that's why you can use a program to give you that one little bit of additional bonus conventional memory if you already have 640K, but otherwise it's of no use for that. In theory I suppose you could write a program that *directly* used VGA memory pages for data, or even write a fake EMS driver to allow some programs that can use that kind of memory to use it (although I think it'd be pretty ugly and slow, akin to the bad EMS emulators for converting XMS memory on 286 systems without memory mappers), but that doesn't help you a lot.

But yeah, that was to be expected. I guess I'll have to hunt for an expansion card compatible with the Model M. Thanks, Dave!

I would hazard a guess that the extremely common clones/workalikes of the Lo-Tech 1MB RAM card should work fine for you?
 
Thanks for the detailed reply, Eudimorphodon!

Anyway, that's why you can use a program to give you that one little bit of additional bonus conventional memory if you already have 640K, but otherwise it's of no use for that. In theory I suppose you could write a program that *directly* used VGA memory pages for data, or even write a fake EMS driver to allow some programs that can use that kind of memory to use it (although I think it'd be pretty ugly and slow, akin to the bad EMS emulators for converting XMS memory on 286 systems without memory mappers), but that doesn't help you a lot.
That was my thinking. I even tried to modify programs so that they use that region for their code and/or data, but the former (setting CS to A000 in the EXE header) crashed the emulator (I didn't dare run them on real HW) and I couldn't find programs loading data from files straight to DS (Arkanoid was the closest I could find, but the data file was too large and it overflowed to B800).

I would hazard a guess that the extremely common clones/workalikes of the Lo-Tech 1MB RAM card should work fine for you?
Very likely (the XT-CF works fine), but my Model M is a weird beast so it's still a gamble :)
Anyway, I'll probably take a risk and get myself one.
 
That was my thinking. I even tried to modify programs so that they use that region for their code and/or data, but the former (setting CS to A000 in the EXE header) crashed the emulator (I didn't dare run them on real HW) and I couldn't find programs loading data from files straight to DS (Arkanoid was the closest I could find, but the data file was too large and it overflowed to B800).

Life is going to be more complicated than that if you really wanted to try this. VGA cards don’t just statically have RAM mapped across the whole A0000-BFFFF area all the time; most VGA cards when they just wake up only map 32K to the CGA buffer location (or the mono text buffer location at B000 if they’re in mono mode), and there are arcane limits about how the memory is actually exposed. There is a register setting for mapping the whole space, but unless you have other things set up correctly many (most?) cards will give you two copies of the same 64K window, and all of this takes special pleading to be able to use this memory while also continuing to display *anything*, which is why VIDRAM limits you to *text* mode only.
 
What kind of "IBM PC clone" is this that has ISA slot(s) but maxes out at 128K of RAM on the motherboard? An original Tandy 1000?
 
Life is going to be more complicated than that if you really wanted to try this. VGA cards don’t just statically have RAM mapped across the whole A0000-BFFFF area all the time; most VGA cards when they just wake up only map 32K to the CGA buffer location (or the mono text buffer location at B000 if they’re in mono mode), and there are arcane limits about how the memory is actually exposed. There is a register setting for mapping the whole space, but unless you have other things set up correctly many (most?) cards will give you two copies of the same 64K window, and all of this takes special pleading to be able to use this memory while also continuing to display *anything*, which is why VIDRAM limits you to *text* mode only.
Ha, I didn't know that. I knew that the VGA video RAM is banked (which makes sense since there's only a 64k-long "factory default" region defined and used by the VGA standard) and, obviously, that you cannot switch to a VGA mode unless you want to ruin the data stored there, but I though that the A0000-AFFFF would be available by default (and only bank-swapped upon sending a request to a VGA port).
Well, at least I tried!

What kind of "IBM PC clone" is this that has ISA slot(s) but maxes out at 128K of RAM on the motherboard? An original Tandy 1000?
It's a Leading Edge Model M, but apparently one of the earlier units. People say that they were PC clones, but mine has 7 ISA slots (one more than the Model M motherboard shown here) and a 1.2M-capable FDC. They also have an onboard RTC, and the newest version of BIOS supports (S)VGA cards.
The documentation says that a "dedicated expansion card" is required to upgrade memory, so I'm wondering how compatible the memory controller is with those from the IBMs (=whether a modern expansion card like the Lo-Tech one would work).
 
Does that model of Leading Edge use an 8086 and have specialized 16-bit memory slots? A few oddball PC near clones tried that. I can't quickly find anything about the earliest Leading Edge machines.

If it doesn't have special memory slots, I suspect that it will run with any standard 8-bit memory card that could fit in the case.

I vaguely remember a video card that offered a RAMDISK to use up the excess RAM on board. As a historical aside, IBM considered making the home version of the IBM PC use the memory of the CGA card as system memory with a motherboard that had no memory installed. Fortunately, the idea was quickly dropped.
 
Does that model of Leading Edge use an 8086 and have specialized 16-bit memory slots? A few oddball PC near clones tried that. I can't quickly find anything about the earliest Leading Edge machines.

If it doesn't have special memory slots, I suspect that it will run with any standard 8-bit memory card that could fit in the case.
No, it has an 8088-2 clocked at 7.16 MHz and an 8-bit ISA bus. The problem is, there's an expansion slot on some motherboards (see "P7" on the schematics I linked to in my previous post) described as a "32-bit external memory card". On my motherboard there's only a placeholder (or not even that; there are 3 small patches of solder next to the label, so maybe it's something else), but I wouldn't bet on my computer's memory controller accepting a third-party RAM expansion in an ISA slot...
 
There are definitely gotchyas in play if the machine has a proprietary memory slot. The "Model M" seems to be an OEM machine that was sold under several names and the information about it on the web seems pretty sparse. That said…

No, it has an 8088-2 clocked at 7.16 MHz and an 8-bit ISA bus. The problem is, there's an expansion slot on some motherboards (see "P7" on the schematics I linked to in my previous post) described as a "32-bit external memory card". On my motherboard there's only a placeholder (or not even that; there are 3 small patches of solder next to the label, so maybe it's something else), but I wouldn't bet on my computer's memory controller accepting a third-party RAM expansion in an ISA slot...

How hard would it be for you to actually post a photo of the motherboard with sufficient detail to make out the actual memory bank configuration? (And the type of chips currently occupying the sockets.)

That motherboard diagram that’s floating around makes it look like that model has just a single bank for 256k of RAM. You say your unit has 128K, which raises questions because with standard RAM chips you’d need to have 2 banks of 64K chips. The only way that could possibly fit on the board if it’s laid out like that diagram would be if that one row of sockets it has are actually for 4 banks of 64kx4 chips and yours is only half populated. (*)

(* unless they did something evil and it has one bank of “half-bad” 256kx1 chips. The practice of using half-bad chips wasn’t rare in the 1970’s but was mostly dead by the PC clone era.)

Anyway, the thing that’s going to determine whether you can use a RAM card in a slot is if the switches on the motherboard telling it how much RAM it has control the range decoded by the onboard memory+whatever’s in the proprietary slot, or if they’re there to tell a dumb BIOS that lacks a RAM count routine how high to set the top of memory and the onboard decoder will *always* clash with a card decoding the conventional memory space.
 
How hard would it be for you to actually post a photo of the motherboard with sufficient detail to make out the actual memory bank configuration? (And the type of chips currently occupying the sockets.)
Sure thing, I'll take some photos later this week! But with this one you can trust me: I do have 128k of RAM. There are only 18 4164 chips (parity bits!) in two rows; that's all there is, no placeholders on the motherboard, no empty sockets. The diagram that's floating around is either a second-hand work, created from a photo or the original technical reference, or there are several types of Model M motherboards (Larry/@ldkraemer from this forum has an M, maybe he can chime in).

Anyway, the thing that’s going to determine whether you can use a RAM card in a slot is if the switches on the motherboard telling it how much RAM it has control the range decoded by the onboard memory+whatever’s in the proprietary slot, or if they’re there to tell a dumb BIOS that lacks a RAM count routine how high to set the top of memory and the onboard decoder will *always* clash with a card decoding the conventional memory space.
Well, the documentation (from the Internet, might be inaccurate; see the attached file) says that SW1/SW2 determine "TOTAL SYSTEM MEMORY" and the switch located on the add-on card controls the amount of the upgrade.
There's also a section describing the add-on card (two sections, actually, for two cards??):
These switches merely enable a row of memory: SW1-1 enables
bank 1, SW1-2 enables bank 2, etc. Although this card is hard-wired
to have a starting address of 128K (2000h), it can be used with a
later 256K system board by disabling bank 1 (turning off SW1-1 on the
memory card).
and:
Users should normally set both boards for the maximum memory size
(this will ENABLE the entire board). The system switches SW1 and SW2
will actually tell the system how much memory is installed and usable.
 

Attachments

  • M-10.txt
    32.2 KB · Views: 0
Sure thing, I'll take some photos later this week! But with this one you can trust me: I do have 128k of RAM. There are only 18 4164 chips (parity bits!) in two rows; that's all there is, no placeholders on the motherboard, no empty sockets. The diagram that's floating around is either a second-hand work, created from a photo or the original technical reference, or there are several types of Model M motherboards (Larry/@ldkraemer from this forum has an M, maybe he can chime in).

Here's a thread on the forums asking about what appears to be the Sperry branded version of this machine; there a photo (stored on Google Drive) of the motherboard linked in that thread, does yours match it? It looks a lot more similar to what you're describing about yours, such as the fact it has 2 banks of 4164s and nothing like that proprietary memory card connector in the middle of the board.

I'm going to hazard a guess here based on the fragmentary information that's out there about this machine that it'll work perfectly fine with something like the lo-tech 1MB board. There's a thread on Vogons showing one of the later models that *does* have the proprietary memory connector working fine with 640K with that connector empty and a normal ISA RAM card in a normal expansion slot, which seems to strongly indicate the machine only decodes the address space for the "onboard" RAM card if it's actually present and enabled. Aaaand, based on what little exists out there that seems to reference this older model it looks like it may have just used an ISA slot card for all of its expansion memory in the first place. I think the only question in my mind is if the BIOS will just see the memory and recongize it automatically, or if you'll have to adjust those switches.

Of course I could be wrong and your machine could spontaneously combust. :)
 
That's exactly my motherboard – apparently it's not as exotic as I thought 😄

Thank you for all your help, Eudimorphodon! I guess I'll take the risk (even if it means a firework show).
Most likely I'll have to adjust the switches (just like I'd do with the proprietary card).
 
Anyway, the thing that’s going to determine whether you can use a RAM card in a slot is if the switches on the motherboard telling it how much RAM it has control the range decoded by the onboard memory+whatever’s in the proprietary slot, or if they’re there to tell a dumb BIOS that lacks a RAM count routine how high to set the top of memory and the onboard decoder will *always* clash with a card decoding the conventional memory space.
It's been a long time since I was close to an ISA bus, and so my memory may be faulty, but wasn't the ISA bus just the system bus, with gated buffering between it and the CPU?

If so, it seems to me that you just stick your ISA RAM card in it, jumper it to start after the onboard memory, and you're set. It doesn't make any difference if the decoding logic is also trying to enable RAM on an expansion card that isn't there: the no-there RAM will do nothing, and the CPU will read what's placed on to the address bus by the ISA card RAM.
 
If so, it seems to me that you just stick your ISA RAM card in it, jumper it to start after the onboard memory, and you're set. It doesn't make any difference if the decoding logic is also trying to enable RAM on an expansion card that isn't there: the no-there RAM will do nothing, and the CPU will read what's placed on to the address bus by the ISA card RAM.

It’s not quite that simple. Typically the actual RAM chips on a motherboard (and/or slave memory card, those are usually direct extensions of the motherboard ram decoding and RAS/CAS generation) are behind a bidirectional data bus buffer, and in some designs that buffer will always be enabled for the entire *possible* range of the onboard memory, regardless of whether all the sockets behind it are filled or not. This will load the data bus with phantom values (usually “1”’s, but it can vary) for the empty sockets that will conflict with any ISA card also trying to assert itself on the bus.

I’m about 80% sure the IBM 5150, for instance, has this issue, IE, you have to fill all the motherboard sockets with RAM before you can use a memory card to top off the rest.

(* To be clear, it doesn’t look like this is likely to be a problem with either type of this leading edge system; there’s photo evidence from a Vogons thread showing the 256K version of the board working with an external memory card, and this version appears at least like it was designed to use an ISA card for more than 128k regardless.)
 
Last edited:
I’m about 80% sure the IBM 5150, for instance, has this issue, IE, you have to fill all the motherboard sockets with RAM before you can use a memory card to top off the rest.
Confirmed. Supporting diagram at [here].

IBM changed things in the move to the IBM 5160 (IBM XT). In the IBM 5160, the two RAM related motherboard switches in SW1 now enable/disable motherboard RAM banks.

The 5150's populate-motherboard-RAM-banks-first rule can be found in some RAM/multifunction card manuals, an example extract shown at [here].
 
Back
Top