- Once an OS is designed, it must be implemented. Traditionally, OSs have been written in assembly language. Now, however, they are most commonly written in higher-level languages such as C or C++.
- The advantages of using a higher-level language, or at least a systems-implementation language, for implementing OSs are the same as those accrued when the language is used for application programs:
- The code can be written faster, is more compact, and is easier to understand and debug.
- In addition, improvements in compiler technology will improve the generated code for the entire OS by simple recompilation.
- Finally, an OS is far easier to port (to move to some other hardware) if it is written in a higher-level language.
- For example, MS-DOS was written in Intel 8088 assembly language. Consequently, it is available on only the Intel family of CPUs.
- The Linux OS, in contrast, is written mostly in C and is available on a number of different CPUs, including Inte180X86, Motorola 680XO, SPARC, and MIPS RXOOO.
- The only possible disadvantages of implementing an OS in a higher-level language are reduced speed and increased storage requirements.
- As is true in other systems, major performance improvements in OSs are more likely to be the result of better data structures and algorithms than of excellent assembly-language code.
- In addition, although OSs are large, only a small amount of the code is critical to high performance; the memory manager and the CPU scheduler are probably the most critical routines.
Cem Ozdogan
2011-02-14