Passing Values from Bootloader to Kernel
Posted: Thu Dec 22, 2011 4:43 am
I've been trying to figure out how to pass values from the boot loader to the Kernel. Eventually I want to be able to pass information about the memory map that I can get in real mode.
I am aware that there is the multiboot standard, but for now I'm not planning on implementing it, as it looks quite complicated. I will get to it one day though.
So far, I can pass a simple integer with something like:
and
Am I able to pass a pointer to a structure? For example, can I pass a pointer to the buffer where I'm getting int 0x15 to store the memory map?
As a simple test, I created a structure in the bootloader and assigned some random values to its members, but I couldn't get it to pass the correct information.
Am I barking up the wrong tree? Should I invest the time into multiboot?
Thanks
I am aware that there is the multiboot standard, but for now I'm not planning on implementing it, as it looks quite complicated. I will get to it one day though.
So far, I can pass a simple integer with something like:
Code: Select all
push dword 1234
Code: Select all
int main(int pass) {
printf ("%d\n", pass);
...
As a simple test, I created a structure in the bootloader and assigned some random values to its members, but I couldn't get it to pass the correct information.
Am I barking up the wrong tree? Should I invest the time into multiboot?
Thanks