Re: [PATCH 12/12] i386 boot: Add an ELF header to bzImage

H. Peter Anvin
2006-10-04T21:09:57Z

Vivek Goyal wrote:
> On Wed, Oct 04, 2006 at 01:52:58PM -0700, H. Peter Anvin wrote:
>> Vivek Goyal wrote:
>>> memsz will contain the memory required to load the kernel image. And
>>> probably should also include the memory used by kernel in initial boot
>>> up code which is unaccounted and unbounded.
>>>
>> Right, so that's a major project to produce.
>>
>
> Eric is already doing that in his patch. He goes through vmlinux
> headers to determine the memory to load the various segments and then
> also takes into account the memory required by bootmem bitmap (128K)
> and memory consumed by initial page tables (tools/build.c). We can
> audit the code more closely for anything missed and can also include
> some buffer amount to be safe.
>
> The only flip side would be that if down the line somebody changes
> the initial bootup code, he shall have to also acccount it in
> tools/build.c. Having said that, its not frequent that initial bootup
> code changes.
>

No, but it's going to be extremely hard to get this straight unless this
is actually enforced. I suspect there needs to be a check and a message
if this is violated.

-hpa