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: Tue, 02 Sep 2008 16:54:59 +0200

El mar, 02-09-2008 a las 16:23 +0200, phcoder escribió:
> For implementing this functionality I needed my function to be executed
> right before booting. To do it I added a simple interface for adding
> "preboot" functions:
> struct grub_preboot_t *grub_loader_add_preboot (grub_err_t
> (*preboot_func) (int));
> As parameter this function recieves a callback (integer parameter to
> callback is noreturn variable). This function returns a handle with
> which the preboot function may be removed using
> void grub_loader_remove_preboot (struct grub_preboot_t *p);
> Implementation uses linked lists and tries to implement it in as few
> commands as possible since this code is a part of core image. This
> interface can later be reused for adding different hooks to bios ("map",
> "memdisk",...). Now the questions are:
> Whether such interface is OK for grub2?
An interface like this is implemented in another patch in "discussion",
my drivemap patch (see the August list archives). As yours, it is
linked-list based and very similar in the prototypes. I haven't checked
if your code has any kind of errors/corner cases, but it seems terser
than mine even though it's a bit more difficult to understand because
you use double pointers to avoid my handling of the head case. I don't
understand the purpose of doubly-linking the list though...

> Whether we need also interface for adding "postboot" commands? (in case
> boot_function returns)
I don't think it would offer a lot of functionality because most loaders
don't return on failure, they just get stuck or their payload
triple-faults and reboots. The same question applies for the failure of
one of the preboot routines. Sure, things like an INT13 handler are easy
to remove and restore the old machine state, but I really think the best
option here would be panic and offer to reboot.

-Habbit

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


reply via email to

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