Jump to content

Operating system/Kernel models: Difference between revisions

From Wikiversity
Content deleted Content added
No edit summary
Tags: Visual edit Mobile edit Mobile web edit
No edit summary
Tags: Visual edit Mobile edit Mobile web edit
 
(19 intermediate revisions by 11 users not shown)
Line 2: Line 2:
The kernel is the name given to the program that does most of the housekeeping tasks for the operating system. The [[boot loader]] hands control over to the kernel, which initializes the various devices to a known state and makes the computer ready for general operation.
The kernel is the name given to the program that does most of the housekeeping tasks for the operating system. The [[boot loader]] hands control over to the kernel, which initializes the various devices to a known state and makes the computer ready for general operation.


After preparing the hardware for use, the kernel provides an abstraction layer between the hardware and software running on the system. Through an [[API]], or application programming interface, software can request the kernel to perform hardware tasks, as well as access many common functions. Most current kernels also multi-task the hardware, sharing it between the various processes running on the system.
After preparing the hardware for use, the kernel provides an abstraction layer between the hardware and software running on the system. Through an application programming interface ([[API]]), software can request the kernel to perform hardware tasks, as well as access many common functions. Most current kernels also multi-task the hardware, sharing it between the various processes running on the system.


==Monolithic Kernel==
==Monolithic Kernel==
Line 8: Line 8:
[[Image:Kernel-monolithic.svg|thumb|right|300px|Graphical overview of a Monolithic kernel]]
[[Image:Kernel-monolithic.svg|thumb|right|300px|Graphical overview of a Monolithic kernel]]
{{wikipedia|Monolithic kernel}}
{{wikipedia|Monolithic kernel}}
Monolithic Kernels function with all of the kernel and device drivers inside one address space running in kernel mode. The principle advantage to this approach is efficiency (especially on x86 architectures where a task switch is a particularly expensive operation). Unfortunately, monolithic kernels suffer the risk of the entire system crashing due to a bug in a device driver.
Monolithic Kernels function with all of the kernel and device drivers inside one address space running in kernel mode. The principle advantage to this approach is efficiency (especially on x86 architectures or 32-bit computer systems where a task switch is a particularly expensive operation). Unfortunately, monolithic kernels suffer the risk of the entire system crashing due to a bug in a [[wikipedia:Device_driver|device driver]], the reason being it is running in the same area with the kernel and other drivers, so, if something fails every other driver and program will be affected.


====Pros====
====Pros====
Line 16: Line 16:
====Cons====
====Cons====
*Potential stability issues
*Potential stability issues
*Can become huge - Linux 2.6 has 7.0 million lines of code and Windows over 30 million!
*Can become huge - Linux 4.15 has 20 million lines of code and Windows 10 contains over 40 million lines!
*Potentially difficult to maintain
*Potentially difficult to maintain


Line 24: Line 24:
*MS-DOS, Windows 9x
*MS-DOS, Windows 9x
*Mac OS versions below 8.6
*Mac OS versions below 8.6



==Microkernel==
==Microkernel==
Line 30: Line 29:
[[Image:Kernel-microkernel.svg|thumb|right|300px|Graphical overview of a microkernel]]
[[Image:Kernel-microkernel.svg|thumb|right|300px|Graphical overview of a microkernel]]
{{wikipedia|Microkernel}}
{{wikipedia|Microkernel}}
A Microkernel tries to run most of its services and device drivers in userspace. This can result in an increase in stability and possibly security on machines with a Memory Management Unit.
A Microkernel tries to run most of its services and device drivers in userspace. This can result in an increase in stability and possibly security on machines with a Memory Management Unit. Unlike monolithic kernels, most of the components run in some kind of container, so if something fails, the module or driver will be restarted.


====Pros====
====Pros====
Line 41: Line 40:
*Additional context switches are usually required
*Additional context switches are usually required
*Slow Inter Process Communication can result in poor performance
*Slow Inter Process Communication can result in poor performance
Not helpful for threads
*Not helpful for threads


===Examples===
===Examples===
Line 48: Line 47:
*Mach
*Mach
*Minix
*Minix
*MorphOS
*L4
*L4
*QNX
*QNX
Line 58: Line 58:


===Examples===
===Examples===
*NT kernel (used in Windows NT, 2000, XP, Vista and Windows 7)
*NT kernel (used in Windows NT, 2000, XP, Vista, 7, 8, and 10)
*Darwin (Mac OS X's kernel)
*XNU (Mac OS X and ios' kernel)
*DragonFly BSD
*DragonFly BSD
*BeOS
*BeOS
*Plan [[9]]
*Plan 9
*


[[Category:Computer programming]]
[[Category:Computer programming]]

Latest revision as of 05:05, 1 November 2023

Introduction

[edit | edit source]

The kernel is the name given to the program that does most of the housekeeping tasks for the operating system. The boot loader hands control over to the kernel, which initializes the various devices to a known state and makes the computer ready for general operation.

After preparing the hardware for use, the kernel provides an abstraction layer between the hardware and software running on the system. Through an application programming interface (API), software can request the kernel to perform hardware tasks, as well as access many common functions. Most current kernels also multi-task the hardware, sharing it between the various processes running on the system.

Monolithic Kernel

[edit | edit source]

Design

[edit | edit source]
Graphical overview of a Monolithic kernel
Search for Monolithic kernel on Wikipedia.

Monolithic Kernels function with all of the kernel and device drivers inside one address space running in kernel mode. The principle advantage to this approach is efficiency (especially on x86 architectures or 32-bit computer systems where a task switch is a particularly expensive operation). Unfortunately, monolithic kernels suffer the risk of the entire system crashing due to a bug in a device driver, the reason being it is running in the same area with the kernel and other drivers, so, if something fails every other driver and program will be affected.

  • Speed
  • Simplicity of design
  • Potential stability issues
  • Can become huge - Linux 4.15 has 20 million lines of code and Windows 10 contains over 40 million lines!
  • Potentially difficult to maintain

Examples

[edit | edit source]
  • Traditional Unix kernels (includes BSDs and Solaris)
  • Linux
  • MS-DOS, Windows 9x
  • Mac OS versions below 8.6

Microkernel

[edit | edit source]

Design

[edit | edit source]
Graphical overview of a microkernel
Search for Microkernel on Wikipedia.

A Microkernel tries to run most of its services and device drivers in userspace. This can result in an increase in stability and possibly security on machines with a Memory Management Unit. Unlike monolithic kernels, most of the components run in some kind of container, so if something fails, the module or driver will be restarted.

  • Stability
  • Security
  • Potentially more responsive (though often not in practice)
  • Benefits for SMP machines
  • Additional context switches are usually required
  • Slow Inter Process Communication can result in poor performance
  • Not helpful for threads

Examples

[edit | edit source]
  • AmigaOS
  • Amoeba
  • Mach
  • Minix
  • MorphOS
  • L4
  • QNX

Hybrid kernel

[edit | edit source]

Design

[edit | edit source]
Graphical overview of a hybrid kernel
Search for Hybrid kernel on Wikipedia.

A hybrid kernel combines the concepts of both monolithic kernels and microkernels. It is generally implemented by having a monolithic kernel with a more microkernel like design. When properly implemented it is hoped that this will result in the performance benefits of a monolithic kernel, with the stability of a Microkernel

Examples

[edit | edit source]
  • NT kernel (used in Windows NT, 2000, XP, Vista, 7, 8, and 10)
  • XNU (Mac OS X and ios' kernel)
  • DragonFly BSD
  • BeOS
  • Plan 9