BareBones error?
Posted: Wed Mar 22, 2006 7:28 pm
I've found this error in BareBones (error?) from the FAQ:
Then, I adapt main, etc.
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:
It seemingly invokes the kernel panic method (I actually don't know, because I did run it on hardware and not on BOCHS) and reset. (The kernel panic method resets the computer after waiting a moment, but as the timer isn't yet set up at that moment... I think I'll try it in BOCHS later...
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...
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...