Page 1 of 1

Grub2 load modules

Posted: Fri Jan 30, 2015 1:33 am
by HyperAssembler
Hi guys,

I am planning to use grub2 to load 64-bit kernel as a module and jump to it from 32-bit multiboot-complaint kernel.

My grub.cfg is

Code: Select all

menuentry "OS" {
	insmod kernel64
	multiboot kernel32.bin
}
(kernel64.mod is in /boot/grub/i386-pc/)
The problem is grub says "invalid arch-dependent elf magic" and I'm pretty sure it happens when I try to load kernel64 module(without insmod kernel64 it works well).

kernel64 and kernel32.bin are linked as a flat binary file.

So how do I solve the problem and are there any specific requirements on the format of grub2 modules?

Please note that : I tried to google it and google gave me all "reinstall grub2" garbage from ask ubuntu.

Thanks for you time!!

Re: Grub2 load modules

Posted: Fri Jan 30, 2015 1:52 am
by HyperAssembler
OMG it's solved.

I am not supposed to use insmod :(
I should though use module
See:
http://forum.osdev.org/viewtopic.php?f= ... 85&start=0