n00b question

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
Demonix
Posts: 6
Joined: Mon Dec 06, 2004 12:00 am
Location: Under your bed :P

n00b question

Post by Demonix »

Hey

Looking into OSDev as my main 'thing'. I program in C++ and I was wondering, does every type of processor have it's own style or type of language ? I'm looking to play around with Unix based OS's.

Demonix
Learn, learn, then eat and drink, then learn some more!
Peter
Posts: 13
Joined: Wed Jan 05, 2005 12:00 am

Re: n00b question

Post by Peter »

There are different styles, but most of the time, ASM is afways available.
[AlAdDiN]
Member
Member
Posts: 107
Joined: Fri Oct 22, 2004 11:00 pm
Contact:

Re: n00b question

Post by [AlAdDiN] »

Demonix wrote:Hey

Looking into OSDev as my main 'thing'. I program in C++ and I was wondering, does every type of processor have it's own style or type of language ? I'm looking to play around with Unix based OS's.

Demonix
there is two main sets of CPUs : CISC and RISC
and there is lot of models in each set
each model have generally it's own instruction set (assembly language)
but some of programming laguages are portable to many models (C and C++ for example)
-----------------------
There are 10 types of people in this world... those that understand binary, and those that don't.
User avatar
gaf
Member
Member
Posts: 349
Joined: Thu Oct 21, 2004 11:00 pm
Location: Munich, Germany

Re: n00b question

Post by gaf »

Looking into OSDev as my main 'thing'. I program in C++ and I was wondering, does every type of processor have it's own style or type of language ?
Hi Demonix,
there are several computer architecture sthat are not compatible with each other:
- IA32/AA64 - x86 Desktop PCs, AMD's 64bit processors
- IA64 - Intel's 64bit processors
- SPARC
- ARM
- etc

Each of these architectures has an assembly language of its own, but (as long as you're programming in a high-level language lile C++) this shouldn't bother you because it's the compiler's job to deal with it.
Note that the computer architectures also differ in many other fields. If you want to write an OS that can be run on all of them you'll need a very good and portable design.

Although CPU's of the same architecture are compatible there're still differences. For example the i386 and the P4 are both IA32 processors but the P4 supports a lot of things the i386 is not capable of. Some of these issues can be dealt by the compiler (MMX, SSE, etc) others have to be included into your OS design (sysenter/sysexit instruction, address-spaces > 4GB, etc).

regards,
gaf
Last edited by gaf on Sun Jan 16, 2005 12:00 am, edited 1 time in total.
Post Reply