ASM/C++ question

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
JBird80

ASM/C++ question

Post by JBird80 »

hello im just started working on a basic OS and i have a few questions that i hope some one can help me with.

1. i wrote a basic bootsector and i would like to write the kernel in C++ but do i have to recreate all the C++ functions in ASM? (i saw an examble were they did that with C). or do i have to write most of the kernel in ASM?

2. also my asm is realy bad any one know of a good tutorial site?

Jason Bird
[email protected]
anon

RE:ASM/C++ question

Post by anon »

Well, if you are wanting to use C++, you have to remember a few special problems when doing it.

As long as you write an appropriate wrapper in assembly for your code, you should be alright when using a C++ kernel.  You must also understand that C++ usually does some things like function name distortion that you have to ignore (extern "C" { } )  Also, some basic C++ functions like new and delete will no longer be avaliable unless you code them yourself.  Other than that, I have seen kernels work using C++, without writing most of the kernel in ASM.

You just have to make sure you do it right.
Post Reply