C++ standard library support
Posted: Sat Nov 17, 2007 3:11 pm
Are there any tutorials on how to enable support for the C++ standard library in my kernel?
The Place to Start for Operating System Developers
http://f.osdev.org/
Try STLport, or Boost C++ Libraries. Although Boost technically isn't a C++ STL implementation, it's considered an extension of it and (I think) it can be used without an STL library.AusZero wrote:Are there any other libraries that I can use with my operating system?
Well, if you follow the instructions at OS Specific Toolchain you'll end up with a libsupc++, libstdc++ and an include directory with all the stl stuff in. There are obviously a lot of dependencies on libgcc (which you also get for free) and libc (which you get, but it is tailored for userspace, so writing a smaller kernel version might make more sense). I have never tried stl in a kernel, but can't see why it shouldn't work (as long as you implement malloc, strcpy etc), but I can vouch for the functioning of libsupc++, including exceptions and rtti, all within kernel space within a few lines of startup (although you need a simple malloc, e.g a stack-based one, before your virtual memory manager starts).AusZero wrote:Are there any tutorials on how to enable support for the C++ standard library in my kernel?