[Top][All Lists]

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

Re: normal mode chainloader

From: Tomas Ebenlendr
Subject: Re: normal mode chainloader
Date: Mon, 20 Sep 2004 08:58:46 +0200
User-agent: Mutt/1.5.6i

My current status is following: I can _load_ module (with same 
and with something similar to symlist.c). But I cannot execute it,
because of i386 specific CFLAGS: -mregparm=3 -mrtd. (calling convetions)
Posible solutions:  1) use another set of modules
                    2) don't use -mregparm=3 -mrtd
                    3) use __atribute__ ((regparm(3), stdcall)) for all
                    functions that may be in modules.

More detail on the third solution:
int EXPORT_FUNC(foo) (int HOOK(*hook) (int))
EXPORT_FUNC(x) will expand on HOOK(x), and HOOK(x) will expand on
    __atribute__ ((regparm(3), stdcall)) x
when on i386.
the hook should be also defined as follows:
int HOOK(my_hook) (int argument) { body; }
There can be special macros HOOK_A (and EXPORT_FUNC_A) for functions,
that already have some __attribute__ (e.g., grub_fatal or grub_printf).

I tried to do a wrapper (fourth solution), but that is impossible
because of hooks. (They may originate in grub_emu as well as in module).

PS.: We can distinguish between modules loadable in grub-emu, and
boottime modules (and modules wich can be used both ways). I propose to
have some flags (as variable or somewhere in elf header).

> As far as I know you could use normal GRUB modules, no?  so you can use 
> the same normal.mod as is used boottime.
> Would you have a problem with me trying to implement this or do you have too 
> much already?
> I have some problems with the implementation of the relocator for the PPC
> and I think it is easier to debug if I can use grub-emu for this.
> Thanks,
> Marco

                                 Tomas 'ebi' Ebenlendr
                                 PF 2004.71955727586

reply via email to

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