Operating Systems > Linux and UNIX

Software

<< < (3/3)

voidmain:

quote:Originally posted by Calum:
hmm, i just assumed that if it was totally open source, and if it were running on the same upper level software (linux/XWindows/and-so-on) that it would be compilable on a new machine. Does this mean there is low level machine specific code in it? or am i really missing the point?
--- End quote ---


Yes, there is hardware (processor) specific code that needs to be ported, especially if you include any ASM. A simple example is the different way in which memory is addressed (big endian vs little endian), and RISC chips have an entirely different set of registers which are not used the same as CISC processors, and you have 32 vs 64 bit etc etc.  

Simple helloworld.c programs will compile with no problems across the board using the GCC compiler but when you start getting into lower level stuff (something you usually want to do to get every bit of performance you can) then the code has to be written to the specific processor.

Calum:
gracious! i hope this stuff is routinely covered once i get up to that stage in my mental development.

i can see how it might be a choice between performance and portability then.

voidmain:
Well I oversimplified it. Really most anything you would write startig out using GCC on one platform will compile just fine using GCC on another platform. If you start getting into very large applications or something needing very low level raw access to resources then you need to put greater weight on portability. Usually apps written with portability in mind from the start aren't a problem. Most apps don't start out with portability in mind though.  

Navigation

[0] Message Index

[*] Previous page

Go to full version