Page 1 of 1
Question about developing a kernel in C/C++
Posted: Thu Dec 26, 2002 3:31 pm
by SNeKKe
hi everybody,
i'm currently learning C as you might have already read in my previous topics.
Now, I was looking at a kernel that was using the printf...
In my book, the line
#include <iostream.h>
and then cout << "...";
can I use this include-things instead of the printf???
And are there any things I must watch out for?
Sorry for my bad English :-[
Thanks a lot!
Re:Question about developing a kernel in C/C++
Posted: Thu Dec 26, 2002 4:02 pm
by jrfritz
In making a OS you need your own printf...you can't use the ones pre-made...you have to use someone elses like mine or make your own...
cout is hard to make...so I made a printf...
Re:Question about developing a kernel in C/C++
Posted: Thu Dec 26, 2002 4:58 pm
by richie
if you print something in a normal programm, like you learn in your C/C++-book, you always calls functions. Although cout doesn't look like a function it actual is a function. Cout is a special kind of function. This type of functions are called operator functions. Operator functions are a new feature of C++. Before C++ there was c. To print something in c you use another function called printf. So if you want a normal programm to print something you have two functions to do that: cout and printf. Both of these functions call system functions of the operating system. If you want to develop your own operating system you cannot use printf or cout because they want to call system function and these system functions are not present. So you have to write your own functions for printing on the screen.
But I advice you to learn C/C++ and asm before starting your own operating system.
Re:Question about developing a kernel in C/C++
Posted: Thu Dec 26, 2002 7:42 pm
by Mr_Spam
cout and cin are macros of other functions.
Re:Question about developing a kernel in C/C++
Posted: Fri Dec 27, 2002 4:41 am
by Willy
I also thought that it would be hard to make cout, but really it wasn't. Of course, for now it only prints char messages
But i'm learning ... ;D