Page 1 of 1

No module information in multiboot2 tags

Posted: Mon May 23, 2016 6:44 pm
by heat
Hello,

I'm trying to get the module address so I can access my initrd. My old kernel would get it using a similar grub.cfg, but using multiboot1. Now I'm trying to use multiboot2 to boot the new x86_64 kernel. I already was able to get the framebuffer info and the memory map. The problem is that grub 2 doesn't pass the module tag to the kernel. I tried messing with the header tags but it didn't change a thing.

My grub.cfg:

Code: Select all

menuentry "Spartix" {
	set timeout=10
	loadfont unicode
	insmod vbe
  	insmod vga
  	insmod xzio
	insmod gzio
  	insmod gfxterm
	terminal_output gfxterm
	echo "Loading the vmspartix kernel"
	multiboot2 /boot/vmspartix.xz
	echo "done."
	set gfxpayload=1024x768x32
	echo "Loading the initrd"
	module /boot/initrd.tar.xz
	echo "done."
	boot
}
Multiboot2 header: https://github.com/PedroFalcato/Spartix ... _64/boot.S
Multiboot2 tag parsing code: https://github.com/PedroFalcato/Spartix ... kernel.cpp

Thanks for the help :D

Re: No module information in multiboot2 tags

Posted: Mon May 23, 2016 10:13 pm
by kzinti
Replace:

Code: Select all

	module /boot/initrd.tar.xz
With:

Code: Select all

	module2 /boot/initrd.tar.xz

Re: No module information in multiboot2 tags

Posted: Tue May 24, 2016 1:32 am
by heat
kzinti wrote:Replace:

Code: Select all

	module /boot/initrd.tar.xz
With:

Code: Select all

	module2 /boot/initrd.tar.xz
Thanks!! It worked!

May I ask where you get all these commands? If I try to look in the Grub 2 documentation, it usually doesn't show or describe too much of multiboot commands ( and module ). It just shows linux stuff and freebsd stuff, etc.

Thanks,

Re: No module information in multiboot2 tags

Posted: Tue May 24, 2016 9:30 am
by kzinti
TheRussianFail wrote: May I ask where you get all these commands? If I try to look in the Grub 2 documentation, it usually doesn't show or describe too much of multiboot commands ( and module ). It just shows linux stuff and freebsd stuff, etc.
I couldn't find the commands either. I spent quite a few hours on it. That is until I decided to download the Grub source code and read it to figure this one out.

I still don't understand why Grub has the multiboot2/module2 commands. It should just look for both headers with the multiboot/module commands.