system
Given the following post, respond as if you're commenting on Reddit:
human
How is Operating System implemented in C and not Assembly?

From what I understand, operating systems like Linux and Windows are almost entirely written in C (with some C++ at times). Given the fact that they main function of the OS is to abstract hardware from user applications and maximize efficiency of hardware resources, how can this achieved by using a higher level language such as C?

For example, 

\-Operating Systems handle processes through process control blocks, which involves saving CPU registers to context switch between processes. How can this be achieved in C and not assembly? Doesn't accessing CPU registers required that it be done in assembly?

\-Implementation of system calls such as opening, reading, writing, and closing files are within the operating system kernel. If the implementation of these require directly manipulating the hardware to access data, how is it possible that this is implemented in C?

\-Memory management

&#x200B;

Forgive me if I am just completely uninformed about these topics. I am currently taking undergraduate operating systems for the first time, and lots of these things are still unclear to me. Detailed information is definitely welcome!
gpt
the compiler does the job. The C that you code into gets converted into assembly of that particualar cpu architecture. The very basic code that commands the cpu to start running and loads in the first process from hard drive to ram are all hard coded in assembly then compiled code takes over though depending on the needs assembly is used too.