What type of Code to use??

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Smith
Member
Member
Posts: 38
Joined: Wed Feb 02, 2005 12:00 am

What type of Code to use??

Post by Smith »

I have read many books and they all say to use ASM or C. The thing is I only know C++. What should I learn.

Smith


P.S. Could I use Microsoft Visual BASIC or C++?
User avatar
carbonBased
Member
Member
Posts: 382
Joined: Sat Nov 20, 2004 12:00 am
Location: Wellesley, Ontario, Canada
Contact:

Re: What type of Code to use??

Post by carbonBased »

You could always write your OS in C++, then.

You'll, inevitably, need to use some assembly language, but very little. I'm very comfortable in assembly, but wanted to minimize it's usage (as it's not portable, and I intend my OS to run on a couple different platforms). As such, I currently have 588 lines of asm (a lot of this includes comments, btw), and the rest is all C (as a comparison, about 6000 lines of C).

That being said, if you know C++, you basically know C... you just need to think more functionally rather then OOP.

And, of course, you're not limited to these. Several ppl are using Pascal, and Java to write their OS. NeXTSTEP was written in Objective-C (which is a very good OOP language for OSDev, btw). I, personally, would love to see an OS built in eiffel (and after my OS is up and running and reasonably functional, I intend to begin development on one).

Cheers,
Jeff
Legend
Member
Member
Posts: 195
Joined: Tue Nov 02, 2004 12:00 am
Contact:

Re: What type of Code to use??

Post by Legend »

Using C++ is ver well possible, too, however using exceptions and rtti is not the best idea, as those need a lot of run time support, which is next too anti-oo-zealotism the other reason why most don't use c++ (or would use any oo language like java, too).
The other features can be done with a few functions.
*post*
neil
Posts: 8
Joined: Fri Feb 25, 2005 12:00 am
Location: Nice, France
Contact:

Re: What type of Code to use??

Post by neil »

And note that asm is not a programming language (mean, it has no syntax) but the interface between the coder and the processor. So if you know the processor, you know asm (and vice versa).
rexlunae
Member
Member
Posts: 134
Joined: Sun Oct 24, 2004 11:00 pm
Location: North Dakota, where the buffalo roam

Re: What type of Code to use??

Post by rexlunae »

neil wrote:And note that asm is not a programming language (mean, it has no syntax)
You're right and wrong here. asm is not a programming language, but not because it has "no syntax". Assembly is a catagory of languages, each being substantially different because different processors support different operations. Assembly is not a language, but x86 Assembly is.
neil wrote:...but the interface between the coder and the processor. So if you know the processor, you know asm
This is complete nonsense. Consider the confusion that occurs when people who know Intel-syntax x86 assembly try to read or write ATT-syntax. Oh, hey, look...syntax.
Post Reply