Grub not loading modules properly?
Posted: Mon Jul 29, 2002 11:00 pm
Hey,
I'm trying to grab a list of all the modules GRUBs loaded for my kernel, but GRUB only returns the first module. All others (despite GRUB saying it has loaded them) come back as start 0, length 0!!!
My code is almost an exact rip of the multiboot example found on the multiboot specs page:
printf("mods_count = %d, mods_addr = 0x%x\n",
(int)multibootInfo->mods_count,
(int)multibootInfo->mods_addr);
mod = (module_t *) multibootInfo->mods_addr;
for(i = 0; i < multibootInfo->mods_count; i++) {
printf(" mod_start = 0x%x, mod_end = 0x%x, string = %s\n",
(unsigned)mod->mod_start,
(unsigned)mod->mod_end,
(char *)mod->string);
mod += sizeof (module_t);
}
It seems to me that the problem is on the last line... it doesn't seem to increment to the next module info block properly! Is this a bug in GRUB? Has the multiboot standard changed? All module info blocks (afaik!!) should be located, one after the other, and are each 16 bytes long...
Any ideas?
Jeff
I'm trying to grab a list of all the modules GRUBs loaded for my kernel, but GRUB only returns the first module. All others (despite GRUB saying it has loaded them) come back as start 0, length 0!!!
My code is almost an exact rip of the multiboot example found on the multiboot specs page:
printf("mods_count = %d, mods_addr = 0x%x\n",
(int)multibootInfo->mods_count,
(int)multibootInfo->mods_addr);
mod = (module_t *) multibootInfo->mods_addr;
for(i = 0; i < multibootInfo->mods_count; i++) {
printf(" mod_start = 0x%x, mod_end = 0x%x, string = %s\n",
(unsigned)mod->mod_start,
(unsigned)mod->mod_end,
(char *)mod->string);
mod += sizeof (module_t);
}
It seems to me that the problem is on the last line... it doesn't seem to increment to the next module info block properly! Is this a bug in GRUB? Has the multiboot standard changed? All module info blocks (afaik!!) should be located, one after the other, and are each 16 bytes long...
Any ideas?
Jeff