Page 1 of 1

What don't I have to implement?

Posted: Thu Nov 13, 2008 7:37 pm
by TheDragon
Hello. I am going to get serious in my endeavors to make an operating system. However, there is some confusion in my mind as exactly what I need to code, as many of the tutorials use features of C/C++ that I would have thought to have been implemented, such as OOP, pointers, and other such things. I know that one needs to at least implement a STL for some of the functions to work (such as cout and malloc), but what else needs to be done by me and what is built into the computer? Thanks for all your help

--The Dragon

Re: What don't I have to implement?

Posted: Thu Nov 13, 2008 7:47 pm
by CodeCat
For OOP you don't need any support, except if you need RTTI features like typeid or dynamic_cast. You don't need support for templates either, they work right out of the box. But nothing from the standard include files will work, so pretty much anything you'd need to type #include < for is out of bounds. Include only your own files.

Re: What don't I have to implement?

Posted: Thu Nov 13, 2008 7:58 pm
by Love4Boobies
TheDragon wrote:such as OOP, pointers, and other such things.
There's an article on the wiki about using C++ for osdev. It clearly states there's no need to set up anything for OOP. As for pointers, why would you think you'd need to implement support? :) Pointers are just normal variables that are used as addresses.

Code: Select all

NULL: EQU 0

mov [ptr],var1 ; ptr points to var1
mov [ptr],var2 ; ptr points to var2

ptr: dw NULL
var1: db ..
var2: db ..

Re: What don't I have to implement?

Posted: Fri Nov 14, 2008 9:20 pm
by TheDragon
Love4Boobies wrote:
TheDragon wrote:such as OOP, pointers, and other such things.
As for pointers, why would you think you'd need to implement support? :) Pointers are just normal variables that are used as addresses.
Darn. I knew they were variables that contained the address of another variable, but I wasn't thinking, I guess. I still have to completely grasp the whole pointer thing. *sigh*

Thanks for the help, though.