Page 1 of 1
gcc/Mac?
Posted: Sun Nov 16, 2008 3:23 am
by ddsdiur
How would I get to the level of writing the kernel in C or C++ using a Mac and the gcc, ld, and nasm? I can't seem to port the code to work with GCC, and configuring it with proper flags completely mystifies me. Is there anyone here who has made this work?
Posted: Sun Nov 16, 2008 6:06 am
by Andyhhp
Here is a link to an old tutorial that shows how to use gcc and ld to write a kernel.
http://www.osdever.net/bkerndev/bkerndev.zip
it goes about initialization in a different way although it shouldn't be hard to take this example and apply it to the brokenthorn method.
You will have to remove all the MSCV specific code. Also, you will only be able to do inline assembly using AT&T style asm, not nasm style.
http://wiki.osdev.org/C_PlusPlus
Here is a page that will show you how to do the global constructors and destructors code.
Have fun,
~Andrew