grub-devel
[Top][All Lists]
Advanced

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

Re: Sendkey patch


From: Javier Martín
Subject: Re: Sendkey patch
Date: Wed, 03 Sep 2008 19:23:32 +0200

El mié, 03-09-2008 a las 20:07 +0300, Vesa Jääskeläinen escribió:
> Hi,
> 
> How about following (may not be syntaxically correct):
> 
> In kernel:
> 
> /* Variable holding pointer to preboot hook function.  */
> preboot_hook:
>       .long   0
> 
> ...
>       /* Check if there is preboot hook installed.  */
>       movl    preboot_hook, %eax
>       testl   %eax, %eax
>       jne     1f
>       call    %eax
> 1:
>       /* Continue boot.  */
> 
> 
> Then in module code:
> 
> void grub_preboot_hook_handler(void)
> {
>       /* Process list of registered preboot hooks.  */
> }
> 
> void grub_preboot_register_hook(...);
> void grub_preboot_unregister_hook(...);
> 
> GRUB_MOD_INIT(preboot)
> {
>       preboot_hook = grub_preboot_hook_handler;
> }
> 
> GRUB_MOD_FINI(preboot)
> {
>       preboot_hook = 0;
> }
> 
> If preboot.mod gets loaded then it goes and registers preboot handler to
> kernel to do its tricks. Other modules then would use preboot.mod to
> register their own handlers.
This is certainly a good solution, and would probably add less than 10
bytes to the kernel. I only have to add two things:
 * This is not as elegant as it could be, as it forces us to expose
preboot_hook in the kernel, thus breaking encapsulation a bit. But it is
a price that I'm more than willing to pay.
 * I doubt: is the current DL system in GRUB able to hand dependencies
directly? In other words, is our "insmod" more like modprobe or Linux
insmod? This affects the handling of "insmod drivemap" or "insmod
sendkey" if preboot.mod is not loaded beforehand.

-Habbit

Attachment: signature.asc
Description: Esta parte del mensaje está firmada digitalmente


reply via email to

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