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!
Question about developing a kernel in C/C++
Re:Question about developing a kernel in C/C++
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...
cout is hard to make...so I made a printf...
Re:Question about developing a kernel in C/C++
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.
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++
cout and cin are macros of other functions.
Re:Question about developing a kernel in C/C++
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