gcc/Mac?

If you are new to OS Development, plan on spending some time here first before going into the other forums.

Moderator:Moderators

Post Reply
ddsdiur
Posts:1
Joined:Sun Nov 16, 2008 3:19 am
gcc/Mac?

Post by ddsdiur » Sun Nov 16, 2008 3:23 am

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?
3.141592653589793

Andyhhp
Moderator
Posts:387
Joined:Tue Oct 23, 2007 10:05 am
Location:127.0.0.1
Contact:

Post by Andyhhp » Sun Nov 16, 2008 6:06 am

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
Image

Post Reply