From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KU2Cr-0006JK-RI for mharc-grub-devel@gnu.org; Fri, 15 Aug 2008 12:31:17 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KU2Cq-0006Ix-OA for grub-devel@gnu.org; Fri, 15 Aug 2008 12:31:16 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KU2Cm-0006HQ-59 for grub-devel@gnu.org; Fri, 15 Aug 2008 12:31:16 -0400 Received: from [199.232.76.173] (port=60588 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KU2Cl-0006HL-Rb for grub-devel@gnu.org; Fri, 15 Aug 2008 12:31:11 -0400 Received: from mta-out.inet.fi ([195.156.147.13]:50307 helo=jenni2.inet.fi) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KU2Ck-0000Ce-RU for grub-devel@gnu.org; Fri, 15 Aug 2008 12:31:11 -0400 Received: from [127.0.0.1] (88.193.32.97) by jenni2.inet.fi (8.5.014) id 489066C500AA4B3B for grub-devel@gnu.org; Fri, 15 Aug 2008 19:31:04 +0300 Message-ID: <48A5AF50.2040906@nic.fi> Date: Fri, 15 Aug 2008 19:31:12 +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: <1218684975.8757.139.camel@localhost> <48A4589D.3040902@nic.fi> <20080814180005.GB5614@thorin> <1218749362.19647.20.camel@localhost> In-Reply-To: <1218749362.19647.20.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: [RFC] Platform information services 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: Fri, 15 Aug 2008 16:31:17 -0000 Javier Mart=EDn wrote: > WRT "kernel and modules going hand by hand", think about external > modules: if the drivemap module is finally rejected for introduction in > GRUB, I will not scrap it, but keep it as a module external to the > official GNU sources and possibly offer it in a web in the form of > patches to the official GRUB2. In this case, changes made to the kernel > would not take into account that module, which would break if I weren't > monitoring this list daily. Then it is really your problem ;) > Additionally, the cost of this function in platforms which don't have > any structs registered yet, as the function could be a stub like this: >=20 > void* grub_machine_get_platform_structure (int stidx) > { > grub_error (GRUB_ERR_BAD_ARGUMENT, "Struct %d not supported", stidx); > return 0; > } >=20 > The kernel space taken would most likely be less than 50 bytes. For > i386-pc, it could be like this (also lightweight) function: >=20 > void* grub_machine_get_platform_structure (int stidx) > { > grub_errno =3D GRUB_ERR_NONE; >=20 > switch (stidx) > { > case GRUB_MACHINE_I386_IVT: > return /* Call to asm function that runs SIDT in real mode */ ; > case GRUB_MACHINE_I386_BDA: > return (void*)0x400; > default: > grub_error (GRUB_ERR_BAD_ARGUMENT, "Struct %d not supported", > stidx); > return 0; > } > } And what lets assume couple of extra platforms... how about x86-32bit-efi and ppc. What do they do? Implement their own enum entries for those indexes and only use their own indices...? Where here we are sharing any code? (if we do not count the name of the fuction.) Interface is kinda useless if there is no possibility that no-one is sharing its functionality...