OSDev with 64-bit C++
Posted: Sat Oct 24, 2009 5:35 am
Hello,
I recently started messing around with 64-bit OSDev. I managed to get into my C/C++ entry point just fine. The only question I have is how does 64-bit relate to calling global/static constructors from the linker script and the compiler-dependencies? In my current OS (32-bit), I have pretty much everything necessary to run C++ (according to our wiki article), including the looping of the static/global constructors. However, now I am in 64-bit, I'm wondering when I should loop the constructors (in 32-bit mode, or 64-bit mode?) and better: are the addresses I grab from the linker script with the EXTERN directive now 64-bits (i.e. must I use 64-bit registers for it now?).
Last but not least: I was wondering if any of the other dependencies, such as the Stack-Smashing Protector and the __dso_handle, are different in 64-bits? Are there any other pitfalls I should watch out for in 64-bit C++?
Thanks in advance,
Creature
I recently started messing around with 64-bit OSDev. I managed to get into my C/C++ entry point just fine. The only question I have is how does 64-bit relate to calling global/static constructors from the linker script and the compiler-dependencies? In my current OS (32-bit), I have pretty much everything necessary to run C++ (according to our wiki article), including the looping of the static/global constructors. However, now I am in 64-bit, I'm wondering when I should loop the constructors (in 32-bit mode, or 64-bit mode?) and better: are the addresses I grab from the linker script with the EXTERN directive now 64-bits (i.e. must I use 64-bit registers for it now?).
Last but not least: I was wondering if any of the other dependencies, such as the Stack-Smashing Protector and the __dso_handle, are different in 64-bits? Are there any other pitfalls I should watch out for in 64-bit C++?
Thanks in advance,
Creature