mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Fix mem= options
@ 2003-03-09 22:16 Pavel Machek
  2003-03-10 19:58 ` Randy.Dunlap
  2003-03-11  0:13 ` Alan Cox
  0 siblings, 2 replies; 3+ messages in thread
From: Pavel Machek @ 2003-03-09 22:16 UTC (permalink / raw)
  To: torvalds, kernel list

Hi!

HPA told me bootloaders need to parse mem=, so we should invent other
option for stuff like mem=exactmap. Please apply,
								Pavel

--- clean/arch/i386/kernel/setup.c	2003-03-06 23:25:14.000000000 +0100
+++ linux/arch/i386/kernel/setup.c	2003-03-08 00:18:21.000000000 +0100
@@ -527,6 +527,9 @@
 		 * to <mem>, overriding the bios size.
 		 * "mem=XXX[KkmM]@XXX[KkmM]" defines a memory region from
 		 * <start> to <start>+<mem>, overriding the bios size.
+		 *
+		 * HPA tells me bootloaders need to parse mem=, so no new
+		 * option should be mem=
 		 */
 		if (c == ' ' && !memcmp(from, "mem=", 4)) {
 			if (to != command_line)
@@ -535,8 +538,24 @@
 				from += 9+4;
 				clear_bit(X86_FEATURE_PSE, boot_cpu_data.x86_capability);
 				disable_pse = 1;
-			} else if (!memcmp(from+4, "exactmap", 8)) {
-				from += 8+4;
+			} else {
+				/* If the user specifies memory size, we
+				 * limit the BIOS-provided memory map to
+				 * that size. exactmap can be used to specify
+				 * the exact map. mem=number can be used to
+				 * trim the existing memory map.
+				 */
+				unsigned long long start_at, mem_size;
+ 
+				mem_size = memparse(from+4, &from);
+			}
+		}
+
+		if (c == ' ' && !memcmp(from, "memmap=", 7)) {
+			if (to != command_line)
+				to--;
+			if (!memcmp(from+7, "exactmap", 8)) {
+				from += 8+7;
 				e820.nr_map = 0;
 				userdef = 1;
 			} else {
@@ -548,7 +567,7 @@
 				 */
 				unsigned long long start_at, mem_size;
  
-				mem_size = memparse(from+4, &from);
+				mem_size = memparse(from+7, &from);
 				if (*from == '@') {
 					start_at = memparse(from+1, &from);
 					add_memory_region(start_at, mem_size, E820_RAM);

-- 
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-03-10 22:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-09 22:16 Fix mem= options Pavel Machek
2003-03-10 19:58 ` Randy.Dunlap
2003-03-11  0:13 ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®