Since a kernel handles many fundamental processes, it must be loaded at the beginning of the boot sequence when a computer starts up. The kernel performs a system check and recognizes components, such as the processor, GPU, and memory. It also checks for any connected peripherals. As the OS loads and the graphical user interface appears, the kernel keeps running. Even after the OS has fully loaded, the kernel continues to run in the background, managing system resources.
Types of Kernels
Several types of kernels exist, but two popular ones include monolithic kernels and microkernels. A monolithic kernel is a single codebase, or block of source code, that provides all the necessary services offered by the operating system. It is a simplistic design and creates a well-defined communication layer between the hardware and software.
Microkernels have the same function as monolithic kernels, but they are designed to be as small as possible. Instead of managing all the resources from a single codebase, the kernel handles only the most basic functions. It uses modules or "servers" to manage everything else. For example, device drivers are typically included in a monolithic kernel, but they would be split into separate modules in a microkernel. This design is more complex, but it can provide a more efficient use of system resources and helps protect against system crashes.
Since the kernel handles the most basic functions of a computer, if it crashes it can take down the entire computer. This undesirable event is called a "kernel panic" on macOS and Unix systems. It is similar to the blue screen of death in Windows. The only way to recover from a kernel panic is to restart your computer.
NOTE: Kernel panics are often caused by hardware communication issues. Therefore, if your computer is producing repeated kernel panics, try unplugging unnecessary devices to see if that fixes the problem.