I am trying to make a minimal kernel. My goal is to make this not-yet-existing kernel to be multiboot2 compliant. So I started out by creating a minimal multiboot2-header in NASM-Assembly.
I am using grub-file to test whether my binary is compliant.
The problem: When I assemble my file to an elf32, grub-file is happy. However, when i assemble my header to a raw binary using nasm, the resulting file is not compliant.
Why is that? In the multiboot2 specification no specific executable-format is specified.
multiboot2header.asm:
section .multiboot
align 8,db 0
multibootheader_start:
dd 0xE85250D6
dd 0
dd (multibootheader_end - multibootheader_start)
dd -(0xE85250D6 + multibootheader_end - multibootheader_start)
multibootheader_end:
NASM commands:
nasm -felf32 multiboot2header.asm -o multiboot2header.bin
nasm -fbin multiboot2header.asm -o multiboot2header.bin
grub-file command:
grub-file --is-x86-multiboot2 multiboot2header.bin