grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: patch for PPC Old World Macintosh


From: Hollis Blanchard
Subject: Re: patch for PPC Old World Macintosh
Date: Wed, 1 Sep 2004 11:04:24 -0500

On Sep 1, 2004, at 3:27 AM, Yoshinori K. Okuji wrote:

On Tuesday 31 August 2004 04:12, Hollis Blanchard wrote:
Hmm. I think the i386 loader doesn't worry about such things, but
rather loads the kernel in a fixed region?

Here is a short description about how GRUB/i386-pc works:

1. At the initialization stage, GRUB reserves about 2/3 of the whole
memory for OS images. This starts from 1MB. GRUB never use this region
for its own use.

Ah thanks for the explanation! I think I'm getting it. You just avoid calling grub_mm_init_region() on the memory from 1MB up to 3/4 of the total memory.

So in a system with 64M of RAM, from 1MB to ~49M is avoided and never used for the grub heap (or anything else for that matter). 49M to 64M would be allocated to the grub heap.

2. When GRUB boots an OS image actually, GRUB releases all memory
regions which have been allocated for its own use.

3. GRUB copies OS images to appropriate locations, according to
Multiboot Header or other information. This stage is performed by the
kernel (more precisely, the assembly code located at the region
starting from 0x8000).

Ok, the bulk of Linux is loaded at GRUB_LINUX_BZIMAGE_ADDR (1MB) so that's fine...

I see when you load multiboot ELF segments you require that they live in the 1M+ unreserved region described above. What OSs use multiboot, and are they all linked at 1MB or above?

I think this could indeed work on PPC. Right now the entry point and thus load base is hardcoded to 20M. I think we can claim all free memory below 20M for the grub heap and leave the rest for OSs.

Of course that would mean that all OSs on PPC must also be linked above 20M, but I think that is safest. Open Firmware can live at various spots across different machines, including 4-5M and 12-20M. Right now grub links and loads at 2M (but could load as low as 16K if we wanted to). That leaves the most viable hole between 5M and 12M, or above 20M. Linux kernels with attached ramdisks can be quite large...

-Hollis





reply via email to

[Prev in Thread] Current Thread [Next in Thread]