Reputation: 127
I am learning NASM as I write bootloaders. So far I have a hello world bootloader. I want to know how to link a c program to it and have the bootloader load it into memory and start executing it's entry point function. I need NASM code as I am a NASM n00b. Thank you very much for you help.
EDIT: Basically I need to know how to link the c program and I need NASM code to tsrat it's entry point function. Any gotchas I should know about?
Upvotes: 9
Views: 5777
Reputation: 26181
Although this tutorial is for C++, its the exact same procedure (the tutorial lists the parts that are C++ specific, which are just the static ctors & dtors).
when ever your are having problems in this area, osdev.org generally has the answer or a tutorial
Upvotes: 7
Reputation: 22412
There are tons of gotchas about booting a kernel:
Here is a good resource http://linuxgazette.net/issue77/krishnakumar.html
that should get you started.
Upvotes: 2