C++ kernel?

If you are new to OS Development, plan on spending some time here first before going into the other forums.

Moderator:Moderators

Post Reply
andrewq2
Posts:5
Joined:Mon Dec 29, 2008 4:30 pm
C++ kernel?

Post by andrewq2 » Thu Feb 05, 2009 4:15 am

I know a lot of c++ and wanted to make an os but i see a lot of c tut's but no c++ and i don't want to learn c also then i might get confused. what i want to know is is it possible to write a kernel in c++ and if so is there any links to help me?

LordMage
Posts:2
Joined:Wed Dec 31, 2008 11:47 pm
Location:Kentucky
Contact:

Post by LordMage » Fri Feb 06, 2009 1:39 am

It is completely possible, in the Tutorials by mike, he coments about possible releasing the demos in C++ even though to date he hasn't done it. The differences between c and c++ are small really. in c you use structs and typedefs, in c++ you use classes with public and private members. but the basic code is the same. It just takes different organization. I took all of the code in the tutorials here and converted it to namespaces and classes before I decided to go back to the drawing board. I will have to redo all of it based on what I have learned but I too plan on making my kernel c++. I don't know of any good tutorials for this but I do know where some demo code that will get you basically upto a cheap console without paging and such. I would suggest using mikes idt and gdt code instead of what is in the code I will show you. Although you can use the layout/format of what is in the code. anyway I wish you luck and here is the page you can find that sample at:

http://www.planet-source-code.com/vb/sc ... 8&lngWId=3

Again, I would say that is barebones and would benefit much from what is explained in mikes tutorials.
There is only one reason to do anything. You enjoy it.

Andyhhp
Moderator
Posts:387
Joined:Tue Oct 23, 2007 10:05 am
Location:127.0.0.1
Contact:

Post by Andyhhp » Fri Feb 06, 2009 5:51 pm

It is easy to addapt the tutorials as they stand to being in C++. I have always done my kernel in C++ while following the tutorials.

Due to time, and repeatedly breaking computer(s) i am a long way behind the tutorials in the ammount of code I have actually made.

However, when I managed to read my old partiton, I shall post the basic structure I have so you can use it as a pointer (excuse the pun) if you want.

~Andrew
Image

Post Reply