From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Kaw21-0003qn-37 for mharc-grub-devel@gnu.org; Wed, 03 Sep 2008 13:20:37 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kaw20-0003qU-13 for grub-devel@gnu.org; Wed, 03 Sep 2008 13:20:36 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kaw1w-0003pv-JS for grub-devel@gnu.org; Wed, 03 Sep 2008 13:20:35 -0400 Received: from [199.232.76.173] (port=57773 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kaw1w-0003pq-Fi for grub-devel@gnu.org; Wed, 03 Sep 2008 13:20:32 -0400 Received: from ey-out-1920.google.com ([74.125.78.144]:13802) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kaw1v-0006G1-QA for grub-devel@gnu.org; Wed, 03 Sep 2008 13:20:32 -0400 Received: by ey-out-1920.google.com with SMTP id 4so1188301eyg.24 for ; Wed, 03 Sep 2008 10:20:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:in-reply-to :references:content-type:date:message-id:mime-version:x-mailer; bh=pM6F1ybKa257us2LDJhzIOXQ13P5G09/545q5KoJrr0=; b=UllMdeQnomJJYp3jTIVIr5c0x81yt2cP32BC6UL15X3Ca8uUgF1ixWr/ZwlTn1Ueh0 eTNNp/4d7R1y8Z2pjxTjwkg+tnvk2FwWlNwtjfFuHaoVm37tWggzNUTXtmQJ8U5D6ck8 GZn6Y+9HsLCcbS8mv8crcmZKN3o6lB+VoMkxk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:in-reply-to:references:content-type:date:message-id :mime-version:x-mailer; b=tGbMrPcl7XOcPEYPg0tFLF4MIP/Pl0WwUhejbKxpu4HtmM2ixhB6m+NvsnxUrxGBaT wBh8+KaNJ6BRYiQbFN28qLAwB6ZQIG0bCzM17zEDc737dNjTpFyqn241A4VR82yAHRw6 zMMym9SFCzsolQALyveHziLfj+MublkTtJpXI= Received: by 10.210.22.8 with SMTP id 8mr2423332ebv.167.1220462429926; Wed, 03 Sep 2008 10:20:29 -0700 (PDT) Received: from ?192.168.1.100? ( [213.37.137.93]) by mx.google.com with ESMTPS id 5sm12389281eyf.8.2008.09.03.10.20.28 (version=SSLv3 cipher=RC4-MD5); Wed, 03 Sep 2008 10:20:29 -0700 (PDT) From: Javier =?ISO-8859-1?Q?Mart=EDn?= To: The development of GRUB 2 In-Reply-To: <48BEC43A.1000309@nic.fi> 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> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-oLCWfaf/3nfbhdSSxjQ/" Date: Wed, 03 Sep 2008 19:23:32 +0200 Message-Id: <1220462612.23879.103.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 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:20:36 -0000 --=-oLCWfaf/3nfbhdSSxjQ/ Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable El mi=C3=A9, 03-09-2008 a las 20:07 +0300, Vesa J=C3=A4=C3=A4skel=C3=A4inen= escribi=C3=B3: > Hi, >=20 > How about following (may not be syntaxically correct): >=20 > In kernel: >=20 > /* Variable holding pointer to preboot hook function. */ > preboot_hook: > .long 0 >=20 > ... > /* Check if there is preboot hook installed. */ > movl preboot_hook, %eax > testl %eax, %eax > jne 1f > call %eax > 1: > /* Continue boot. */ >=20 >=20 > Then in module code: >=20 > void grub_preboot_hook_handler(void) > { > /* Process list of registered preboot hooks. */ > } >=20 > void grub_preboot_register_hook(...); > void grub_preboot_unregister_hook(...); >=20 > GRUB_MOD_INIT(preboot) > { > preboot_hook =3D grub_preboot_hook_handler; > } >=20 > GRUB_MOD_FINI(preboot) > { > preboot_hook =3D 0; > } >=20 > 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 --=-oLCWfaf/3nfbhdSSxjQ/ Content-Type: application/pgp-signature; name=signature.asc Content-Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada digitalmente -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iQIVAwUASL7IFKSl+Fbdeo72AQKPeRAApSja9hLsQYoFx7vKXPLziez2C/sKy1O/ uJQz9vrnkI9ZSrXCj8OkP8+a/MYLsVusPjDEGkizDBNUYssd2fxXShg5CMfPcC9H Fi1x+g+NfGoUKBZY+LoPiiUXubFga8pjBFV9m4xtguW0j1zAELg/ToF9u/xbHVMj s2VXqGCd7uSzupNySxNOvI3rix2vFnK92xLzv/b7gJgB7r38a+8ZgvrxZE/GGDU2 JEwcmOdxA2ak9r76mKiB/2Zz0Od5Thpp9m/X9r6vFesT+22+2Iwm6fln1ye/zeMF xu46Ubn+aERjNpcZTraBykcckqeyY6wO1rjWYnW4mLAyCQQ7U6UnLb7OznLulGDV rMOR3TQwyCwRHfL2H0C0UCTcUhK5VSmZFwALEVOIDCeCEYKqd1iL8wy8uL9vuW2y FqYQlVSDFdmxKH3Smpj+/qVJEUu8F/3Y4Hs02kSr6gkgYkcYOmm0WPnqjufOnNSy VGGE5HNO4RZBBofY/ee9eZG1WJ8EGxFsZOHBKXf8HH3c09hN/LSST/4udSwbAuhO tIzRYYyzdRKmw+zuc5QnN77EpfwayyXZw6H++07P8FCxzBNUhdBDYd6E+q3dxJ3Y 9z1uBJd2lPGOWjufFJQy71hkzuz7or2NZFzT6A+lwNicGTS2RE/tCdm529r1k/u+ lzoZ+qJqQLE= =yRB1 -----END PGP SIGNATURE----- --=-oLCWfaf/3nfbhdSSxjQ/--