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.
I'm using GRUB2 to boot my OS. There are three binary files: the loader, the kernel and the ramdisk. The loader is loaded as the multiboot kernel file, and the kernel and ramdisk are loaded as multiboot modules. So my configuration looks like this:
set timeout=0
set default=0
menuentry "Ghost" {
multiboot /boot/loader
module /boot/kernel /boot/kernel
module /boot/ramdisk /boot/ramdisk
boot
}
This already works fine (even though I had to specify the path for each module twice, otherwise the path in the multiboot structures would be empty, whyever).
My problem is that I just can't find a documentation on what parameters the module command can take. The only thing I found in the GRUB 2.0 documentation is the way this command is used in GNU HURD or for Linux..
Could someone please help me to find the documentation for this command?
Looking at GRUB's source code, the implementation of the "module" command ("grub_cmd_module") is fairly simple.
The first parameter is the filename and the second parameter is optionally, "--nounzip", which disables GRUB's automatic decompression of .gz and .xz files. All other parameters are placed in the "cmdline" field (e.g. the filename in your example).
mallard wrote:Looking at GRUB's source code, the implementation of the "module" command ("grub_cmd_module") is fairly simple.
The first parameter is the filename and the second parameter is optionally, "--nounzip", which disables GRUB's automatic decompression of .gz and .xz files. All other parameters are placed in the "cmdline" field (e.g. the filename in your example).
Oh right.. looking at the source is a good idea
Sadly, in the GRUB version 1.98 (had to take the one from Cygwin for the moment, but I guess its obsolete) I have to pass the second parameter, otherwise the "path" in the multiboot structures is empty. I'll investigate on that.
Thanks for pointing me to the right source files
max wrote:Sadly, in the GRUB version 1.98 (had to take the one from Cygwin for the moment, but I guess its obsolete) I have to pass the second parameter, otherwise the "path" in the multiboot structures is empty. I'll investigate on that.
There is no path-field. There's only cmdline, and it only contains the parameters.
max wrote:Sadly, in the GRUB version 1.98 (had to take the one from Cygwin for the moment, but I guess its obsolete) I have to pass the second parameter, otherwise the "path" in the multiboot structures is empty. I'll investigate on that.
There is no path-field. There's only cmdline, and it only contains the parameters.
The multiboot specification is unprecise in several places. That's why I recommend to also have a look at the multiboot.h-header, which defines it like that:
struct multiboot_mod_list
{
/* the memory used goes from bytes 'mod_start' to 'mod_end-1' inclusive */
multiboot_uint32_t mod_start;
multiboot_uint32_t mod_end;
/* Module command line */
multiboot_uint32_t cmdline;
/* padding to take it to 16 bytes (must be zero) */
multiboot_uint32_t pad;
};
No problem
Oh, and a little sidenote: I recently played around with iPXE, which also supports multiboot. When using the "kernel"-command to load a multiboot-compatible kernel, iPXE, in contrast to GRUB 2, does include the path. So instead of "-verbose" the cmdline-field of the multiboot-info-structure contained something like "http://192.168.1.50/frost.krn -verbose". Seems like you have to expect both behaviors. Or you force people to use GRUB 2
However, I had a lot of problems with iPXE's multiboot implementation, so I ended up chainloading a GRUB-ISO anyway.
/edit:
Is your project open source? I'm interested in taking a look at it