Grub Module

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
artrecks
Posts: 23
Joined: Wed Jul 11, 2007 8:24 pm

Grub Module

Post 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?
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post 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();
	}
artrecks
Posts: 23
Joined: Wed Jul 11, 2007 8:24 pm

Post by artrecks »

thanks
oscoder
Member
Member
Posts: 59
Joined: Mon Mar 27, 2006 12:00 am
Location: UK

Post 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
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Post by AJ »

I don't believe there is - I'm afraid you have to relocate them yourself.

Cheers,
Adam
Post Reply