Re: GRUB: no multiboot header found
Posted: Wed Feb 20, 2019 11:06 am
Did you pass the pointer to the multiboot structure to your kernelmain? EBX contains the pointer to the multiboot structure, EAX should contain the value 0x2BADB002. You could pass both to kernelmain with something like:Then in kmain.c modify kernelmain's definition to be:.You will need to include multiboot.h at the top of kmain.c. That file can be found here: https://www.gnu.org/software/grub/manua ... 002eh.html . Assuming you have tested mbd->flags and bit 0 is set then where memsiz would be in bytes.
Code: Select all
mov esp, _sys_stack
call InstallGDT
push eax
push ebx
call kernelmain
jmp $
Code: Select all
void kernelmain(multiboot_info_t *mbd, uint32_t magic) {
Code: Select all
memsiz = 1024 * (mbd->mem_lower + mbd->mem_upper);