Operating Systems Kernel Compilation

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Nima

Operating Systems Kernel Compilation

Post by Nima »

What's the best compiler I can use to compile my kernel code which I want to write using C and Assembly?  Thank you whoever you are.
ka3r

RE:Operating Systems Kernel Compilation

Post by ka3r »

If you are using a Linux system, the best are GCC for the C source code, and NASM for the assembly one.
carbonBased

RE:Operating Systems Kernel Compilation

Post by carbonBased »

*best* is pretty relative :)

If you're looking for quality compilers, assemblers that are in wide use and available freely on the net, then gcc and nasm are probably your best bet.

Personally, I use gcc for compiling my kernel, but for modules (and eventually the kernel as well) I use lcc 3.6, simply because it's smaller, easier to modify (I've modified LCC to reflect the building environment for my new OS, and to produce rdoff objects).  I'm also using nasm for all the assembly language (and LCC backend).

In time, I'd also like to rewrite the kernel in my own language (www.neuraldk.org/inCode.html) with nasm as a backend.  Personally, I think this is the *best* approach because, of course, I know exactly how the compiler works, and can add features (easily) as needed.

Cheers,
Jeff
Post Reply