[Day 6] 2. Types of Kernel
1. Monolithic Kernel
A monolithic kernel is an operating system architecture where the entire kernel operates as a single large program in memory. It handles key tasks such as file management, device drivers, memory management, and system calls, all directly in kernel space.
- Imagine the OS as a team: In a monolithic kernel, the team works together in one big room without dividing tasks into separate areas.
- This enables faster communication between tasks, but fixing issues or adding features becomes more complicated due to tight integration.
In technical terms:
- files → compiled into
.cfiles (object files).o - files → linked into a single executable binary file, which is the kernel.
.o
!2. Monolithic.png
Example: UNIX
2. Micro kernel
A micro kernel architecture keeps only essential functions in the kernel, such as basic process management and inter-process communication (IPC). Other components, like device drivers, file systems, and network management, run in user space as separate processes.
- Think of the micro kernel as a small control centre for critical tasks, with most work being handled by "external workers."
- This modular structure improves maintainability and security, though communication between components is slower.
!2. Micro.png
Monolithic vs. Microkernel:
- Monolithic: Faster, but harder to maintain. If one component fails, the entire kernel can crash.
- Microkernel: Slower, but more stable and easier to maintain. One failure doesn't bring down the whole system.
Examples: Symbian, MACH
3. Modular Kernel
A modular kernel is a hybrid of monolithic and microkernel architectures. It uses dynamically loadable modules, meaning only essential parts of the kernel load at startup. Additional modules load at runtime when needed.
- Faster than a microkernel but slower than a monolithic kernel.
- Easier to maintain with no need for IPC. However, if one module fails, the whole kernel can still crash.
!3. Modular.png
Example: Windows
Linux Kernel
The Linux Kernel is a combination of monolithic, micro, and modular kernel architectures, making it highly versatile.
Static Components
-
Kernel (vmlinuz) located in
, containing features required at all times./boot/Functions include:
- Process Management
- CPU Scheduling
- Memory Management
- IO Management
- File Management
- Hardware Abstraction
- System Calls
Dynamic Components
-
Dynamically loadable modules loaded into RAM only when needed during runtime.
Examples:
- File System Managers: FAT, NTFS, ZFS
- Device Drivers
-
These modules are called kernel objects with the extension
..ko -
Location: /lib/modules/ `uname -r`
Note: mac OS uses a hybrid kernel like Linux, combining MACH and UNIX. The kernel is named Darwin.
For Linux kernel source code, visit kernel.org.
Read Next
[Day 6] 3. Shell Scripting again
## **Types of Loops in Shell Scripting** 1. **For Loop** 2. **While Loop** 3. **Until Loop** 4. **Select Loop** --- ### **1. While Loop**...
[Day 7] 1. Dual Mode Operation of OS
### **Differentiating OS Processes and User Processes** - **User processes** are the regular programs you run as a user, like opening a text editor...