Page 1 of 1
Now On My Playground
Posted: Sun Aug 23, 2009 6:12 pm
by Nathan
Hello,
If you see my post history, i was learning Assembly and trying to develop an OS, then i remember that Linux(That i use) was developed in C, but i know C++, then i want to know how i can build a boot loader, that boots a compiled C++ source code and the second thing is: You can post the code of a Hello World OS in C++, just for use as template, after i will be as my own, and stop asking stupid questions only because i don't know the basics of Assembly. A normal Hello World is here:
Code: Select all
#include <iostream>
using namespace std;
int main() {
cout << "Hello, World";
return 0;
}
How i can do this code, but for an OS, not to run in an OS, but to be an OS.
Thanks,
Nathan Paulino Campos
Re: Now On My Playground
Posted: Sun Aug 23, 2009 6:15 pm
by pcmattman
C++ and
C++ Bare Bones.
Oh, and
Beginner Mistakes.
Basically, you can't use cout (or any static object for that matter) without writing it all - support code, and the classes themselves - yourself.
Re: Now On My Playground
Posted: Sun Aug 23, 2009 6:19 pm
by Nathan
Thanks pcmattman, but you can post the code of a simple Hello World OS?
Thanks!
Re: Now On My Playground
Posted: Sun Aug 23, 2009 6:22 pm
by pcmattman
No, I can't. You can actually try learning and perhaps even do it yourself, rather than copying and pasting code from other people.
Re: Now On My Playground
Posted: Sun Aug 23, 2009 6:24 pm
by Nathan
I just want the code of a Hello World OS, because i know C++ for Linux and Windows, copy, move, merge and my own interpreter, this is one of the things that i developed.
Thanks!
Re: Now On My Playground
Posted: Sun Aug 23, 2009 6:26 pm
by pcmattman
If you really know C++ you shouldn't have a problem in taking a day or two to step back, learn a little, and then build it yourself. You've got all the time in the world, why rush the most important steps of this project?
Re: Now On My Playground
Posted: Sun Aug 23, 2009 6:27 pm
by xvedejas
Nathan wrote:I just want the code of a Hello World OS, because i know C++ for Linux and Windows, copy, move, merge and my own interpreter, this is one of the things that i developed.
Thanks!
Nathan, it's a lot more than that. It's not nearly that simple. To realize how much more it is than that, please look at the wiki.
Re: Now On My Playground
Posted: Sun Aug 23, 2009 6:29 pm
by Nathan
Ok, but the only thing that i want is a C++ Hello World OS, because the boot in Assembly i know.
Thanks!
Re: Now On My Playground
Posted: Sun Aug 23, 2009 6:30 pm
by neon
IIRC you already know how to develop a "Hello World OS" - just boot and display a message.
To go into C code isn't that hard, but is beyond a 'hello world OS'. All you need to do is get the C program in memory and execute its entry point to run it. The specific details of it depends on your design (there are different ways to get it into memory) and file format (elf and pe are very different to parse.)
Re: Now On My Playground
Posted: Sun Aug 23, 2009 6:31 pm
by pcmattman
Have a look on the wiki at the C Bare Bones, the C++ Bare Bones, the C++ article itself (which has a wealth of kernel-specific information). Learn from the wiki, and build your OS. For the most part the very core of your C++ OS will be the same as the core for a C OS.
Re: Now On My Playground
Posted: Sun Aug 23, 2009 6:33 pm
by Nathan
Ok, reading now!