I'm trying to understand how you set about writing an OS in something like C.
I've always used C to write applications - using commands like malloc
and fork
and so on to request things from the OS. If these methods don't exist when you're programming the OS itself (or perhaps the Kernel in particular), how do you write them?
How do you implement memory and process management and so on, specifically what functions are available and what is exposed to allows you to do this in C instead of assembler? (what do you call to interact with memory / devices / interrupts?)
I can imagine this isn't a small question, so I'm more than happy for an answer that includes some further reading but if you'd be able to summarise the main points related to each question that would be super handy for me!
Thanks in advance!
EDIT (8/3/20):
This related question has some good resources attached to it which help with answering the question:
What are some resources for getting started in operating system development?