Page 1 of 1

n00b question

Posted: Fri Jan 14, 2005 12:00 am
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

Re: n00b question

Posted: Sat Jan 15, 2005 12:00 am
by Peter
There are different styles, but most of the time, ASM is afways available.

Re: n00b question

Posted: Sat Jan 15, 2005 12:00 am
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)

Re: n00b question

Posted: Sun Jan 16, 2005 12:00 am
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