[Top][All Lists]

[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: Gecko/20080213 Firefox/


                 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: 



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:

This is begin of definition of init function of module.
Next, look at definition of GRUB_MOD_INIT macro:

#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:

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:


  Message sent via/by Savannah

reply via email to

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