Skip to content

Kernel

Kernel

  • Kernel is the core part of an operating system that manages system resources.
  • It also acts as a bridge between the application and hardware of the computer.
  • The CPU can execute certain instructions only when it is in kernel mode.
  • The operating system puts the CPU in kernel mode when it is executing in the kernel so, that kernel can execute some special operation.
  • The operating system puts the CPU in user mode when a user program is in execution so, that the user program cannot interface with the operating system program.

Services of Kernel

  1. I/O Scheduling
  2. To schedule a set of I/O requests means to determine a good order in which to execute them.
  3. Buffering
  4. A buffer is a memory area that stores data being transferred between two devices or between a device and an application.
  5. Caching
  6. A cache is a region of fast memory that holds a copy of data. Access to the cached copy is much easier than the original file.
  7. Spooling
  8. A spool is a buffer that holds the output of a device, such as a printer that cannot accept interleaved data streams.
  9. Although a printer can serve only one job at a time, several applications may wish to print their output concurrently, without having their output mixes together.
  10. Error Handling
  11. I/O Protection

Microkernel

  • A microkernel is one of the classifications of the kernel.
  • In a microkernel, the user services and kernel services are implemented in different address spaces.
  • The user services are kept in user address space, and kernel services are kept under kernel address space, thus also reduces the size of kernel and size of an operating system as well.

Monolithic Kernel

  • Apart from microkernel, Monolithic Kernel is another classification of Kernel.
  • Like microkernel, this one also manages system resources between application and hardware, but user services and kernel services are implemented under the same address space.
  • It increases the size of the kernel, thus increases the size of the operating system as well.

Dual Mode Operation

  1. User Mode / Non-Privileged Mode

  2. When the computer system is run by user applications like creating a text document or using any application program, then the system is in user mode.

  3. When the user application requests for a service from the operating system or an interrupt occurs or system call, then there will be a transition from user to kernel mode to fulfill the requests.

  4. Kernel Mode / Privileged Mode

  5. When the system boots, hardware starts in kernel mode and when the operating system is loaded, it starts user application in user mode.
  6. To provide protection to the hardware, we have privileged instructions which execute only in kernel mode.
  7. If the user attempts to run privileged instruction in user mode then it will treat instruction as illegal and traps to OS.