Code: Select all
push eax ; Multiboot magic number
push ebx ; Multiboot info structure
But when I check the GRUB example files, they push ebx first and then eax...
Really, if it's a stack, it would be more logical to first put the last argument (in the c function declaration), but as it's the official example...
Also, when I tried to run this method first thing in my kernel:
Code: Select all
/** Checks the magic flag.
* The header constant is defined in multiboot.h
*/
void check_magic(unsigned int magic)
{
if (magic == MULTIBOOT_HEADER_MAGIC)
{
return;
}
else
{
panic("Multiboot header magic flag not correct!");
}
}
But anyway, even the GNU Assembler example of BareBones first pushes eax and the GRUB reference first ebx; and both are in gas (I first thought things were different on NASM)...
Could anyone explain, please...