Page 1 of 1
Grub Module
Posted: Tue Aug 14, 2007 7:05 pm
by artrecks
Does Grub load modules in the memory or the module names are just passed to the kernel??
If it loads the modules in the memory, what memory position does it use?
Posted: Tue Aug 14, 2007 7:43 pm
by pcmattman
GRUB loads the modules into memory, and then it passes you the locations via the multiboot header (mods_addr field).
Example:
Code: Select all
// the module list
module_t* mods = (module_t*) MultiBootHeader->mods_addr;
// temporary ELF relocation class
ELFRelocation tmpreloc;
// loop through and load each module
for( int i = 0; i < MultiBootHeader->mods_count; i++ )
{
// load it, and execute it
tmpreloc.LoadFile( mods[i].mod_start );
tmpreloc.RelocateExecutable();
}
Posted: Wed Aug 15, 2007 9:10 am
by artrecks
thanks
Posted: Wed Aug 15, 2007 9:36 am
by oscoder
GRUB loads the modules into memory, and then it passes you the locations via the multiboot header
Is there any way to choose where the modules are loaded?
Thanks,
OScoder
Posted: Wed Aug 15, 2007 10:22 am
by AJ
I don't believe there is - I'm afraid you have to relocate them yourself.
Cheers,
Adam