Early operating systems were implemented in assembler due to efficiency concerns. However, the availability of faster computers with sufficient amounts of main memory and the requirement to port an operating system to incompatible computers made implementing an OS on such a low level impractical. Thus, system programming languages such as C were introduced to enable OS implementation on a more abstract level.
However, the simplicity of C and its creation on a still quite restricted machine as the PDP11 meant that compromises were required [1]. Some of these compromises, such as omitting runtine checks of array indexes, helped with performance, but are also the source of a significant share of today's security problems [2]. Accordingly, the specification of C changed over time, though many programmers still have the model of a PDP11 in their head when writing C code. The resulting problems are described in [3].
This topic can be taken in a number of directions, such as discussing undefined behavior in C code [4] or the use of secure programming languages [5,6], e.g. in designing the Singularity OS by Microsoft [7] (interesting videos are linked on the Singularity Wikipedia page [8]).