C or C++
Re: C or C++
Well, C is a very straightforward programming language, and it's possible to use it roughly as a glorified assembler if needed.
C++ has a lot of built in functionality that you might or might not want to use, but that adds a lot of complication in the context of standard library-less systems as most kernels.
I reccomend you have a look at the FAQ, it does a resonably good job of explaining how to use c++ for kernel development.
It basically boils down to having to explicitly telling the linker not to link with the c++ library and either staying away from dynamic allocation or defining your own.
Of course, you will not be able to use STL or similar libraries unless you include them.
So while using C++ might make for a cleaner design, it will also complicate matters a bit.
C++ has a lot of built in functionality that you might or might not want to use, but that adds a lot of complication in the context of standard library-less systems as most kernels.
I reccomend you have a look at the FAQ, it does a resonably good job of explaining how to use c++ for kernel development.
It basically boils down to having to explicitly telling the linker not to link with the c++ library and either staying away from dynamic allocation or defining your own.
Of course, you will not be able to use STL or similar libraries unless you include them.
So while using C++ might make for a cleaner design, it will also complicate matters a bit.
Re: C or C++
Hi,
IMHO, C++ is a bad choice for the kernel itself as the C code generated is much. I think you've got more control on the code that is generated when you write it in C.
IMHO, C++ is a bad choice for the kernel itself as the C code generated is much. I think you've got more control on the code that is generated when you write it in C.