Creating GRUB ISO image

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
blm768
Member
Member
Posts: 45
Joined: Fri Jun 29, 2012 11:32 am

Creating GRUB ISO image

Post by blm768 »

I've been trying to create a bootable GRUB image for my OS, but I can't figure out how to get it to work. I've based my setup on the GRUB2 wiki page.

File tree:

Code: Select all

-iso:
    -boot:
    -boot32.bin
    -grub:
        grub.cfg
My grub.cfg is:
menuentry "OS" {
multiboot /boot/boot32.bin
boot
}

The command I'm using to make the image:
grub-mkrescue --modules="multiboot biosdisk iso9660 sh" -o boot.iso iso

When I try this, GRUB brings up its menu with the proper entry, but it gives the error "unsupported flag: 0xb."

Running the code with qemu's -kernel flag works just fine, so I'm not sure what could be wrong. I'm thinking that my Multiboot header might be misaligned, but that seems doubtful because it's right at the beginning of the .text section.
jnc100
Member
Member
Posts: 775
Joined: Mon Apr 09, 2007 12:10 pm
Location: London, UK
Contact:

Re: Creating GRUB ISO image

Post by jnc100 »

What value are you using for the 'flags' field in the multiboot header in your kernel? Grub seems to think you are setting bits 0, 1 and 3 (0xb) and setting bit 3 is unsupported. From a quick read of the sources, it will only produce this error if it has already found the multiboot header (as identified by the magic number and a valid checksum) so your problem is probably not alignment issues.

Regards,
John.
blm768
Member
Member
Posts: 45
Joined: Fri Jun 29, 2012 11:32 am

Re: Creating GRUB ISO image

Post by blm768 »

jnc100 wrote:What value are you using for the 'flags' field in the multiboot header in your kernel? Grub seems to think you are setting bits 0, 1 and 3 (0xb) and setting bit 3 is unsupported. From a quick read of the sources, it will only produce this error if it has already found the multiboot header (as identified by the magic number and a valid checksum) so your problem is probably not alignment issues.

Regards,
John.
That's what I found as well, but I fixed the issue in my source without results. I initially thought that it was reading some other data as the header, but I just realized that my build system might have "forgotten" to rebuild it; it's a bit convoluted because I'm using an IDE and had to patch in a custom build tool (make macros are horribly broken :)).
Post Reply