0

I have this idea that I want to write an operating system. I've started to learn C++, but I have a few questions...One is, obviously, am I using the right programming language? I have looked at a few forums on this site, and it seems to be half of the people saying that C++ is good for OS writing, and the other half saying that it's bad. (if whoever answers that question could give a reason, that would be nice) If C++ isn't a good programming language for this project, then what is?
The next question I have is where to start. Clearly, I have to become an expert at programming in whatever language I need first, but then where do I go? I kind of know what a kernel is, but if someone could explain more, that would be nice.
I'll probably come up with more questions later, but that's it for now.

4
Contributors
7
Replies
9
Views
8 Years
Discussion Span
Last Post by ArkM
0

I'm not saying you can't do it in c++, but it will bring a lot of baggage (such as stl classes) that you may not want or need. C will be tighter code, smaller code, and often faster code.

0

You can use minix and modify source code here and there , you will never be able to write a new OS code yourself.

0

Will I be able to write the whole OS in C or C++, or will there be parts I won't be able to do?

0

depends. If the file system is going to be all new then you will have to write a cross compiler first that will target the file system.

If you plan to use one of the existing file systems such as that used in *nix or MS-Windows then you can use one of the existing compilers.

I have not written an os, but I would imagine parts of it may need to be in assembly because there are some assembly instructions that have no c counterpart.

0

Both C and C++ provide for (implementation defined) asm declaration (builtin assembler code) so the formal answer is "Yes, you might do that". Can you - that's a question.

It is better to bootstrap a new system from the scratch in C because the C runtime support is much more simpler than for C++ one (for example, imagine proper stack unwind after C++ exception code). That's why sometimes C called a very high level assembler...

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.