The advantages of using a higher-level language, or at least a systemsimplementation
language, for implementing operating systems are the same
as those gained 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 operating system by simple recompilation. Finally, an
operating system 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 runs natively only on the Intel
X86 family of CPUs. (Note that although MS-DOS runs natively only on Intel
X86, emulators of the X86 instruction set allow the operating system to run on
other CPUs—but more slowly, and with higher resource use. As we mentioned
in Chapter 1, emulators are programs that duplicate the functionality of one
system on another system.) The Linux operating system, in contrast, is written
mostly in C and is available natively on a number of different CPUs, including
Intel X86, Oracle SPARC, and IBMPowerPC.