Page 1 of 1

Exceptions & RTTI in the C++ kernel

Posted: Mon Jul 21, 2008 7:45 am
by arabasso
(Sorry for my poor English)

I am developing a kernel in C++, and would like to use RTTI and exceptions. The compiler used is the DJGPP (GCC 4). I ask this because I don't have found information anywhere.

I founded this References:

http://wiki.osdev.org/C_PlusPlus
http://www.osdever.net/tutorials/pdf/cpp_kernel.pdf
http://www.codesourcery.com/public/cxx-abi/abi-eh.html
http://www.codeproject.com/KB/cpp/exceptionhandler.aspx
http://wiki.osdev.org/Porting_GCC_to_your_OS
http://wiki.osdev.org/Porting_Newlib
http://wiki.osdev.org/OS_Specific_Toolchain
http://wiki.osdev.org/GCC_Cross-Compiler

But could not help me much. Does anyone already tried a kernel 100% in C++?

Thank you.

Re: Exceptions & RTTI in the C++ kernel

Posted: Mon Jul 21, 2008 9:48 am
by jnc100
First, I'd recommend making your own cross compiler rather than relying on djgpp. You can follow the GCC Cross-Compiler tutorial to achieve this (you'll also need cygwin as I don't think djgpp has the infrastructure for running configure scripts?). Once you have that, the only extra thing you need for rtti/exceptions is the libsupc++ library, which has a few extra requirements, see libsupcxx. Alternatively, the OS Specific Toolchain tutorial has complete instructions for doing it from scratch, and everything seems to fit together better.

Regards,
John.

Re: Exceptions & RTTI in the C++ kernel

Posted: Mon Jul 21, 2008 12:04 pm
by arabasso
I needed something more specific. Someone knows only a tutorial for that matter?

Re: Exceptions & RTTI in the C++ kernel

Posted: Mon Jul 21, 2008 12:45 pm
by kataklinger
Here's the article that discusses Visual C++'s internal implementation of exception. The trick is that the internal implementation is not defined by the standard, so it depends on specific compiler as well as underlying operating system.