Operating System Kernel

Operating System Kernel

Kernel is the core part of operating system and responsible for all major activities of this operating system.
Kernel consists of various modules and it interacts directly with the low level hardware.
OS Kernel

KernelOperating System
Kernel is the core part of operating systemOperating system (OS) is a collection of software that manages computer hardware resources
It acts as an interface between software and hardware of the computer system.It acts as an interface between user and hardware of the computer
It plays an important role in memory management, task management, process management and disk management.It responsible for protection and security of the computer system.
Monolithic Kernel and Micro kernel are the two types of kernel.Single and Multiprogramming batch system, Distributed operating system, Real-time operating system are the types of operating system.

Monolithic Kernel (UNIX):

All operating system services run along the main kernel thread in a monolithic kernel, which also resides in the same memory area, thereby providing powerful and rich hardware access.

Advanages:

  1. Process fast because of small sourse and compiled code size
  2. Less bugs and more security because of less code

Disadvanages:

  1. Hard to debug and testing takes more time
  2. Hard to maintain, patch (补丁), extend

Micro Kernel (Mac OS):

Define a simple abstraction over hardware that use primitives or system calls to implement minimum OS services such as multitasking, memory management and interprocess communication.

Advanages:

  1. Service separation has the advantage that if one service fails others can still work so reliability is the primary feature. This means maintenance is easier.
  2. Different services are built into special modules which can be loaded or unloaded when needed. Patches can be tested separately then swapped to take over on a production instance.
  3. Message passing allows independent communication and allows extensibility.
  4. The fact that there is no need to reboot the kernel implies rapid test and development.

Disadvanages:

  1. Memory foot print is large
  2. Potential performance loss (more software interfaces due to message passing)
  3. Message passing bugs are not easy to fix
  4. Process management is complex

Difference between Monolithic Kernel and Micro Kernel

Comparison between Monolithic Kernel vs MicroKernelMonolithic KernelMicroKernel
Execution StyleAll processes are executed under the kernel space in privileged modeOnly the most important processes take place in the Kernel space. All other processes are executed in the user space
SizeKernel size is bigger when compared to MicrokernelKernel size is smaller with respect to the monolithic kernel
SpeedIt provides faster execution of processesProcess execution is slower
StabilityA single process crash will cause the entire system to crashA single process crash will have no impact on other processes
Inter-Process CommunicationUse signals and sockets to achieve interprocess communicationUse messaging queues to achieve interprocess communication
ExtensibilityDifficult to extendEasily extensible
MaintainabilityMaintenance is more time and resource consumingEasily maintainable
DebugHarder to debugEasier to debug
SecurityLess SecureMore Secure
ExampleLinuxMac OS

Preemptive Kernel:

A preemptive kernel is where the kernel allows a process to be removed and replaced while it is running in kernel mode.

  • complex soultion
  • better responsiveness
  • eliminates risk of excessively long kernel code activities

Non-Preemptive Kernel:

A nonpreemptive kernel does not allow a process running in kernel mode to be preempted;

  • simple solution
  • eliminates OS Race Conditions

Race Conditions

Race Conditions = Technical Term means two or more processes Read/Write on Shared data

Reference

https://www.tutorialspoint.com/what-is-the-difference-between-a-kernel-and-an-operating-system
https://www.educba.com/monolithic-kernel-vs-microkernel/
https://www.8bitavenue.com/monolithic-vs-microkernel-os-architectures/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值