Talk:Calling C++ Constructors From C++

From OSDev Wiki
Jump to: navigation, search

Isn't "porting code from assembly to C++" a bit below the expected level of this wiki? I mean, everybody who enters this site should already have knowledge how to do it - and most of people will either 1) avoid global objects or just 2) use the assembly code from Bare Bones... -- Griwes 11:21, 2 July 2012 (CDT)

Calling constructors and destructors (incorrectly)

Hmm, having added support for this to my libc, it would look like this article is doing it wrong. It should use the crtbegin.o and crtend.o object files and use the the linker script to insert kernel-specific crti.o and crtn.o files in the right places, and then call _init. I am yet to do this my kernel, so I am not sure of the specifics. This tutorial seems to mess with GCC internals.

Personal tools