How to Open Kernel?

How is a kernel made/created?

  • I was just wondering how a kernel is made? Is it written in an IDE? If yes then how was the first kernel written? A brief history of kernels or the development of computers would be nice :)

  • Answer:

    Yes, currently kernels can be written using an IDE (In fact we have to, because the sheer size of code makes it impossible to manage otherwise), just like other software. A kernel is the most important piece of software in an Operating System and is made up of many core components - CPU management (Process & thread scheduling), Memory management (Paging, Segmentation algorithms), I/O Management, Process/Thread synchronization mechanisms (Mutexes, Spinlocks, Semaphores), Messaging (IPC, Shared Memory, RPC), Interrupts & signals and many more things. There are different kinds of kernel architectures - Monolithic, Microkernel, Exokernel etc. Based on the architecture, we segregate the modules that need to be within the kernel and those that we can afford to put outside. Your question also asks about the circular  dependency - to develop something, you need a working operating system  and a development environment and conversely, you need to build an operating system first to develop anything else. Here's your answer.. The  initial developers did start out from scratch with nothing. I am not  sure about the exact process they went through but I'll tell you how I  would do it and practically speaking, it should be similar. The  following explanation is very abstracted and overly simplified. They  first wrote a BIOS in binary and burned it on to the ROM, but with  additional capability that allowed them to take binary input using  external toggle switches and execute them on the processor. Getting here  is in itself super hard, and then you would need to write out the  drivers for the keyboard, the monitor and everything else you absolutely  need in binary using toggle switches! One important point  throughout is the architecture of the processor and knowing instruction  set for that processor - each opcode translates to a different operation  and operands can be addresses (memory locations) or an immediate  operand and each instruction has a binary equivalent). Once you know  that, you need to build up a simple assembler from scratch using binary  and once you reach this stage, life becomes a bit easier (not very easy,  but easier). You can start building the rest of the assembler using the  assembler you've already written. So, you can use the existing  assembler to assemble the remaining parts of itself until you have a  fully functional assembler. After this, you build a simple compiler  (bare bones/primitives) for a higher level language (like C) using  assembly language and then, again use the compiler to compile remaining  parts of itself. Once you have a fully functional compiler, you can  build an operating system using the compiler. So, once you have a working compiler, you can start building each module of the kernel and when you have a somewhat stable kernel with the minimal features you need, get the boot loader to load the kernel when the computer starts up.

Vinay Bharadwaj at Quora Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.