On Nov 8, 2005, at 5:18 PM, Marco Gerards wrote:
At the moment I am working on things that irritate me while I am
working on GRUB. One thing is writing a duplicate _init and _fini
function (duplicate because it already is added in GRUB_MOD_INIT).
And another thing that irritates me is that I have to add a init line
to grub-emu.
Here is a patch that solves that. First I removed all the init and
fini functions and let GRUB_MOD_INIT and GRUB_MOD_FINI generate these
functions. I have added a script that creates a header file with all
the function prototypes for these generated functions. And finally I
have added a script that can generate a C file with the functions
`grub_init_all' and `grub_fini_all'.
This is good. :)
The way Linux does this, avoiding shell scripting, is by inserting
function pointers into a special ELF section, and that section is
looped over using linker symbols defining the beginning and end.
On the other hand, I seem to recall that some toolchain component (GDB
perhaps) uses shell scripting like this: it finds all functions named
in a particular way and produces code to call them. I can live with
that.
-Hollis
_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel