bug-grub
[Top][All Lists]
Advanced

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

[bug #22750] broken module init


From: Alexander Zubkov
Subject: [bug #22750] broken module init
Date: Thu, 27 Mar 2008 09:21:27 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.12) Gecko/20080213 Firefox/2.0.0.12

URL:
  <http://savannah.gnu.org/bugs/?22750>

                 Summary: broken module init
                 Project: GNU GRUB
            Submitted by: zubkov
            Submitted on: Четверг 27.03.2008 at 09:21
                Category: None
                Severity: Major
                Priority: 5 - Normal
              Item Group: Software Error
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 1.96
         Reproducibility: Every Time
         Planned Release: 

    _______________________________________________________

Details:

Several days I was trying to make grub2 work on my server. It seems that it
cannot see bios disk for some reason. Using debug print I found this. Let's
look at biosdisk module source, for example:

disk/i386/pc/biosdisk.c:
----
GRUB_MOD_INIT(biosdisk)
{
...
----
This is begin of definition of init function of module.
Next, look at definition of GRUB_MOD_INIT macro:

include/grub/dl.h:
----
#define GRUB_MOD_INIT(name)     \
static void grub_mod_init (grub_dl_t mod __attribute__ ((unused)))
__attribute__ ((used)); \
void grub_##name##_init (void); \
void \
grub_##name##_init (void) { grub_mod_init (0); } \
static void \
grub_mod_init (grub_dl_t mod __attribute__ ((unused)))
----
As we see it will make exported function grub_biosdisk_init. And finally,
let's see at module loading procedure:

kern/dl.c:
----
if (grub_strcmp (name, "grub_mod_init") == 0)
  mod->init = (void (*) (grub_dl_t)) sym->st_value;
----
Here we see, that init function of a module is expecting grub_mod_init and so
it remains nil and not run at all.

May be I mistakes about this symbol mesh, but inserted debug print showed
that: module init function doesn't get called, biosdisk exports only
grub_biosdisk_fini and grub_biosdisk_init and no grub_mod_init.

For the case if I have really broken compiler or system, here is some info:
CPU Intel Xeon 3060
gcc version 4.1.2, target x86_64-pc-linux-gnu




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?22750>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

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