Exceptions & RTTI in the C++ kernel

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
User avatar
arabasso
Member
Member
Posts: 27
Joined: Thu Jul 10, 2008 9:41 am

Exceptions & RTTI in the C++ kernel

Post 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.
jnc100
Member
Member
Posts: 775
Joined: Mon Apr 09, 2007 12:10 pm
Location: London, UK
Contact:

Re: Exceptions & RTTI in the C++ kernel

Post 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.
User avatar
arabasso
Member
Member
Posts: 27
Joined: Thu Jul 10, 2008 9:41 am

Re: Exceptions & RTTI in the C++ kernel

Post by arabasso »

I needed something more specific. Someone knows only a tutorial for that matter?
User avatar
kataklinger
Member
Member
Posts: 381
Joined: Fri Nov 04, 2005 12:00 am
Location: Serbia

Re: Exceptions & RTTI in the C++ kernel

Post 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.
Post Reply