User:Lionel/What kind of kernel should I make?

From OSDev.wiki
Revision as of 20:20, 24 June 2012 by Lionel (talk | contribs) (Added Monolithic and Megalithic)
Jump to navigation Jump to search
This page is a work in progress.
This page may thus be incomplete. Its content may be changed in the near future.

This is a personal choice. Some kernels may have advantages that others don't, but they also have disadvantages. You can start out with an already made kernel, and develop from there. Or you can create your own completely different kind of kernel that is 100% yours. It's your choice. There is no wrong way to develop a kernel, unless, of course it causes too many problems. But if you want to know what common parts make a kernel "sane" then keep on reading.

Common Parts

A kernel needs to have some basic parts, even if they are stubs that call something else. Feel free to add anything that you think most kernels need.

(x86/ARM) Interupt handling

Main article: Interrupts

This is a must, because any kernel needs to handle requests and notifications for the hardware. If the CPU doesn't support some type of signaling system, replace all instances of "interrupt" with "polling".

Common Kernel Archetypes

Megalithic

Main article: Megalithic Kernel

Difficulty:


It only keeps to itself, not sharing anything with user-mode. A Megalithic kernel is probably the easiest because everything is in the kernel binary, which means that there is no task switching. This is probably the kind of kernel you should make if you are developing on a embedded system.

Monolithic

Main article: Monolithic Kernel

Difficulty:


It keeps to itself most of the time, but its mother is making it share with user-mode. A Monolithic kernel is basically a big unchanging binary, and if there is any change, the kernel needs to be replaced again. This design is fast, but not stable, as any bug can break the kernel easily. It would work well on a embedded system, but modern Monolithic Kernels, such as Linux, run on PC's as well. This is the second easiest, and is the one most people start out on, as components can be moved to create different archetypes.