How are Operating Systems “Made”?
Well, the answer lives in books: Modern Operating Systems – Andrew S. Tanenbaum is a very good one. The cover illustration below. The simplest yet complete operating system kernel, suitable for learning or just curiosity, is Minix. Here you can browse the source code. (source: cs.vu.nl)