grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC] Platform information services


From: Vesa Jääskeläinen
Subject: Re: [RFC] Platform information services
Date: Fri, 15 Aug 2008 19:31:12 +0300
User-agent: Thunderbird 2.0.0.16 (Windows/20080708)

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 ;)

> 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...?

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...





reply via email to

[Prev in Thread] Current Thread [Next in Thread]