First of all, when we saySince early era C programming language came around 1972 and Java Came in 1995and is a direct descendant of C. But since early era people prefer C ratherthan Java. Even today all the main stream OS like Mac, Windows and Linux use C· Macuses (Objective C) and kernel is in C · Window’skernel is in C.· EvenMost part of Linux including its kernel is in C.
When it comes to writingan OS, we need a language to directly interact with the hardware. OS needs tocare about all the low-level details like interfacing with your hardware ormanaging memory. Languages running in VMs like Java do not offer suchfunctionality Using them does not make any sense from a language point of view.But when it comes to C it provides Both interfacing and memory management andwith performance. C is a very simple andportable language and became very popular even in its early days because of itsportability.
C has been ported to a very wide range of CPU architectures andthe reason is that the first thing most CPU designers do now a day’s is port “C”to the new CPU architecture. C has so widely spread that it has a great deal ofinfluence on the design of the CPU instruction set itself. Thus, making it anIdeal choice for any one looking to design a new OS C has no need for supportingheap memory management we can provide our own heap memory management for simpleand enormous fixed sized array. Java needs heap management as part of therun-time support thus making C a much better option for designing an OS.
C programming language canbe separated from its libraries and does not really require a runtimeenvironment. Other than the fact that your CPU is missing things such asmultiplication or division, stack operations, etc. Floating point math isn’treally needed by most of the OSes thus making it Ideal for designing OS but iffloating point math is required as part of the Operating System than runtimesupport may be needed