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

From OSDev.wiki
Jump to navigation Jump to search
Content deleted Content added
Lionel (talk | contribs)
Added Monolithic and Megalithic
Line 21: Line 21:
----
----
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.
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.

=== Hybrid ===
{{main|Hybrid Kernel}}
Difficulty:[[File:Difficulty_2.png]]
----
A blend of Monolithic and Micro kernel, some drivers are in kernel mode and some out. This will work quite well, as you don't have to change between modes for any privellaged instruction, while code that doesn't need kernel privellages won't bring it down. However, discerning needs to be done, making it more difficult. Windows NT + (XP,Vista,7,8 are NT) uses this design.

Revision as of 16:37, 25 June 2012

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.

Hybrid

Main article: Hybrid Kernel

Difficulty:


A blend of Monolithic and Micro kernel, some drivers are in kernel mode and some out. This will work quite well, as you don't have to change between modes for any privellaged instruction, while code that doesn't need kernel privellages won't bring it down. However, discerning needs to be done, making it more difficult. Windows NT + (XP,Vista,7,8 are NT) uses this design.