educative.io

Educative

Where does OS live and how does it manage itself?

If we think about OS as a program, it will have its own heap, stack, and code sections. However, how does OS manage its own memory? In particular, how does OS manages its own stack and code? When OS needs more heap memory, does it handle that? Thanks in advance!