I am developing a kernel in C++. But I do not want to write a stdlib
; for that purpose I have downloaded STLport
http://www.stlport.org/, but I don't know how to install and use it.
I am using Linux for building my kernel.
How can I use c++ standard libs in my kernel?
And I do not want to port all libs from STLport. How can I exclude a selection of libs? Like std::string
, std::vector
etc.
In order for STL to work you have to port several things like static initialization (for i.e. std::cin and std::cout) and stack unwinding...
you'd have to port i.e.: libsupc++ and have that in your kernel. Basically all this stuff shouldn't be in the Kernel in the first place. DON'T use Vectors use static arrays because vectors might reallocate your data!
also all that stuff will bloat your kernel for nothing!
you can have a look what L4 allows itself to be used in kernel. they don't do memory allocation and they don't do exceptions (unpredictable) and they especially don't do STL.
The latter links shall give you an idea what you need to port to get c++ operating system support. Libsupc++ is part of gcc. it's purpose is to encapsulate all the parts where runtime code is needed.