From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KTkMw-0001TQ-5A for mharc-grub-devel@gnu.org; Thu, 14 Aug 2008 17:28:30 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KTkMu-0001Qx-4x for grub-devel@gnu.org; Thu, 14 Aug 2008 17:28:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KTkMr-0001No-AW for grub-devel@gnu.org; Thu, 14 Aug 2008 17:28:27 -0400 Received: from [199.232.76.173] (port=53194 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KTkMq-0001NO-Ui for grub-devel@gnu.org; Thu, 14 Aug 2008 17:28:25 -0400 Received: from nf-out-0910.google.com ([64.233.182.189]:14305) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KTkMq-0000tI-HI for grub-devel@gnu.org; Thu, 14 Aug 2008 17:28:24 -0400 Received: by nf-out-0910.google.com with SMTP id c7so453231nfi.26 for ; Thu, 14 Aug 2008 14:28:23 -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=C1OifSXIiPQpqW1tzWyKxLeO9aud7S72oixwifC+Yjc=; b=KtotfCzdoGxdqwvKHY5lWIf1W1dBfQJRDPQqRWIwGt8p8hdTw2UOeZxOV2y6RlntHt Mjvs/ah1OeISAxzEgRqrtnnq6N+lIVtFZMZJXuIc2AXk934GZDLyAR5aS81dt24eoYtn G4cz44rCsH6Zo84NRVAaa+t1Zj7kQaaBC6Zf4= 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=p31xc1zfJa7+xP3yL2mJXood2TyrK7CQsLVnElIF74n5M7tZ+TWgKMV3fVyfreFjvn hVtrsoz829BZwG6KTl/G3YKEHCHnx48PSbTowEtswElJzOl0v3lVibul+r1E2IeI1H7w +2YYRExxPXZvlKFRHmKHBc4XV6D7+ggN1Lz2Q= Received: by 10.210.80.2 with SMTP id d2mr1987976ebb.137.1218749303584; Thu, 14 Aug 2008 14:28:23 -0700 (PDT) Received: from ?192.168.1.100? ( [213.37.137.93]) by mx.google.com with ESMTPS id z34sm767878ikz.9.2008.08.14.14.28.21 (version=SSLv3 cipher=RC4-MD5); Thu, 14 Aug 2008 14:28:22 -0700 (PDT) From: Javier =?ISO-8859-1?Q?Mart=EDn?= To: The development of GRUB 2 In-Reply-To: <20080814180005.GB5614@thorin> References: <1218684975.8757.139.camel@localhost> <48A4589D.3040902@nic.fi> <20080814180005.GB5614@thorin> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-WH2lHgqqCMIeaf6ZUSeo" Date: Thu, 14 Aug 2008 23:29:22 +0200 Message-Id: <1218749362.19647.20.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: [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: Thu, 14 Aug 2008 21:28:28 -0000 --=-WH2lHgqqCMIeaf6ZUSeo Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable El jue, 14-08-2008 a las 20:00 +0200, Robert Millan escribi=C3=B3: > On Thu, Aug 14, 2008 at 06:38:41PM +0200, Javier Mart=C3=ADn wrote: > > Yes, but this is a "kernel" design decision that is specified nowhere > > to the modules writers. Thus, this could change tomorrow and the > > scheme would break down. >=20 > GRUB is being developed as a whole, which includes kernel and modules. I= f > we modify the kernel in a way that could break modules, it's part of the > procedure to check modules and make sure they don't break because of this > (although, of course, we could always make mistakes). >=20 That is a very sane policy, but in this case I'm arguing that an improvement could be made so that such process would not be necessary, or would be much lighter, regarding a particular section of the kernel because modules would not rely on certain assumptions about the internal implementation of GRUB: separation of interface and implementation. However, there is not a consistent, fully-documented kernel-module interface, and module developers usually do not know what invariants hold in their environment - they find it by trial and error. This needs to change eventually, particularly in the documentation part (please avoid GRUB ending like ALSA): the GRUBInternals page in the wiki should be filled up and updated a bit more often. 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. 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: void* grub_machine_get_platform_structure (int stidx) { grub_error (GRUB_ERR_BAD_ARGUMENT, "Struct %d not supported", stidx); return 0; } The kernel space taken would most likely be less than 50 bytes. For i386-pc, it could be like this (also lightweight) function: void* grub_machine_get_platform_structure (int stidx) { grub_errno =3D GRUB_ERR_NONE; 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; } } BTW, I've noticed that when using the function, if the result is stored in "void* p", then the success check cannot only rely on "if (p)", because 0 is also a legal address (i.e. for the IVT). Thus, the checks should be like "if (p || grub_errno =3D=3D GRUB_ERR_NONE)" with the implementation ensuring that errno is correctly set on success. -Habbit --=-WH2lHgqqCMIeaf6ZUSeo 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) iQIVAwUASKSjsaSl+Fbdeo72AQJF+g/+P3+3seWf0iwMI3TD7sNtBuj11euiudgz xz6dVCK8TXPJ7+I2QOVY01bLKIomqZN4Zz5zQ51KAz43mrf0PgtXMh/2eHa1avwW Ms1mch9eTfPcTDld0S3PXPuGmgNZeEWnbJ6Eo3tVTrkpd6jr5ihdAG+BQCHuZV1s lPyAKFU48JcOdI7saw5Q8OgV1p63+Zkb0cKFvcpXQP//o0TXAjoGzFwZA4gn4P8d zEbA1fQuozmdu79cgnLgQ3P69LQlett9Vdz1Qz5I9bCqMXTQuuAfConnKvwAQwhp 2lTBUwV1B3WtLSlWSmIC7vG0NHXENfa+iEMYBLqGL9PtPECQ0gPqewDOiKhoFQE3 jM6w3vFmY5GKubZBswsuXfkXwAv71D10Qo+vhQ5sNFs5LgdONb+6MYqmXOBO2G37 iuBFOQHJglRnEmMnPndwk9a+SKMNj6H1BwH4RyFAa7qs6roxmhv994sZtVTByKx7 iC5ukplWLUg42AXutMPMnvdOevmYN27eOL/o4lSAuRILe90ysdsnMRVNSdfnEvWX VxsNOzzKIIR0iumazJc41kF6KKZzskxDTEGuwnXADDntfG9EeREyBv46x0tEOMK4 llXNb/bO3hr8qF3SOuJQ8Cr5QZulSf/xOlH6Vk90AOfRn0NVJPLSiVbQfWRDCoTh gUYvJQmaG0Q= =r+/t -----END PGP SIGNATURE----- --=-WH2lHgqqCMIeaf6ZUSeo--