All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Javier Martín" <lordhabbit@gmail.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: Sendkey patch
Date: Tue, 02 Sep 2008 16:54:59 +0200	[thread overview]
Message-ID: <1220367299.23879.15.camel@localhost> (raw)
In-Reply-To: <48BD4C52.6040308@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1887 bytes --]

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 #2: Esta parte del mensaje está firmada digitalmente --]
[-- Type: application/pgp-signature, Size: 827 bytes --]

  reply	other threads:[~2008-09-02 14:52 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-02 14:23 Sendkey patch phcoder
2008-09-02 14:54 ` Javier Martín [this message]
2008-09-02 15:58   ` phcoder
2008-09-02 16:12     ` phcoder
2008-09-02 16:19     ` Vesa Jääskeläinen
2008-09-02 19:01       ` phcoder
2008-09-02 19:29         ` Vesa Jääskeläinen
2008-09-02 16:30     ` Javier Martín
2008-09-02 18:39       ` phcoder
2008-09-02 20:10         ` Javier Martín
2008-09-02 22:22           ` phcoder
2008-09-02 23:38             ` Javier Martín
2008-09-03  0:08               ` phcoder
2008-09-03  0:54                 ` Javier Martín
2008-09-03  9:10                   ` phcoder
2008-09-03 11:19                     ` Javier Martín
2008-09-03 10:37                   ` bitbucket
2008-09-03  7:07               ` Felix Zielcke
2008-09-03 17:07               ` Vesa Jääskeläinen
2008-09-03 17:23                 ` Javier Martín
2008-09-03 17:25                   ` Felix Zielcke
2008-09-03 17:48                 ` phcoder
2008-09-03 17:53                   ` Vesa Jääskeläinen
2008-09-03 18:11                     ` phcoder
2008-09-04 22:16                     ` Javier Martín
2008-09-05 16:13                       ` [PATCH] Move kern/loader.c to boot.mod and add preboot_support (was Re: Sendkey patch) phcoder
2008-09-05 16:47                         ` Javier Martín
2008-09-08 19:48                         ` Vesa Jääskeläinen
2008-09-08 20:11                           ` Javier Martín
2008-09-08 20:25                             ` Vesa Jääskeläinen
2008-09-08 20:59                               ` Javier Martín
2008-12-15 13:54                                 ` phcoder
2008-12-15 16:41                                   ` Vesa Jääskeläinen
2008-12-16 14:34                                     ` phcoder
2009-02-07 19:26                                 ` Robert Millan
2009-02-07 19:30                             ` Robert Millan
2009-02-07 23:02                               ` phcoder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1220367299.23879.15.camel@localhost \
    --to=lordhabbit@gmail.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.