* Using video memory as system memory
@ 2002-04-09 22:24 Byron Stanoszek
2002-04-10 15:00 ` bill davidsen
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: Byron Stanoszek @ 2002-04-09 22:24 UTC (permalink / raw)
To: linux-kernel
I have an old 586 that has low memory and no ability for further upgrades.
I had an idea to use the framebuffer memory of a 32MB video card lying around
the office as system memory and implemented the following patch:
--- linux/arch/i386/kernel/setup.bak Tue Apr 9 02:52:19 2002
+++ linux/arch/i386/kernel/setup.c Tue Apr 9 03:04:38 2002
@@ -722,6 +722,8 @@
* to <mem>, overriding the bios size.
* "mem=XXX[KkmM]@XXX[KkmM]" defines a memory region from
* <start> to <start>+<mem>, overriding the bios size.
+ * "mem=+start-end" appends a new memory region from <start>
+ * to <end>. Values can be prepended with '0x'.
*/
if (c == ' ' && !memcmp(from, "mem=", 4)) {
if (to != command_line)
@@ -733,6 +735,14 @@
from += 8+4;
e820.nr_map = 0;
usermem = 1;
+ } else if(*(from+4) == '+') {
+ unsigned long long start, end;
+
+ start = simple_strtoull(from+5, &from, 0);
+ if(*from == '-') {
+ end = simple_strtoull(from+1, &from, 0);
+ add_memory_region(start, end-start, E820_RAM);
+ }
} else {
/* If the user specifies memory size, we
* blow away any automatically generated
Size text uses the first 256KB of video ram, and the framebuffer address
started at 0xfc000000, I tried the following option to effectively double
system RAM:
mem=+0xfa040000-0xfc000000
The first time I booted, the kernel said I should compile in HIGHMEM support
and everything booted with the normal memory maps. When compiling with HIGHMEM,
the computer stopped after displaying 'Uncompressing the kernel...done',
probably in a loop dealing with the memory table, since it stopped before
printing out the table.
Does the kernel support noncontiguous main memory like this, or is it just
plain impossible to use PCI-mapped memory as main memory?
Thanks,
-Byron
--
Byron Stanoszek Ph: (330) 644-3059
Systems Programmer Fax: (330) 644-8110
Commercial Timesharing Inc. Email: byron@comtime.com
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Using video memory as system memory
2002-04-09 22:24 Using video memory as system memory Byron Stanoszek
@ 2002-04-10 15:00 ` bill davidsen
2002-04-11 14:23 ` Pavel Machek
2002-04-12 7:54 ` Eric W. Biederman
2 siblings, 0 replies; 12+ messages in thread
From: bill davidsen @ 2002-04-10 15:00 UTC (permalink / raw)
To: gandalf; +Cc: linux-kernel
In article <Pine.LNX.4.44.0204091816380.13516-100000@winds.org> you write:
| I have an old 586 that has low memory and no ability for further upgrades.
| I had an idea to use the framebuffer memory of a 32MB video card lying around
| the office as system memory and implemented the following patch:
I believe I would have been tempted to define that memory as first use
swap or some such, the video memory may have different speed or
something than main memory. Low tech NUMA?
A lot of the old ISA memory cards could be addressed in that range as
well, allowing even more space. Of course they sell new motherboards
cheaply as well, so that might not be cost effective even at used
prices.
Intersting hack, though.
--
bill davidsen <davidsen@tmr.com>
CTO, TMR Associates, Inc
Doing interesting things with little computers since 1979.
^ permalink raw reply [flat|nested] 12+ messages in thread
* RE: Using video memory as system memory
@ 2002-04-10 15:43 Holzrichter, Bruce
2002-04-10 15:53 ` Byron Stanoszek
0 siblings, 1 reply; 12+ messages in thread
From: Holzrichter, Bruce @ 2002-04-10 15:43 UTC (permalink / raw)
To: 'davidsen@tmr.com', gandalf; +Cc: linux-kernel
> In article
> <Pine.LNX.4.44.0204091816380.13516-100000@winds.org> you write:
> | I have an old 586 that has low memory and no ability for
> further upgrades.
> | I had an idea to use the framebuffer memory of a 32MB video
> card lying around
> | the office as system memory and implemented the following patch:
I thought that this was interesting as well, and had a couple of questions,
as I am no expert in this stuff.
You don't have the frame buffer enabled for display when trying to use this
as system memory, correct?
Are there implications of the BIOS shadowing video memory to system memory,
or is that not an issue once Linux takes over memory control?
That is a neat idea, though. The PCI/AGP bus may be a limiting factor for
this as well, correct? As far as speed, I believe most video cards have
fast memory, vram, or sram, but it's only useful transferring between the
Video GPU, and Video cards memory, as the bus to the video card is the
bottleneck.
Just some random thoughts, cool idea, though..
Bruce H.
^ permalink raw reply [flat|nested] 12+ messages in thread
* RE: Using video memory as system memory
2002-04-10 15:43 Holzrichter, Bruce
@ 2002-04-10 15:53 ` Byron Stanoszek
2002-04-10 16:12 ` Geert Uytterhoeven
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: Byron Stanoszek @ 2002-04-10 15:53 UTC (permalink / raw)
To: Holzrichter, Bruce; +Cc: 'davidsen@tmr.com', linux-kernel
On Wed, 10 Apr 2002, Holzrichter, Bruce wrote:
> I thought that this was interesting as well, and had a couple of questions,
> as I am no expert in this stuff.
>
> You don't have the frame buffer enabled for display when trying to use this
> as system memory, correct?
Correct. :) In fact, text mode can only take a maximum of the first 256KB of
memory of the card (extended text paging). So as long as you only target the
rest of the memory (and don't use X or svgalib) you should be fine.
> Are there implications of the BIOS shadowing video memory to system memory,
> or is that not an issue once Linux takes over memory control?
Not that I'm aware of. This is PCI-mapped prefetchable memory.
> That is a neat idea, though. The PCI/AGP bus may be a limiting factor for
> this as well, correct? As far as speed, I believe most video cards have
> fast memory, vram, or sram, but it's only useful transferring between the
> Video GPU, and Video cards memory, as the bus to the video card is the
> bottleneck.
Yeah. In fact in some responses the 'slow speed' consideration was so much that
they all say I'd be better off writing a block driver and making use of the
memory more as a swap device rather than as system RAM.
Has anyone out there done this yet? I figure I'd ask before reinventing
anything.. :)
-Byron
--
Byron Stanoszek Ph: (330) 644-3059
Systems Programmer Fax: (330) 644-8110
Commercial Timesharing Inc. Email: byron@comtime.com
^ permalink raw reply [flat|nested] 12+ messages in thread
* RE: Using video memory as system memory
2002-04-10 15:53 ` Byron Stanoszek
@ 2002-04-10 16:12 ` Geert Uytterhoeven
2002-04-10 17:10 ` Bruce Harada
2002-04-11 11:28 ` Denis Vlasenko
2 siblings, 0 replies; 12+ messages in thread
From: Geert Uytterhoeven @ 2002-04-10 16:12 UTC (permalink / raw)
To: Byron Stanoszek
Cc: Holzrichter, Bruce, 'davidsen@tmr.com',
Linux Kernel Development
On Wed, 10 Apr 2002, Byron Stanoszek wrote:
> On Wed, 10 Apr 2002, Holzrichter, Bruce wrote:
> > That is a neat idea, though. The PCI/AGP bus may be a limiting factor for
> > this as well, correct? As far as speed, I believe most video cards have
> > fast memory, vram, or sram, but it's only useful transferring between the
> > Video GPU, and Video cards memory, as the bus to the video card is the
> > bottleneck.
>
> Yeah. In fact in some responses the 'slow speed' consideration was so much that
> they all say I'd be better off writing a block driver and making use of the
> memory more as a swap device rather than as system RAM.
>
> Has anyone out there done this yet? I figure I'd ask before reinventing
> anything.. :)
drivers/block/z2ram.c does this for RAM in the Amiga Zorro II space.
(Why? Because you cannot use Zorro II RAM as system RAM on machines equipped
with a Zorro III bus because on those machines Zorro II RAM doesn't support
read-modify-write cycles.)
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Using video memory as system memory
2002-04-10 15:53 ` Byron Stanoszek
2002-04-10 16:12 ` Geert Uytterhoeven
@ 2002-04-10 17:10 ` Bruce Harada
2002-04-12 11:54 ` Bruce Harada
2002-04-11 11:28 ` Denis Vlasenko
2 siblings, 1 reply; 12+ messages in thread
From: Bruce Harada @ 2002-04-10 17:10 UTC (permalink / raw)
To: Byron Stanoszek; +Cc: linux-kernel
On Wed, 10 Apr 2002 11:53:15 -0400 (EDT)
Byron Stanoszek <gandalf@winds.org> wrote:
<SNIP>
> Has anyone out there done this yet? I figure I'd ask before reinventing
> anything.. :)
I seem to recall some discussion about an almost identical idea a couple of
years ago, but I don't remember whether it was actually implemented or not.
You'll probably have to grovel through the list archives to find out.
Bruce
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Using video memory as system memory
2002-04-10 15:53 ` Byron Stanoszek
2002-04-10 16:12 ` Geert Uytterhoeven
2002-04-10 17:10 ` Bruce Harada
@ 2002-04-11 11:28 ` Denis Vlasenko
2 siblings, 0 replies; 12+ messages in thread
From: Denis Vlasenko @ 2002-04-11 11:28 UTC (permalink / raw)
To: Byron Stanoszek; +Cc: linux-kernel
On 10 April 2002 13:53, Byron Stanoszek wrote:
> Yeah. In fact in some responses the 'slow speed' consideration was so much
> that they all say I'd be better off writing a block driver and making use
> of the memory more as a swap device rather than as system RAM.
>
> Has anyone out there done this yet? I figure I'd ask before reinventing
> anything.. :)
I use google to search for Linux projects. Believe me: that is
*much* faster than asking on a mailing list.
--
vda
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Using video memory as system memory
2002-04-09 22:24 Using video memory as system memory Byron Stanoszek
2002-04-10 15:00 ` bill davidsen
@ 2002-04-11 14:23 ` Pavel Machek
2002-04-12 10:56 ` Pedro M. Rodrigues
2002-04-12 7:54 ` Eric W. Biederman
2 siblings, 1 reply; 12+ messages in thread
From: Pavel Machek @ 2002-04-11 14:23 UTC (permalink / raw)
To: Byron Stanoszek; +Cc: linux-kernel
Hi!
> Does the kernel support noncontiguous main memory like this, or is it just
> plain impossible to use PCI-mapped memory as main memory?
It might be possible (don't know why it does not work for you), but
bear in mind that PCI is *very* slow compared to your main memory.
[Oh, you might want to add that memory late in boot phase. At begining
of kernel boot, that area is probably not mapped, yet. PCI is
initialized later.]
Pavel
--
(about SSSCA) "I don't say this lightly. However, I really think that the U.S.
no longer is classifiable as a democracy, but rather as a plutocracy." --hpa
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Using video memory as system memory
2002-04-09 22:24 Using video memory as system memory Byron Stanoszek
2002-04-10 15:00 ` bill davidsen
2002-04-11 14:23 ` Pavel Machek
@ 2002-04-12 7:54 ` Eric W. Biederman
2 siblings, 0 replies; 12+ messages in thread
From: Eric W. Biederman @ 2002-04-12 7:54 UTC (permalink / raw)
To: Byron Stanoszek; +Cc: linux-kernel
Byron Stanoszek <gandalf@winds.org> writes:
> I have an old 586 that has low memory and no ability for further upgrades.
> I had an idea to use the framebuffer memory of a 32MB video card lying around
> the office as system memory and implemented the following patch:
There are significant speed differences between video card ram
and ram on a PCI card.
Setup an mtd device and use the video card ram for swap. It's
about 10 lines more code, is testable as a module, and is code that
is clean enough some variant of it might even get into the kernel.
Eric
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Using video memory as system memory
2002-04-11 14:23 ` Pavel Machek
@ 2002-04-12 10:56 ` Pedro M. Rodrigues
2002-04-12 11:35 ` Dr. David Alan Gilbert
0 siblings, 1 reply; 12+ messages in thread
From: Pedro M. Rodrigues @ 2002-04-12 10:56 UTC (permalink / raw)
To: linux-kernel
How fast can one drive a pci card video memory? I once came up with the
idea to use the video memory of a pci video card as a block device and use it to
put the journal from ext3. Of course it wouldn't be solid state like the cards in the
market, at least without a battery and some circuitry changes, and i dismissed
the idea as the result of too much caffeine in my blood.
/Pedro
On 11 Apr 2002 at 16:23, Pavel Machek wrote:
> Hi!
>
> > Does the kernel support noncontiguous main memory like this, or is
> > it just plain impossible to use PCI-mapped memory as main memory?
>
> It might be possible (don't know why it does not work for you), but
> bear in mind that PCI is *very* slow compared to your main memory.
>
> [Oh, you might want to add that memory late in boot phase. At begining
> of kernel boot, that area is probably not mapped, yet. PCI is
> initialized later.]
> Pavel
> --
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Using video memory as system memory
2002-04-12 10:56 ` Pedro M. Rodrigues
@ 2002-04-12 11:35 ` Dr. David Alan Gilbert
0 siblings, 0 replies; 12+ messages in thread
From: Dr. David Alan Gilbert @ 2002-04-12 11:35 UTC (permalink / raw)
To: Pedro M. Rodrigues; +Cc: linux-kernel
* Pedro M. Rodrigues (pmanuel@myrealbox.com) wrote:
>
> How fast can one drive a pci card video memory?
I guess these days you get limited by PCI speed; which for 33MHz/32 bit
is 133MByte/s - on a good day with a wind behind it. I guess AGP could
do a lot better.
Perhaps a more interesting question is what you can use the video cards
hardware for? Most video cards can blit to and from main memory - so
how about things like zero clearing pages with little processor
overhead. My gut feeling is that with PCI its probably still faster to
do it on the processor, not sure about AGP though. Be messy though!
> I once came up with the
> idea to use the video memory of a pci video card as a block device and use it to
> put the journal from ext3. Of course it wouldn't be solid state like the cards in the
> market, at least without a battery and some circuitry changes, and i dismissed
> the idea as the result of too much caffeine in my blood.
Yes, thats why you need to tie it up to the film camera.
Dave
---------------- Have a happy GNU millennium! ----------------------
/ Dr. David Alan Gilbert | Running GNU/Linux on Alpha,68K| Happy \
\ gro.gilbert @ treblig.org | MIPS,x86,ARM, SPARC and HP-PA | In Hex /
\ _________________________|_____ http://www.treblig.org |_______/
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Using video memory as system memory
2002-04-10 17:10 ` Bruce Harada
@ 2002-04-12 11:54 ` Bruce Harada
0 siblings, 0 replies; 12+ messages in thread
From: Bruce Harada @ 2002-04-12 11:54 UTC (permalink / raw)
To: bruce.holzrichter; +Cc: linux-kernel
On Thu, 11 Apr 2002 02:10:48 +0900
Bruce Harada <harada@mbr.sphere.ne.jp> wrote:
> On Wed, 10 Apr 2002 11:53:15 -0400 (EDT)
> Byron Stanoszek <gandalf@winds.org> wrote:
>
> <SNIP>
>
> > Has anyone out there done this yet? I figure I'd ask before reinventing
> > anything.. :)
>
> I seem to recall some discussion about an almost identical idea a couple of
> years ago, but I don't remember whether it was actually implemented or not.
> You'll probably have to grovel through the list archives to find out.
OK, if you haven't found it already, here's the thread (from April 2000).
http://www.uwsg.iu.edu/hypermail/linux/kernel/0004.0/0471.html
Bruce
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2002-04-12 11:54 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-04-09 22:24 Using video memory as system memory Byron Stanoszek
2002-04-10 15:00 ` bill davidsen
2002-04-11 14:23 ` Pavel Machek
2002-04-12 10:56 ` Pedro M. Rodrigues
2002-04-12 11:35 ` Dr. David Alan Gilbert
2002-04-12 7:54 ` Eric W. Biederman
-- strict thread matches above, loose matches on Subject: below --
2002-04-10 15:43 Holzrichter, Bruce
2002-04-10 15:53 ` Byron Stanoszek
2002-04-10 16:12 ` Geert Uytterhoeven
2002-04-10 17:10 ` Bruce Harada
2002-04-12 11:54 ` Bruce Harada
2002-04-11 11:28 ` Denis Vlasenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox