Writing an Operating System

Thread Solved
Reply

Join Date: Nov 2008
Posts: 70
Reputation: orwell84 is an unknown quantity at this point 
Solved Threads: 3
orwell84's Avatar
orwell84 orwell84 is offline Offline
Junior Poster in Training

Writing an Operating System

 
0
  #1
Nov 5th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,151
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1435
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is online now Online
Most Valuable Poster

Re: Writing an Operating System

 
0
  #2
Nov 5th, 2008
C is probably a better language than C++. Lots of operating systems have been written using C.

>>The next question I have is where to start.
Here are some google links you should read
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 70
Reputation: orwell84 is an unknown quantity at this point 
Solved Threads: 3
orwell84's Avatar
orwell84 orwell84 is offline Offline
Junior Poster in Training

Re: Writing an Operating System

 
0
  #3
Nov 5th, 2008
So what makes C better than C++ in this case?
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,151
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1435
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is online now Online
Most Valuable Poster

Re: Writing an Operating System

 
0
  #4
Nov 5th, 2008
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.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 1,780
Reputation: ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all 
Solved Threads: 113
ithelp's Avatar
ithelp ithelp is offline Offline
Posting Virtuoso

Re: Writing an Operating System

 
0
  #5
Nov 6th, 2008
You can use minix and modify source code here and there , you will never be able to write a new OS code yourself.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 70
Reputation: orwell84 is an unknown quantity at this point 
Solved Threads: 3
orwell84's Avatar
orwell84 orwell84 is offline Offline
Junior Poster in Training

Re: Writing an Operating System

 
0
  #6
Nov 7th, 2008
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?
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,151
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1435
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is online now Online
Most Valuable Poster

Re: Writing an Operating System

 
0
  #7
Nov 7th, 2008
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.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 2,001
Reputation: ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of 
Solved Threads: 343
ArkM's Avatar
ArkM ArkM is offline Offline
Postaholic

Re: Writing an Operating System

 
0
  #8
Nov 7th, 2008
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...
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC