From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KawSs-00037G-As for mharc-grub-devel@gnu.org; Wed, 03 Sep 2008 13:48:22 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KawSp-000358-UC for grub-devel@gnu.org; Wed, 03 Sep 2008 13:48:20 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KawSo-000342-Vz for grub-devel@gnu.org; Wed, 03 Sep 2008 13:48:19 -0400 Received: from [199.232.76.173] (port=40266 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KawSo-00033n-Nw for grub-devel@gnu.org; Wed, 03 Sep 2008 13:48:18 -0400 Received: from fg-out-1718.google.com ([72.14.220.155]:65495) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KawSo-00030o-9F for grub-devel@gnu.org; Wed, 03 Sep 2008 13:48:18 -0400 Received: by fg-out-1718.google.com with SMTP id l26so233158fgb.30 for ; Wed, 03 Sep 2008 10:48:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=R1kRDNNd/RAWs+InMFXwofvzRIUQUXsMbHDEPTnVuaQ=; b=eFTZjHHi9bcy/gSzuZJ/5fAYhwjKivLtSAnX8x0AQr8L61i2Gxd9oEShqIn+lbyGnz DA6Ri0ERJSYwVtXmY9Lhlyfy7Z7jtgNj/etEn1sqK3weSsVLRgg/I5MzUPyOWwPYfpj5 C/HblkUOHGJRT0XIhFN38slvzOseAl8x8B1ok= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=WjZtzqjP4rNHblWmDKHWTWmbzAMNjGzFT/k5zCK36QESQkqOy60ES/IZrYAOsCa4NB /u02Vb2LU5Ej7sQG9XA1vL6bB1+eCpx5Y6hK+ZJALeeyVBc2cNa7KUL0Voxduv6/2t/Q Vmmp97HwZenV+jxRaPYPBwmRyHx+YV7gOsLeE= Received: by 10.86.81.9 with SMTP id e9mr4362486fgb.17.1220464097416; Wed, 03 Sep 2008 10:48:17 -0700 (PDT) Received: from ?192.168.1.15? ( [83.77.145.184]) by mx.google.com with ESMTPS id d4sm10172279fga.5.2008.09.03.10.48.15 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 03 Sep 2008 10:48:16 -0700 (PDT) Message-ID: <48BECDDD.5040502@gmail.com> Date: Wed, 03 Sep 2008 19:48:13 +0200 From: phcoder User-Agent: Thunderbird 2.0.0.16 (X11/20080724) 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> <48BEC43A.1000309@nic.fi> In-Reply-To: <48BEC43A.1000309@nic.fi> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) 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:48:20 -0000 Hello. In this case we can transfer the whole functionality located in kern/loader.c to a dedicated module boot.mod. This module will also register "boot" command. In this way the encapsulation won't be broken and kernel will become even smaller. Vladimir 'phcoder' Serbinenko Vesa Jääskeläinen wrote: > 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 would have minimal impact for kernel. > > Thanks, > Vesa Jääskeläinen > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel