Thu 27 Mar 2008 09:21:25 AM UTC, original submission:
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
|