All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Millan <rmh@aybabtu.com>
To: grub-devel@gnu.org
Subject: [PATCH] make the generic Linux loader usable on i386-pc again
Date: Fri, 6 Mar 2009 20:19:33 +0100	[thread overview]
Message-ID: <20090306191933.GA29098@thorin> (raw)

[-- Attachment #1: Type: text/plain, Size: 611 bytes --]


This patch makes the generic Linux loader usable on i386-pc again.  It
doesn't seem like it's badly needed to spend a bit of time and a bit of
code in adding low memory to the heap, and Vesa's work on the new memory
manager should give a proper solution to this problem.

I think in the meantime we could just not allocate low mem, assuming
nobody has a problem with that.

-- 
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."

[-- Attachment #2: linux_generic.diff --]
[-- Type: text/x-diff, Size: 1813 bytes --]

2009-03-06  Robert Millan  <rmh@aybabtu.com>

	Make loader/i386/linux.c usable on i386-pc again.

	* kern/i386/pc/init.c (grub_machine_init): Disable addition of low
	memory to heap.
	* loader/i386/linux.c [GRUB_MACHINE_PCBIOS] (allocate_pages): Remove
	`#error' stanza.

Index: kern/i386/pc/init.c
===================================================================
--- kern/i386/pc/init.c	(revision 2019)
+++ kern/i386/pc/init.c	(working copy)
@@ -148,10 +148,15 @@ grub_machine_init (void)
   grub_gate_a20 (1);
 #endif
 
+/* FIXME: This prevents loader/i386/linux.c from using low memory.  When our
+   heap implements support for requesting a chunk in low memory, this should
+   no longer be a problem.  */
+#if 0
   /* Add the lower memory into free memory.  */
   if (grub_lower_mem >= GRUB_MEMORY_MACHINE_RESERVED_END)
     add_mem_region (GRUB_MEMORY_MACHINE_RESERVED_END,
 		    grub_lower_mem - GRUB_MEMORY_MACHINE_RESERVED_END);
+#endif
   
   auto int NESTED_FUNC_ATTR hook (grub_uint64_t, grub_uint64_t, grub_uint32_t);
   int NESTED_FUNC_ATTR hook (grub_uint64_t addr, grub_uint64_t size, grub_uint32_t type)
Index: loader/i386/linux.c
===================================================================
--- loader/i386/linux.c	(revision 2019)
+++ loader/i386/linux.c	(working copy)
@@ -143,9 +143,8 @@ allocate_pages (grub_size_t prot_size)
   real_mode_mem = 0;
   prot_mode_mem = 0;
   
-#ifdef GRUB_MACHINE_PCBIOS
-#error i386-pc port adds lower memory to heap, which collides with `real_mode_mem' allocation below
-#endif
+  /* FIXME: Should request low memory from the heap when this feature is
+     implemented.  */
 
   auto int NESTED_FUNC_ATTR hook (grub_uint64_t, grub_uint64_t, grub_uint32_t);
   int NESTED_FUNC_ATTR hook (grub_uint64_t addr, grub_uint64_t size, grub_uint32_t type)

             reply	other threads:[~2009-03-06 19:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-06 19:19 Robert Millan [this message]
2009-03-06 20:02 ` [PATCH] make the generic Linux loader usable on i386-pc again Vesa Jääskeläinen
2009-03-07 10:48   ` Robert Millan
2009-03-07 11:26     ` phcoder
2009-03-08 12:46   ` Robert Millan

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=20090306191933.GA29098@thorin \
    --to=rmh@aybabtu.com \
    --cc=grub-devel@gnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.