Convert Unneeded VRAM Into A Storage Device
Pawel Kot writes "Have you ever thought why does your graphics card has so much memory? Do You think you have not enough RAM or awfully slow swap file? Do you need fast ram-disk or diskless machine? Go for it! Take one of these cheap 128MB graphics cards and enjoy the speed. Michal Schulz wrote a good description on how to take the advantage of not used video card memory."
Isn't this a bit wasteful? I mean you can buy 128mb of memory for a LOT cheaper than one of those "ultra cheap 128mb graphics cards".
I'll stick with buying RAM and using my graphics card for what it was designed for. Besides...this only applies to X users anyway.
-Julius X
remove "-whatkindofspamdoyoutakemefor-" from email to send
If you're THAT low on memory, you're not likely to have a 128 meg video card.
Or a 64 meg card, even.
-l
Cool! Finally I have somewhere to store my Quake 3 savegames - on the spare memory of my laptop's 16meg graphics card!
Or maybe not...
If you can't see this, click here to enable sigs.
If you HAVE a new 128 mb video card (which isn't that cheap!), you probably also have a fast processor and motherboard, and lots of memory anyway.
I strongly doubt you would buy a fast processor with an agp motherboard (needed for the card), and desperately needed memory so badly, that you take from the 128 mb video card.
is it just me, but as i was trying to decipher the english in the post, i could just hear him saying, "Hi, have you ever thought why does your graphic card has so much memory?"
i usually could care, but this post reads like ghetto yoda.
There's nothing Intelligent about Intelligent Design.
...How to use that "cheap" P4 as a, err, inexpensive coffee warmer.
So what if it's cheaper to buy ram, or that it's not effecient or what not. Half the hacks posted on Slashdot tend to be next to useless anyways.
It's a cool hack, simple as that.
The AGP interface is much faster than the memory interface on most recent intel based machines. I do computer vision where a bunch of scratch pad memory is required - the memory on the graphics card is fast and can interlace with acces to main memory. Rumour has it many games take advantage of this. In Linux you can do it with X stuff and in Windows you can use DirectX to do it.
Would the speed of the VRAM be affected by the AGP read back bandwidth issue? I'm looking for the story that was posted on slashdot a while back, but the search function is less than adequate.
On another note, this would be usefull for older machines that only have SIMMS and use EDO/FP RAM which is a lot more expensive than todays SD/DDR RAM. But, alas, those old machine don't have AGP ports. So, really, I don't see the point to this.
Cthulhu Saves.
I guess, since you can't use your texture RAM in Linux anyway (unless you want to watch 3d screen savers), you might as well put all the RAM on that GeForce 4 to use somehow.
- A.P.
"Remember when the U.S. had a drug problem, and then we declared a War On Drugs, and now you can't buy drugs anymore?"
Here's some instances...
/tmp on headless servers? (Its common to leave a video card in headless servers for maintanance).
I just happen to have a nVidia geForce2go which I'm using in vesa mode becasue the nvidia module is proprietary...
Now I can swap to the video memory I'm not using and put that memory to use.
How about using that video memory for
I just don't understand why people are so negative when people have come up with a new way to show just how flexible the linux kernel can be... just because some feature doesn't meet your needs doesn't mean it doesn't meet mine.
If you want a one size fit all solution, then try some of those companies in the northwest part of the country.
VRAM can be read and written at the same time - at least on the video card. And it should be possible to use the video hardware to blit around chunks of memory very quickly. I wonder if there are any algorithms (apart from those to manipulate a bitmapped display) which could be specially coded to take advantage of this hardware?
-- Ed Avis ed@membled.com
This goes to show how virus authors's creativity evolves pretty fast, its funny how nowadays someone is showing how to use VRAM for legitimate purposes. Who would have known? Those crazy VXers thought of it first.
"The lesson to be learned is not to take the comments on slashdot too literally." --Vinnie Falco, BearShare
Is probably better.
The best option, however, would be to not pick on the grammar skills of an English-as-a-second-language writer, unless you care to put your Polish language skills on display for us all.
Say you want the hide "data", outside of normal memory. This a great way to add secure memory.
Write a fast bitblit routine to erase the "hidden memory. Use the graphic engine to add real time xor of crypto keys.
Don't think of it as just memory but think of it as secret memory.
Shaun
Most of the drivers and TSRs that I wanted to load in the space originally allocated for monochrome video (a 32K block between B0000 and B7FFF) required more space to load than to run so I came up with the solution of 'borrowing' some VRAM and wrote the Video Hole package to do just that. I used a BIOS call to change the display page from 0 to 6 (for reasons I never quite understood, 7 didn't work on my old Trident 8900) and 'borrowed' 24000 bytes (6 pages of VRAM) from the VRAM to allow a program (say MSCDEX?) to fit in there, then 'recalled' the loan, changing back to page 0. That extra 24K more than took care of the transient portion of a lot of programs that otherwise couldn't use the Video Hole.
I don't know if anyone else ever used the darned thing (nobody ever sent me the $5 shareware fee for doing so) but it got uploaded to a bunch of BBSes and works in the real mode phase of Win95 and 98 - if you have hardware with real mode drivers that don't know how to load low and relocate the resident portion high, it will do the job fine.
[100% ISO 646 Compliant]
SVM, ERGO MONSTRO.
I used a similar technique on my XT compatible after I upgraded it with a VGA card with 256KB of RAM on it (long after everyone had thrown away their XTs). So long as you managed to avoid writing into the visible screen, a lot of it could be used for storage (with a bit of work on the page selection registers). I still have that machine. It's got 640k on the main board, 256k on the VGA, and 2 MB on an EMS 4.0 board. (2.875 MB total) There were times when I used every byte.
Of course there's a big difference between boosting a maxed out XT and expanding the capacity of your P4 2.8Ghz from 2GB to 2.064GB.
Support SETI@home
Yeah, right.
The guy probably spent *days* figuring this thing out, and, for what? Who will use this? What value does it provide? It's a cool hack, sure, but it serves no point. If you're going to hack something, at least make the end result worthwhile.
Some people love hacking their cars, but they don't use their gas tank to hold their washer fluid simply because it's possible to do so.
- A.P.
"Remember when the U.S. had a drug problem, and then we declared a War On Drugs, and now you can't buy drugs anymore?"
not_cub
q='echo "q=$s$q$s;s=$b$s;b=$b$b;$q"';s=\';b=\\;echo "q=$s$q$s;s=$b$s;b=$b$b;$q"
Although Alan Kay et. al. designed the Xerox Alto to use 80% of its resources for the Graphical User Interface (the real innovation -- understanding that the purpose of the computer is its user interface), SmallTalk needed extra memory and used the bottom part of the screen video memory for its stack. As a result, you could see when something crashed or went into infinite recursion.
Just kidding. No one would be nasty and put viral code where no scanner has gone before.
Belief is the currency of delusion.
Basically Apple is finding a use for all of that VRAM while users are futzing around not playing 3D games. Granted, it's finding interesting ways to accelerate 2D video and using the AGP to pull from main RAM as well, but it's in the same sprit as stuffing random data in there.
Rather than buy an extra card for this purpose, the question to ask is how much of that 128MB am I using day-to-day. If the answer is *none* (as Apple determined) then this is a good thing.
wow! 128 megs of ram! for the low low price of only $400!!!! yeah, maybe in 1994!
I've often wondered why operating systems today require so much RAM in the first place. Most people just want to browse the web, check their email, and perhaps play some music. Why does Windows, or any other OS, require such resources to pull off these relatively simple tasks?
Ouch! The truth hurts!
i think this technique is for the geel of it, not really for the practicality.
Never heard this one before. If it's a typo you may have just coined new jargon.
Stop worrying about the risks of nuclear power and start worrying about the risks of not using nuclear power.
My old amiga could do this. My A1200 had 2 megs of vram and when its 8 megs of fast ram was used up the system would often start moving into that memory. Thing is it slowed down the computer considerably.
Even my A3000 can do this with Cybervision (RTG software) once fast ram was used up it could use the memory on the video card as zorro expansion memory (ie memory attached to the system expansion bus).
Neat thing was it did this all dynamically and automatically - without you having to specify space or anything.
IF you have a program that can write outside that space for graphics operations, and you remap just about everything, you could theoretically get most of the first meg as conventional -- in theory only or in short run tests where you don't care what works or how well it works.
A firewall can not protect you from yourself. Turn off what you do not need. Do not use the firewall to do your work.
I don't know about anyone else in here, but I actually plan on trying to implement this. We all seem to be overlooking one great big niche here: servers. I run an AMD K6-II as my server, it has a single stick of 128 MB RAM. It also has an old 4 MB video card in an AGP 2x slot, that means I can add 4 MB of 132 MHz RAM, totalling my physical RAM out to 132 MB. No, that isn't very much, but hey, do I run X on my server?
No.
Do I have a video card sitting in my AGP slot?
Yes.
Is there a legitimate reason -not- to use that card for something at least?
NO!!!
Sure, my desktop has 512 MB RAM, and 64 MB VRAM, I don't need to dip into that extra RAM, but for my server, that's 4 more MB that I have available now before I have to access a terribly slow swap file. Besides, isn't this the main use of *NIX anyway, webserving? All modern PCs have AGP slots now, if you run your own server, and it has a PII or newer, chances are good it has AGP support, at -least- 1x. Chances are also good you have a video card lying around. So why not do something cool with it, rather than collect dust?
Just a thought guys.
now if only i could find "one of these cheap 128MB graphics cards" so I could "enjoy the speed"
a way to use the unused processor power of that gfx card to run an extra seti@home ;-)
This is actually a fairly common practice in Gamecube programming, only using audio ram. The GC has a measly 24 Megs of main ram and a whopping 16 Megs of audio ram. The transfer is reasonably fast, and it certainly makes it easier to port a PS2 engine which from the PS which has 32 Megs. There was an article in Game Developer not too long ago about automating this as virtual ram using the PowerPC's memory-mapping capabilities rather than the manual approach usually taken.
There are 0x40000000 types of people: those who understand 32-bit IEEE 754 floating point, and those who don't.
I have got a Pentium 200 MMX with 128 Mb of ECC EDO, no free memory slots. It sounds quite fair to buy a 64 Mb PCI graphics card for less than $100, if I could use like 60 Mb for fast swap.
BUT: What if I put 60 MB swap on this fast VRAM-swap, and another 256 MB swap on an old, rotten and slow IDE drive? Will Linux detect that the first swap is faster and make extensive use of it, or will the slow 256 MB swap ruin my performance anyways?
I never said that you couldn't do the same thing in Windows. I said that it speaks well of the UNIX APIs that such obscure functionality can be access through entirely generic APIs. The fact that you can just go ahead and use standard mmap functions to map random bits of memory is genuinely cool to those (like me) who value some elegence and beauty in software architecture. And thanks for the great example, by the way. DirectX is exactly what I'm talking about. Specific APIs to access generic functionality. Why should I have to use a different API to map graphics memory vs mapping regular memory vs mapping a file? Its just not clean! But it characterizes the Windows way of doing things.
PS> As for the comments about my intelligence and my spelling:
1) I've known DirectX since I was in the tenth grade. Learned Win32 just after I learned the C++ standard library.
2) I just got off summer break, it was late at night, and I was typing that on a laptop keyboard, so fuck off!
A deep unwavering belief is a sure sign you're missing something...
Yeah, right.
Video memory typically starts at A000, and can start lower. Video ROMs are typically at C000-C800. B000-B800 is for monochrome (MGA). With that trivia out of the way...
While the book you quote is good, you're out of your element. For one, I don't need to quote his book as I was there and know what I'm talking about .
Loading something somewhere means nothing if it can't survive there. Adapters can initialize from A000-10000h without warning the OS or memory manager. This means corrupted programs or data. To use one piece of memory or another required much machine-specific tinkering. To use a contiguous block required quite a few rare circumstances.
Loading anything above 1M leads to the program thinking (rightly) that it is still in the first meg. -- and it will attempt to write into the first meg if it can be executed at all. Usually, it can't. _DOS_ programs in the first meg run in real mode meaning that they will do things that are illegal in protected mode unless rewritten. _All_ programs above the first meg run in protected mode or don't run at all. (Nit: A small space called the HMA at 1M+ through 1M+~64K can still execute in real mode, though they would have to be patched or they would still attempt to write into the first 64K.)
Once you handle all those problems in your code you end up with a protected mode program that no longer needs real mode. No real mode, no reason to use the first meg -- just allocate the memory from the OS/memory manager and let it mess with the first meg if it needs to. That's why DOS sucked so bad -- no memory to do jack unless you avoided it entirely.
I worked at Qualitas -- makers of 386MAX (similar to QEMM). I debugged and tested MAX, compressed system BIOSes, a seperate 286 memory manager (yes, they existed), and a memory diagnostics program (RamExam). Shulman's book is a wee bit thicker because of the work that I and a few others at Qualitas did using debuggers that could do odd things like boot DOS from DOS -- not a big deal now, but an unreal thing to design back in the day unless you had specialized hardware.
A firewall can not protect you from yourself. Turn off what you do not need. Do not use the firewall to do your work.