All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Javier Martín" <lordhabbit@gmail.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [RFC] Platform information services
Date: Fri, 15 Aug 2008 19:03:18 +0200	[thread overview]
Message-ID: <1218819798.2510.13.camel@localhost> (raw)
In-Reply-To: <48A5AF50.2040906@nic.fi>

[-- Attachment #1: Type: text/plain, Size: 3490 bytes --]

El vie, 15-08-2008 a las 19:31 +0300, Vesa Jääskeläinen escribió:
> Javier Martín 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 ;)
Indeed, but bitrot is not just the real of external modules: it's
happening right now even within the GRUB trunk as you admit in the
"Build problems on powerpc" thread...

> 
> > 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 = 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;
> >   }
> > }
> 
> 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...?
At first, they would just have the stub which does not recognize any
index, but yes, i386-efi devs could decide that certain
firmware-provided structure (like a video modes info table or such, I
don't know the internals of EFI) might be interesting to a module
they're creating, so they create an index for it and add it to the
version of the function in their platform.

If I had not mentioned it before, the function would be declared in a
cross-platform file, but _implemented_ in platform-specific files, and
the indices would be declared in the platform-specific machine.h.  Thus,
there would not be a "single" indices namespace: structure #1 might be
the IVT in i386-pc, but some devices info table in powerpc-ieee1275.

> 
> 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...
The idea is a single function to retrieve the addresses of
firmware-provided/used structures.  This includes the IVT and BDA in
i386-pc, but as I said before it could also be used by other platforms
for their own structures.  The alternative would be just creating such
"get struct X" functions on each platform as they are needed, but I
imagined that a single interface (with such a low cost in space) would
be a more elegant solution.

-Habbit
> 
> 
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel

[-- Attachment #2: Esta parte del mensaje está firmada digitalmente --]
[-- Type: application/pgp-signature, Size: 827 bytes --]

  reply	other threads:[~2008-08-15 17:02 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-14  3:36 [RFC] Platform information services Javier Martín
2008-08-14 16:09 ` Vesa Jääskeläinen
2008-08-14 16:38   ` Javier Martín
2008-08-14 17:41     ` Vesa Jääskeläinen
2008-08-14 21:45       ` Javier Martín
2008-08-14 18:00     ` Robert Millan
2008-08-14 21:29       ` Javier Martín
2008-08-15 16:31         ` Vesa Jääskeläinen
2008-08-15 17:03           ` Javier Martín [this message]
2008-08-15 17:14             ` Vesa Jääskeläinen
2008-08-15 17:59               ` Javier Martín
2008-08-15 18:35                 ` Vesa Jääskeläinen
2008-08-15 19:18                   ` Javier Martín
2008-08-15 19:46                     ` Vesa Jääskeläinen
2008-08-15 20:13                       ` Javier Martín
2008-08-15 20:26                         ` Vesa Jääskeläinen
2008-08-15 22:38                     ` Isaac Dupree
2008-08-15 23:06                       ` Javier Martín
2008-08-16  7:03                       ` Vesa Jääskeläinen
2008-08-16 12:20             ` Robert Millan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1218819798.2510.13.camel@localhost \
    --to=lordhabbit@gmail.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.