* [PATCH] make the generic Linux loader usable on i386-pc again
@ 2009-03-06 19:19 Robert Millan
2009-03-06 20:02 ` Vesa Jääskeläinen
0 siblings, 1 reply; 5+ messages in thread
From: Robert Millan @ 2009-03-06 19:19 UTC (permalink / raw)
To: grub-devel
[-- 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)
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] make the generic Linux loader usable on i386-pc again
2009-03-06 19:19 [PATCH] make the generic Linux loader usable on i386-pc again Robert Millan
@ 2009-03-06 20:02 ` Vesa Jääskeläinen
2009-03-07 10:48 ` Robert Millan
2009-03-08 12:46 ` Robert Millan
0 siblings, 2 replies; 5+ messages in thread
From: Vesa Jääskeläinen @ 2009-03-06 20:02 UTC (permalink / raw)
To: The development of GRUB 2
Robert Millan wrote:
> 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.
If this really blocks it I have nothing against it. But could you share
a bit insight what kind of memories are required to be where for Linux?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] make the generic Linux loader usable on i386-pc again
2009-03-06 20:02 ` Vesa Jääskeläinen
@ 2009-03-07 10:48 ` Robert Millan
2009-03-07 11:26 ` phcoder
2009-03-08 12:46 ` Robert Millan
1 sibling, 1 reply; 5+ messages in thread
From: Robert Millan @ 2009-03-07 10:48 UTC (permalink / raw)
To: The development of GRUB 2
On Fri, Mar 06, 2009 at 10:02:28PM +0200, Vesa Jääskeläinen wrote:
> Robert Millan wrote:
> > 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.
>
> If this really blocks it I have nothing against it. But could you share
> a bit insight what kind of memories are required to be where for Linux?
Sure. Note that my experience is merely derived from our existing code
(which I had to in order to produce the initial loader/i386/linux.c). Linux
developers reading this (hi Dave ;-)) probably know better.
There's an area between 0x10000 and 0x90000 which is where
struct linux_kernel_params needs to be stored. This includes a statically
allocated memory map.
There's an area between 0x100000 and min(0x37FFFFFF,(grub_os_area_addr + grub_os_area_size))
where the actual Linux image is loaded, as well as the initrd (inmediately after
it, with some alignment).
I think that's all.
--
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."
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] make the generic Linux loader usable on i386-pc again
2009-03-07 10:48 ` Robert Millan
@ 2009-03-07 11:26 ` phcoder
0 siblings, 0 replies; 5+ messages in thread
From: phcoder @ 2009-03-07 11:26 UTC (permalink / raw)
To: The development of GRUB 2
Small word about xnu. It needs for norma booting just a quite big amount
of contiguos memory anywhere below 4GiB. This is typically 64 MiB
depending on the amount of loaded modules but can be much larger (e.g.
if using ramdisk)
In the case of resuming from hibernation it needs small amount at
0x100000 (around 64 kib probably) and a space for compressed hibernation
image. Depending on system usage prior to hibernation it could be as big
as the whole memory minus few MiB.
Robert Millan wrote:
> On Fri, Mar 06, 2009 at 10:02:28PM +0200, Vesa Jääskeläinen wrote:
>> Robert Millan wrote:
>>> 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.
>> If this really blocks it I have nothing against it. But could you share
>> a bit insight what kind of memories are required to be where for Linux?
>
> Sure. Note that my experience is merely derived from our existing code
> (which I had to in order to produce the initial loader/i386/linux.c). Linux
> developers reading this (hi Dave ;-)) probably know better.
>
> There's an area between 0x10000 and 0x90000 which is where
> struct linux_kernel_params needs to be stored. This includes a statically
> allocated memory map.
>
> There's an area between 0x100000 and min(0x37FFFFFF,(grub_os_area_addr + grub_os_area_size))
> where the actual Linux image is loaded, as well as the initrd (inmediately after
> it, with some alignment).
>
> I think that's all.
>
--
Regards
Vladimir 'phcoder' Serbinenko
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] make the generic Linux loader usable on i386-pc again
2009-03-06 20:02 ` Vesa Jääskeläinen
2009-03-07 10:48 ` Robert Millan
@ 2009-03-08 12:46 ` Robert Millan
1 sibling, 0 replies; 5+ messages in thread
From: Robert Millan @ 2009-03-08 12:46 UTC (permalink / raw)
To: The development of GRUB 2
On Fri, Mar 06, 2009 at 10:02:28PM +0200, Vesa Jääskeläinen wrote:
> Robert Millan wrote:
> > 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.
>
> If this really blocks it I have nothing against it.
Committed.
--
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."
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-03-08 12:46 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-06 19:19 [PATCH] make the generic Linux loader usable on i386-pc again Robert Millan
2009-03-06 20:02 ` Vesa Jääskeläinen
2009-03-07 10:48 ` Robert Millan
2009-03-07 11:26 ` phcoder
2009-03-08 12:46 ` Robert Millan
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.