linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Byron Stanoszek <gandalf@winds.org>
To: linux-kernel@vger.kernel.org
Subject: Using video memory as system memory
Date: Tue, 9 Apr 2002 18:24:14 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.44.0204091816380.13516-100000@winds.org> (raw)

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



             reply	other threads:[~2002-04-09 22:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-09 22:24 Byron Stanoszek [this message]
2002-04-10 15:00 ` Using video memory as system memory 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
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.44.0204091816380.13516-100000@winds.org \
    --to=gandalf@winds.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).