Page 1 of 1
What type of Code to use??
Posted: Sat Mar 05, 2005 12:00 am
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++?
Re: What type of Code to use??
Posted: Sat Mar 05, 2005 12:00 am
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
Re: What type of Code to use??
Posted: Sat Mar 05, 2005 12:00 am
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.
Re: What type of Code to use??
Posted: Tue Mar 08, 2005 12:00 am
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).
Re: What type of Code to use??
Posted: Tue Mar 08, 2005 12:00 am
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.