Re: RE : Re: Re : [PATCH] Compressed ia32 ELF file generation for loading by Gujin 1/3

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Eric W. Biederman
Date: Sunday, February 11, 2007 - 1:49 pm

Etienne Lorrain <etienne_lorrain@yahoo.fr> writes:


There are two more options in addition to segments:
- Running at a fixed virtual address.
- Processing relocation entries to modify the initial code/data to
  live where we want.  We don't have the that shared libraries do of wanting
  to share text/data pages loaded at different addresses.


The thing to pick up on is that we really don't want the gcc flag
-fPIC but if ld wasn't an idiot we would want the linker flag -shared.
Anyway we have working code merged that processes all of the
relocation entries and modifies the kernel to run properly where we
load it at.  This has all been done and merged at this point.  It's
only available to a bzImage loader but it is all there.  Currently the
only overhead is something like 5 or 10 percent overhead to hold the
relocation entries.

The only thing currently compiled with -fPIC is the kernel gzip
decompressor and it is carefully coded so it doesn't generate any
relocation entries that need processing.  It is just throw away code
so we don't much care about it's efficiency.


Yes.  That is roughly what we are saying.  We want that at least
as a well defined option.


Yes.   In this sense I'm a tool builder.  I build general capabilities
that can be used to solve specific problems.  A relocatable kernel
is a general capability and the only interesting problem to date
has been taking crash dumps.  To reduce the maintenance overhead I
try and remove the cases where you need an extra config option for
the new functionality.  If there is not overhead a config option just
makes things harder to test.


This requires a more detailed examination.  The previous conversation
indicated that if we could replace setup.S, video.S and edd.S with
C versions it would be very interesting.  If we happen to change the
link so they are available in an ELF executable so much the better.

If we wind up adding two versions of the real mode code one written
in assembly and one written in C accessible by different means
by different bootloaders that is not interesting.



Yes.  That is nice. 


It is my belief that we can solve this without hacks, and still have
a useable structure.

[snip]

That would certainly get the job done.


So I really don't care if we move whole real mode section into a note
or if we just put a pointer to it into a note.  What is important is
that we use a note to find it.

Which means that we could do something goofy in the linker script
like we do with the current vdso.  So we could give it a virtual
address of 0 and a physical address in the init code section.
Allowing us to load it normally and then just drop it later.  Not
perfect but something that would not need special treatment by
a bootloader unless it wanted to copy the data from there into
some location in low memory and execute it.

For me the objective is not so much reusing the existing tools
(although that is a plus) but more to be able to build a unified
binary that can be used for everything, and will give us the freedom
to do interesting things with the kernel in the future, and hopefully
something that is more or less usable by portable bootloaders.  Having
a different file format and different rules for different
architectures is a pain.

Eric
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: Re : [PATCH] Compressed ia32 ELF file generation for l ..., Eric W. Biederman, (Fri Feb 9, 12:42 pm)
Re: RE : Re: Re : [PATCH] Compressed ia32 ELF file generat ..., Eric W. Biederman, (Sun Feb 11, 1:49 pm)
Re: Re : [PATCH] Compressed ia32 ELF file generation for l ..., Eric W. Biederman, (Mon Feb 12, 5:29 am)
Re: Re : [PATCH] Compressed ia32 ELF file generation for l ..., Eric W. Biederman, (Mon Feb 12, 12:47 pm)