From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Kavoz-0004JW-PH for mharc-grub-devel@gnu.org; Wed, 03 Sep 2008 13:07:09 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kavow-0004IU-LG for grub-devel@gnu.org; Wed, 03 Sep 2008 13:07:06 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kavov-0004I3-43 for grub-devel@gnu.org; Wed, 03 Sep 2008 13:07:06 -0400 Received: from [199.232.76.173] (port=49338 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kavou-0004Hy-S5 for grub-devel@gnu.org; Wed, 03 Sep 2008 13:07:04 -0400 Received: from mta-out.inet.fi ([195.156.147.13]:46884 helo=kirsi2.inet.fi) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kavou-0004BK-7r for grub-devel@gnu.org; Wed, 03 Sep 2008 13:07:04 -0400 Received: from [127.0.0.1] (88.193.32.97) by kirsi2.inet.fi (8.5.014) id 488DC54E01B1AF08 for grub-devel@gnu.org; Wed, 3 Sep 2008 20:07:03 +0300 Message-ID: <48BEC43A.1000309@nic.fi> Date: Wed, 03 Sep 2008 20:07:06 +0300 From: =?ISO-8859-1?Q?Vesa_J=E4=E4skel=E4inen?= User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: The development of GRUB 2 References: <48BD4C52.6040308@gmail.com> <1220367299.23879.15.camel@localhost> <48BD62BE.7090507@gmail.com> <1220373059.23879.25.camel@localhost> <48BD8847.9030502@gmail.com> <1220386216.23879.55.camel@localhost> <48BDBC96.3010602@gmail.com> <1220398682.23879.70.camel@localhost> In-Reply-To: <1220398682.23879.70.camel@localhost> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: Quoted-Printable X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: Re: Sendkey patch X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2008 17:07:07 -0000 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 =3D grub_preboot_hook_handler; } GRUB_MOD_FINI(preboot) { preboot_hook =3D 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 would have minimal impact for kernel. Thanks, Vesa J=E4=E4skel=E4inen