[SOLVED] GRUB: No multiboot header found

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
forgetme11
Posts: 7
Joined: Mon Dec 09, 2024 12:29 am

[SOLVED] GRUB: No multiboot header found

Post by forgetme11 »

This is the multiboot2 header in the disassembled binary:

Code: Select all

0000000000000000 <multiboot2_header>:
       0:       e8 52 50 d6 00          call   d65057 <initial_stack+0xd5668f>
       5:       00 00                   add    %al,(%rax)
       7:       00 10                   add    %bl,(%rax)
       9:       00 00                   add    %al,(%rax)
       b:       00 17                   add    %dl,(%rdi)
       d:       ad                      lods   %ds:(%rsi),%eax
       e:       af                      scas   %es:(%rdi),%eax
       f:       1A ...
The fields summed should wrap around to 32bit 0, the specification says nothing else is needed from an ELF kernel.

This is the text section from linkconfig.ld (copied from wiki.osdev.org/Bare_Bones#Linking_the_Kernel):

Code: Select all

        .text BLOCK(4K) : ALIGN(4K)
        {
                *(.multiboot)
                *(.text)
        }
In case there is some known (not to me) GRUB2 quirk I followed wiki.osdev.org/GRUB to make an iso bootable by qemu

edit: I had forgot to change the length from 0x18 to 0x10 after removing a tag #-o from the header, take 3, problem persists, I am the worst developer in the world.
Last edited by forgetme11 on Tue Dec 10, 2024 7:37 am, edited 4 times in total.
User avatar
iansjack
Member
Member
Posts: 4703
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: GRUB: No multiboot header found

Post by iansjack »

Your magic number is 0xD65052E8. It should be 0xE85250D6.
forgetme11
Posts: 7
Joined: Mon Dec 09, 2024 12:29 am

Re: GRUB: No multiboot header found

Post by forgetme11 »

Looks right to me, the bytes are on the left, the right is just what the assembler interpreted that as...
User avatar
iansjack
Member
Member
Posts: 4703
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: GRUB: No multiboot header found

Post by iansjack »

The x86 is a little-endian processor.
forgetme11
Posts: 7
Joined: Mon Dec 09, 2024 12:29 am

Re: GRUB: No multiboot header found

Post by forgetme11 »

#-o
Yeah it works now lol, thank you.
Post Reply