Aloha all,
I was just working with the barebones tutorial on creating a correct multiboot elf kernel. In the tutorial it pushes eax then ebx. In the multiboot spec (0.6.95) the first parameter that is passed is ebx then eax. I was just wondering if this was intentional and there is something I am missing or if it was just based of off an older multiboot spec.
Thanks,
Bryce
Bare Bones tutorial on GRUB
- codemastersnake
- Member
- Posts: 148
- Joined: Sun Nov 07, 2004 12:00 am
- Contact:
- os.hacker64
- Member
- Posts: 149
- Joined: Mon Feb 11, 2008 4:43 pm
- Location: Limbo City,Afterlife
Re: Bare Bones tutorial on GRUB
A brother Hawaiian!birie wrote:Aloha all,
I was just working with the barebones tutorial on creating a correct multiboot elf kernel. In the tutorial it pushes eax then ebx. In the multiboot spec (0.6.95) the first parameter that is passed is ebx then eax. I was just wondering if this was intentional and there is something I am missing or if it was just based of off an older multiboot spec.
Thanks,
Bryce
Kanu Operating System
Working on:Paging and Multitasking
BURN /\/\1(40$0|=7
Working on:Paging and Multitasking
BURN /\/\1(40$0|=7
Aaaahhhhh... that explains it, then.birie wrote:I suppose it all depends on how you write your c function. I copied the kernel.c code from the multiboot spec website and needed to swap.
Multiboot: kernel.c
Code: Select all
void cmain (unsigned long magic, unsigned long addr)
Code: Select all
void main( void* mbd, unsigned int magic )
This isn't a mistake either in the BareBones or the Multiboot docs, as there is no "right" way to put the parameters on the stack. You just tried to slice & dice code from two different sources, and got bitten by a difference in interface.
Every good solution is obvious once you've found it.